Elastic Path Custom Relationships API

The Custom Relationships API from Elastic Path — 2 operation(s) for custom relationships.

Operations 5

POST /pcm/custom-relationships Create a custom relationship #
GET /pcm/custom-relationships Get all custom relationships #
PUT /pcm/custom-relationships/{customRelationshipSlug} Update a custom relationship #
GET /pcm/custom-relationships/{customRelationshipSlug} Get a custom relationship #
DELETE /pcm/custom-relationships/{customRelationshipSlug} Delete a custom relationship #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/elastic-path-custom-relationships-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

elastic-path-custom-relationships-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Product Experience Manager Introduction Custom Relationships API
  description: '

    Product Experience Manager uses the PIM service to manage product information, hierarchies, and price books. Ideally, Product Experience Manager becomes the single source of truth for product data across your organization.


    In Commerce, the product data is stored separately from pricing, catalogs, and inventory. This separation means that you retrieve all product data only when you are managing product data and assets. Otherwise, when setting prices or managing inventory, you retrieve a reference to the product rather than the entire product, which makes the response times very fast.


    You also have the flexibility to create catalogs for different scenarios by combining hierarchies of products with a price book. Scenarios might include:


    - **Multiple geographical regions**. Display different catalogs in different regions with suitable pricing or combine product hierarchies from two different regions to display in a third region.

    - **Multiple channels**. Display different catalogs based on how a shopper accesses your store, such as through a mobile app or a web storefront.

    - **Direct to business versus direct to customers**. Offer different products and prices for business customers versus retail customers.

    - **Preferred customers**. Offer special pricing to preferred customers while displaying a standard price catalog to all other shoppers.

    - **Reward programs**. Enable reward programs where catalog prices drop after a certain spending level is reached.

    - **Product sales**. Offer sale items for a limited time.


    Scenarios are created by defining the context within which a catalog is displays. Contexts can be a customer ID, a channel, or any other user-defined tag that can be passed to the APIs from the front-end shopper experiences.

    '
  version: 26.0612.7739142
  x-version-timestamp: 2026-06-12 10:52:50+00:00
servers:
- url: https://euwest.api.elasticpath.com
  description: EU West Production Server
- url: https://useast.api.elasticpath.com
  description: US East Production Server
