Skip to main content

Get all custom relationships

GET 

/pcm/custom-relationships

Gets all Custom Relationships.

To see a list of custom relationships a product is attached to, see Get all Custom Relationships attached to a Product.

To see a list of products that a product is related to, see Get all Related Products of a Products' attached Custom Relationship.

Filtering

Many Commerce API endpoints support filtering. The general syntax is described in Filtering.

The following attributes and operators are supported.

OperatorAttributeDescriptionExample
eqownerEquals. Checks if the values of two operands are equal. If they are, the condition is true.filter=eq(owner,store)

Request

Query Parameters

    page[offset] int64

    Possible values: <= 10000

    The number of records to offset the results by.

    page[limit] int64

    Possible values: <= 10000

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

    filter string

    Many Commerce API endpoints support filtering. The general syntax is described here.

Responses

Returns a list of all custom relationships.

Schema
    data object[]required
  • Array [
  • id stringrequired

    A unique identifier generated when a custom relationship is created.

    type stringrequired

    Possible values: [custom-relationship]

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

    attributes objectrequired
    name stringrequired

    The name of the custom relationship to display to shoppers, such as Kitchen electrics.

    description string

    A description of the custom relationship.

    slug stringrequired

    Possible values: Value must match regular expression ^[A-Za-z0-9._-]+$

    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.

    sort_order integernullable

    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.

    external_name stringnullable

    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.

    external_description stringnullable

    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.

    bi_directional boolean

    Is this relationship one way or bi-directional true or false. Default is false

    meta objectrequired
    owner stringrequired

    The owner of the resource.

    timestamps objectrequired
    created_at date-timerequired

    The date and time the resource is created.

    updated_at date-timerequired

    The date and time the resource is updated.

  • ]
  • links object

    Links are used to allow you to move between requests.

    first string

    Always the first page.

    last string

    This is null if there is only one page.

    next string

    This is null if there is only one page.

    prev string

    This is null if you on the first page.

    meta objectrequired
    results object

    Contains the results for the entire collection.

    total integer

    Total number of results for the entire collection.

Loading...