younifyd
Menu

Create Custom Relationship

Create a custom relationship

POST/pcm/custom-relationships

Use it in a workflow

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

Request

Request body

Enter the body as JSON in the step's Body field.

dataobjectrequired
typestringrequired

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

One ofcustom-relationship

attributesobjectrequired7 fields
json
{
  "data": {
    "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
    }
  }
}

Response

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

dataobject
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
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"
      }
    }
  }
}

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

Was this page helpful?