security:
- bearerAuth: []
tags:
- name: Custom Relationships
paths:
  /pcm/custom-relationships:
    post:
      summary: Create a custom relationship
      description: "Custom relationships can either be bi-directional or uni-directional.\n  - **Uni-Directional**: By setting `bi_directional` to `false` (or omitted from request) a uni-directional custom relationship will be created. \n  Within a uni-directional relationship, if Product A links to Product B, Product B will not link back to Product A. \n  This is ideal when one product (e.g., a base product) recommends another (e.g., an upsell), but the reverse \n  recommendation is unnecessary.\n \n - **Bi-Directional**: By setting `bi_directional` to `true` a bi-directional custom relationship will be created. Within a bi-directional \n relationship, if Product A is linked to Product B, Product B will automatically link back to Product A. \n This bi-directionality ensures a consistent experience, where products always suggest each other as related items.\n \n  For more information on use cases, see [Custom Relationships](/guides/key-concepts/product-experience-manager/custom-relationships/).\n\nCustom Relationship slugs must meet the following criteria:\n  - be unique \n  - be prefixed with `CRP_`. Product Experience Manager automatically adds the `CRP_` prefix if you do not include it.\n  - contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed.\n \nOnce a custom relationship has been created, you can then create Product Relationships:\n   1. Add the custom relationship to a product. See [Attach a custom relationship to a product](/docs/api/pxm/products/attach-custom-relationships).\n   2. Associate a product to multiple products. See [Associate a product with other products under a custom relationship](/docs/api/pxm/products/product-association-id).\n"
      operationId: createCustomRelationship
      tags:
      - Custom Relationships
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/create_custom_relationship'
            examples:
              create-basic-custom-relationship:
                $ref: '#/components/examples/create_basic_custom_relationship'
              create-custom-relationship-external-sort-order:
                $ref: '#/components/examples/create_custom_relationship_with_external_sort_order'
              create-custom-relationship-bi-directional:
                $ref: '#/components/examples/create_custom_relationship_bi_directional'
        required: true
      responses:
        '201':
          description: Returns a created custom relationship with the following attributes.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/single_custom_relationship'
              examples:
                created-basic-custom-relationship:
                  $ref: '#/components/examples/custom_relationship_created'
                created-custom-relationship-external-sort-order:
                  $ref: '#/components/examples/custom_relationship_with_external_sort_order_created'
                created-custom-relationship-bi-directional:
                  $ref: '#/components/examples/custom_relationship_bi_directional_created'
        '422':
          $ref: '#/components/responses/unprocessable_entity'
        '500':
          $ref: '#/components/responses/internal'
    get:
      operationId: getCustomRelationships
      parameters:
      - $ref: '#/components/parameters/page_offset'
      - $ref: '#/components/parameters/page_limit'
      - $ref: '#/components/parameters/filtercr'
      summary: Get all custom relationships
      description: "Gets all Custom Relationships. \n\nTo see a list of custom relationships a product is attached to, see [Get all Custom Relationships attached to a Product](/docs/api/pxm/products/list-attached-custom-relationship).\n\nTo see a list of products that a product is related to, see [Get all Related Products of a Products' attached Custom Relationship](/docs/api/pxm/products/get-related-products-of-a-product-id).\n\n### Filtering\n\n Many Commerce API endpoints support filtering. The general syntax is described in [**Filtering**](/guides/Getting-Started/filtering).\n\n The following attributes and operators are supported.\n\n | Operator | Attribute | Description | Example |\n | :--- |:---|:---|:---|\n | `eq` | `owner`, `slug` | Equals. Checks if the values of two operands are equal. If they are, the condition is true. | `filter=eq(owner,store)` |\n | `in` | `slug`          | In. Checks if a value exists in a given list of values. If the value matches any item in the list, the condition is true. | `filter=in(slug,slug-1,slug-2,slug-3)` |\n"
      tags:
      - Custom Relationships
      responses:
        '200':
          description: Returns a list of all custom relationships.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/multi_custom_relationships'
              examples:
                list-custom-relationships:
                  $ref: '#/components/examples/resp_multi_custom_relationships'
        '400':
          $ref: '#/components/responses/bad_request'
        '500':
          $ref: '#/components/responses/internal'
  /pcm/custom-relationships/{customRelationshipSlug}:
    put:
      operationId: updateCustomRelationship
      parameters:
      - $ref: '#/components/parameters/custom_relationship_slug'
      summary: Update a custom relationship
      description: "Updates a custom relationship. \n\nA partial update can be performed, where you specify only the fields that need to be changed.\n\nThe custom relationship slug cannot be updated.\n"
      tags:
      - Custom Relationships
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update_custom_relationship'
            examples:
              update-custom-relationship:
                $ref: '#/components/examples/update_custom_relationship'
        required: true
      responses:
        '200':
          description: Successfully returns the updated custom relationship
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/single_custom_relationship'
              examples:
                updated-custom-relationship:
                  summary: Updated
                  $ref: '#/components/examples/custom_relationship_updated'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/not_found'
        '422':
          $ref: '#/components/responses/unprocessable_entity'
        '500':
          $ref: '#/components/responses/internal'
    get:
      parameters:
      - $ref: '#/components/parameters/custom_relationship_slug'
      summary: Get a custom relationship
      description: 'Gets a Custom Relationship.


        To see a list of custom relationships a product is attached to, see [Get all Custom Relationships attached to a Product](/docs/api/pxm/products/list-attached-custom-relationship).


        To see a list of products that a product is related to, see [Get all Related Products of a Products'' attached Custom Relationship](/docs/api/pxm/products/get-related-products-of-a-product-id).

        '
      operationId: getCustomRelationship
      tags:
      - Custom Relationships
      responses:
        '200':
          description: Returns a custom relationship with the following attributes.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/single_custom_relationship'
              examples:
                get-custom-relationship:
                  summary: Get
                  $ref: '#/components/examples/custom_relationship_updated'
        '400':
          $ref: '#/components/responses/bad_request'
        '404':
          $ref: '#/components/responses/not_found'
        '500':
          $ref: '#/components/responses/internal'
    delete:
      operationId: deleteCustomRelationship
      parameters:
      - $ref: '#/components/parameters/custom_relationship_slug'
      summary: Delete a custom relationship
      description: 'Deletes the specified custom relationship.


        Custom Relationships cannot be deleted if they are in use.

        '
      tags:
      - Custom Relationships
      responses:
        '204':
          description: No Content
        '400':
          $ref: '#/components/responses/bad_request'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/not_found'
        '500':
          $ref: '#/components/responses/internal'
