Skip to main content

Attach Custom Relationships to a Product

POST 

/pcm/products/:productID/custom-relationships

You can attach up to 5 custom relationships to a product.

Once you have attached a custom relationship to a product, you can then create relationships from a product to one or many other products. See Associate a product to one or more products using a custom relationship.

See Custom Relationships.

Prerequisites

Request

Path Parameters

    productID stringrequired

    A unique identifier for the product.

Body

    data object[]required
  • Array [
  • slug stringrequired

    The slug of the custom relationship.

    type stringrequired

    Possible values: [custom-relationship]

    This represents the type of resource. Always custom-relationship.

  • ]

Responses

Returns the attached 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...