younifyd
Menu

Get Custom Relationships

Get all custom relationships

GET/pcm/custom-relationships

Use it in a workflow

  1. Add a step and choose the Elastic Path connector.
  2. Pick the Get Custom Relationships action (under PIM).
  3. Fill in the fields below, then reference the result from later steps as {{getCustomRelationships.response.data}}.

Request

Query parameters

page[offset]integer (int64)

The number of records to offset the results by.

page[limit]integer (int64)

The number of records per page. The maximum limit is 100.

filterstring

Many Commerce API endpoints support filtering. The general syntax is described [**here**](/guides/Getting-Started/filtering).

Response

Returns 200 with an object. Read it in later steps with {{getCustomRelationships.response.data.<field>}}.

dataarray<object>
idstringrequired

A unique identifier generated when a custom relationship is created.

typestringrequired

This represents the type of resource object being returned. Always `custom-relationship`.

One ofcustom-relationship

attributesobjectrequired7 fields
metaobjectrequired2 fields
linksobject

Links are used to allow you to move between requests.

firststring

Always the first page.

laststring

This is `null` if there is only one page.

nextstring

This is `null` if there is only one page.

prevstring

This is `null` if you on the first page.

metaobject
resultsobject1 fields

Contains the results for the entire collection.

json
{
  "data": [
    {
      "id": "string",
      "type": "custom-relationship",
      "attributes": {
        "name": "Related Products",
        "slug": "CRP_related_products",
        "description": "A list of related products shown on the PDP.",
        "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"
        }
      }
    }
  ],
  "meta": {
    "results": {
      "total": 30
    }
  },
  "links": {
    "first": "/pcm/custom_relationships?page[offset]=0&page[limit]=10",
    "last": "/pcm/custom_relationships?page[offset]=20&page[limit]=10",
    "next": "/pcm/custom_relationships?page[offset]=10&page[limit]=10",
    "prev": "/pcm/custom_relationships?page[offset]=8&page[limit]=10"
  }
}

Need more? See the Elastic Path guide for connection setup and behaviour shared by every action.