components:
  parameters:
    page_offset:
      name: page[offset]
      in: query
      description: The number of records to offset the results by.
      schema:
        type: integer
        minimum: 0
        maximum: 10000
        format: int64
        example: 0
    custom_relationship_slug:
      name: customRelationshipSlug
      in: path
      schema:
        type: string
        example: CRP_electric_devices_2024
      required: true
      description: A custom relationship slug.
    page_limit:
      name: page[limit]
      in: query
      description: The number of records per page. The maximum limit is 100.
      schema:
        type: integer
        minimum: 0
        maximum: 10000
        format: int64
        example: 10
    filtercr:
      name: filter
      in: query
      description: 'Many Commerce API endpoints support filtering. The general syntax is described [**here**](/guides/Getting-Started/filtering).

        '
      style: form
      explode: true
      schema:
        type: string
      examples:
        eq-owner:
          value: eq(owner,store)
  examples:
    custom_relationship_bi_directional_created:
      summary: Bi-Directional
      value:
        data:
          id: e390ff7e-efc4-4769-90d2-fceabcc1e2cd
          type: custom-relationship
          attributes:
            name: Related Products
            description: A list of related products shown on the PDP
            slug: CRP_related_products
            bi_directional: true
          meta:
            owner: store
            timestamps:
              created_at: '2024-01-10T20:16:35.343Z'
              updated_at: '2024-01-10T20:16:35.343Z'
    create_custom_relationship_bi_directional:
      summary: Bi-Directional
      description: Create a custom relationship with bi-directional relationships.
      value:
        data:
          type: custom-relationship
          attributes:
            name: Related Products
            description: A list of related products shown on the PDP
            slug: CRP_related_products
            bi_directional: true
    update_custom_relationship:
      summary: Update
      value:
        data:
          type: custom-relationship
          id: f3297ee8-da90-45e9-ae56-a2654aebbdfe
          attributes:
            name: Related Products
            description: A list of related products shown on the PDP
            slug: CRP_related_products
            sort_order: 5
            external_name: Similar items to consider
            external_description: Check out these similar products that may also meet your needs or match your preferences.
            bi_directional: false
    create_custom_relationship_with_external_sort_order:
      summary: External Name and Description, and Sort Order
      description: Create a custom relationship with an external name and description, as well as specifying a sort order.
      value:
        data:
          type: custom-relationship
          attributes:
            name: Related Products
            description: A list of related products shown on the PDP
            slug: CRP_related_products
            sort_order: 5
            external_name: Similar items to consider
            external_description: Check out these similar products that may also meet your needs or match your preferences.
    custom_relationship_updated:
      value:
        data:
          type: custom-relationship
          id: f3297ee8-da90-45e9-ae56-a2654aebbdfe
          attributes:
            name: Related Products
            description: A list of related products shown on the PDP
            slug: CRP_related_products
            sort_order: 5
            external_name: Similar items to consider
            external_description: Check out these similar products that may also meet your needs or match your preferences.
            bi_directional: false
          meta:
            owner: store
            timestamps:
              created_at: '2024-01-10T20:16:35.343Z'
              updated_at: '2024-01-10T20:16:35.343Z'
    custom_relationship_created:
      summary: Basic
      value:
        data:
          id: f3297ee8-da90-45e9-ae56-a2654aebbdfe
          type: custom-relationship
          attributes:
            name: Kitchen electrics
            description: Kitchen electric devices
            slug: CRP_kitchen_individual_devices
            bi_directional: false
          meta:
            owner: store
            timestamps:
              created_at: '2024-01-10T20:16:35.343Z'
              updated_at: '2024-01-10T20:16:35.343Z'
    resp_multi_custom_relationships:
      value:
        data:
        - id: f3297ee8-da90-45e9-ae56-a2654aebbdfe
          type: custom-relationship
          attributes:
            name: Kitchen electrics
            description: Kitchen electric devices
            slug: CRP_kitchen_individual_devices
            bi_directional: false
          meta:
            owner: store
            timestamps:
              created_at: '2024-01-10T20:16:35.343Z'
              updated_at: '2024-01-10T20:16:35.343Z'
        - id: 21b1315b-c47f-4766-85bf-7bf0f94d73b6
          type: custom-relationship
          attributes:
            name: Related Products
            description: A list of related products shown on the PDP
            slug: CRP_related_products
            bi_directional: true
          meta:
            owner: store
            timestamps:
              created_at: '2024-01-10T20:16:35.343Z'
              updated_at: '2024-01-10T20:16:35.343Z'
        - id: e390ff7e-efc4-4769-90d2-fceabcc1e2cd
          type: custom-relationship
          attributes:
            name: Related Products
            description: A list of related products shown on the PDP
            slug: CRP_related_products
            sort_order: 5
            external_name: Similar items to consider
            external_description: Check out these similar products that may also meet your needs or match your preferences.
            bi_directional: false
          meta:
            owner: store
            timestamps:
              created_at: '2024-01-10T20:16:35.343Z'
              updated_at: '2024-01-10T20:16:35.343Z'
        links:
          last: /pcm/custom_relationships?page[offset]=29&page[limit]=1
          next: /pcm/custom_relationships?page[offset]=1&page[limit]=1
        meta:
          results:
            total: 3
    custom_relationship_with_external_sort_order_created:
      summary: External name and description, and sort order
      value:
        data:
          id: e390ff7e-efc4-4769-90d2-fceabcc1e2cd
          type: custom-relationship
          attributes:
            name: Related Products
            description: A list of related products shown on the PDP
            slug: CRP_related_products
            sort_order: 5
            external_name: Similar items to consider
            external_description: Check out these similar products that may also meet your needs or match your preferences.
            bi_directional: false
          meta:
            owner: store
            timestamps:
              created_at: '2024-01-10T20:16:35.343Z'
              updated_at: '2024-01-10T20:16:35.343Z'
    create_basic_custom_relationship:
      summary: Basic
      description: Create a custom relationship with minimal fields.
      value:
        data:
          type: custom-relationship
          attributes:
            name: Kitchen electrics
            description: Kitchen electric devices
            slug: CRP_kitchen_individual_devices
  schemas:
    multi_custom_relationships:
      type: object
      required:
      - data
      - meta
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/custom_relationship'
        links:
          $ref: '#/components/schemas/multi_links_cr'
        meta:
          $ref: '#/components/schemas/multi_meta'
    create_custom_relationship:
      type: object
      required:
      - data
      properties:
        data:
          type: object
          required:
          - type
          - attributes
          properties:
            type:
              description: This represents the type of resource object being returned. Always `custom-relationship`.
              type: string
              enum:
              - custom-relationship
            attributes:
              $ref: '#/components/schemas/req_attributes_custom_relationship'
    multi_meta:
      type: object
      properties:
        results:
          description: Contains the results for the entire collection.
          type: object
          properties:
            total:
              description: Total number of results for the entire collection.
              type: integer
              example: 30
              minimum: 0
    single_custom_relationship:
      type: object
      required:
      - data
      properties:
        data:
          $ref: '#/components/schemas/custom_relationship'
    multi_links_cr:
      type: object
      description: Links are used to allow you to move between requests.
      properties:
        first:
          description: Always the first page.
          type: string
          example: /pcm/custom_relationships?page[offset]=0&page[limit]=10
        last:
          description: This is `null` if there is only one page.
          type: string
          example: /pcm/custom_relationships?page[offset]=20&page[limit]=10
        next:
          description: This is `null` if there is only one page.
          type: string
          example: /pcm/custom_relationships?page[offset]=10&page[limit]=10
        prev:
          description: This is `null` if you on the first page.
          type: string
          example: /pcm/custom_relationships?page[offset]=8&page[limit]=10
    req_attributes_custom_relationship:
      type: object
      additionalProperties: false
      required:
      - name
      - slug
      properties:
        name:
          description: The name of the custom relationship to display to shoppers, such as `Kitchen electrics`.
          type: string
          example: Related Products
        description:
          description: A description of the custom relationship.
          type: string
          example: A list of related products shown on the PDP.
        slug:
          description: A unique slug for the custom relationship. Must match the slug specified in the request path. A slug can contain A to Z, a to z, 0 to 9, hyphen, underscore, and period. Spaces or other special characters like ^, [], *, and $ are not allowed.
          type: string
          example: CRP_related_products
          pattern: ^[A-Za-z0-9._-]+$
        sort_order:
          description: The order in which the custom relationship should be displayed in relation to others. A lower value represents a higher priority in the display order. If set to NULL, the sort order will be removed.
          type:
          - integer
          - 'null'
          example: 5
        external_name:
          description: The shopper-facing name for the custom relationship. This value will be displayed to shoppers in the store-front, replacing the internal name if present. If set to NULL, the external name will be removed.
          type:
          - string
          - 'null'
          example: Similar items to consider
        external_description:
          description: The shopper-facing description for the custom relationship. This value will be shown to shoppers in the store-front, replacing the internal description if present. If set to NULL, the external description will be removed.
          type:
          - string
          - 'null'
          example: Check out these similar products that may also meet your needs or match your preferences.
        bi_directional:
          type: boolean
          description: Is this relationship one way or bi-directional `true` or `false`. Default is false
          default: false
    custom_relationship:
      type: object
      required:
      - id
      - type
      - attributes
      - meta
      properties:
        id:
          description: A unique identifier generated when a custom relationship is created.
          type: string
        type:
          description: This represents the type of resource object being returned. Always `custom-relationship`.
          type: string
          enum:
          - custom-relationship
        attributes:
          $ref: '#/components/schemas/req_attributes_custom_relationship'
        meta:
          type: object
          required:
          - owner
          - timestamps
          properties:
            owner:
              description: The owner of the resource.
              type: string
              example: store
            timestamps:
              type: object
              required:
              - created_at
              - updated_at
              properties:
                created_at:
                  description: The date and time the resource is created.
                  type: string
                  example: '2024-01-10T20:16:35.343Z'
                  format: date-time
                updated_at:
                  description: The date and time the resource is updated.
                  type: string
                  example: '2024-01-10T20:16:35.343Z'
                  format: date-time
    update_custom_relationship:
      type: object
      required:
      - data
      properties:
        data:
          type: object
          required:
          - id
          - type
          - attributes
          properties:
            id:
              type: string
              description: The unique identifier of the custom relationship.
              example: 00000000-0000-0000-0000-000000000000
            type:
              description: This represents the type of resource object being returned. Always `custom-relationship`.
              type: string
              enum:
              - custom-relationship
              example: custom-relationship
            attributes:
              $ref: '#/components/schemas/req_attributes_custom_relationship'
    error:
      required:
      - errors
      properties:
        errors:
          type: array
          items:
            required:
            - status
            - title
            properties:
              status:
                type: string
                description: The HTTP response code of the error.
                example: '500'
              title:
                type: string
                description: A brief summary of the error.
                example: Internal server error
              detail:
                type: string
                description: Optional additional detail about the error.
                example: An internal error has occurred.
              request_id:
                type: string
                description: Internal request ID.
                example: 00000000-0000-0000-0000-000000000000
              meta:
                type: object
                description: Additional supporting meta data for the error.
                example:
                  missing_ids:
                  - e7d50bd5-1833-43c0-9848-f9d325b08be8
  responses:
    bad_request:
      description: Bad request. The request failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          examples:
            bad-request:
              value:
                errors:
                - title: Bad Request
                  detail: Could not parse the supplied filter
                  status: '400'
    forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          examples:
            internal-server-error:
              value:
                errors:
                - title: Forbidden
                  status: '403'
                  detail: entity owned by organization
    not_found:
      description: Bad Request. Not Found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          examples:
            internal-server-error:
              value:
                errors:
                - title: Not Found
                  status: '404'
    internal:
      description: Internal server error. There was a system failure in the platform.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          examples:
            internal-server-error:
              value:
                errors:
                - status: '500'
                  title: Internal Server Error
                  detail: There was an internal server error, you can report with your request id.
                  request_id: 635da56d-75a1-43cd-b696-7ab119756b3a
    unprocessable_entity:
      description: Bad request. The request failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          examples:
            failed-validation:
              value:
                errors:
                - title: Failed Validation
                  status: '422'
                  detail: <XYZ> can not be empty
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer