younifyd
Menu

Product Association Id

Create a Relationship between a Product with one or more Products

POST/pcm/products/{productID}/custom-relationships/{customRelationshipSlug}

Use it in a workflow

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

Request

Path parameters

productIDstringrequired

A unique identifier for the product.

customRelationshipSlugstringrequired

A custom relationship slug.

Request body

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

dataarray<object>required
idstringrequired

The ID of the product you want to relate.

typestringrequired

This represents the type of resource being returned. Always `product`.

One ofproduct

attributesobject1 fields
json
{
  "data": [
    {
      "id": "string",
      "type": "product",
      "attributes": {
        "sort_order": 5
      }
    }
  ]
}

Response

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

metaobject
associated_productsarray<string>

A list of product IDs that have been successfully associated with this custom relationship.

products_not_associatedarray<object>2 fields

A list of products that could not be associated, including the reasons why.

ownerstring

The owner of the resource.

timestampsobject2 fields
json
{
  "meta": {
    "associated_products": [
      "68c48149-0e94-4ef2-93d5-8d5f3774980a",
      "ab4826d1-4a5a-4951-a2a5-98058899f891"
    ],
    "products_not_associated": [
      {
        "ID": "97b7fac2-91dd-4755-81b0-bdffe8e7eabd",
        "Details": "could not find product"
      },
      {
        "ID": "a0ef3291-2ec1-4d7d-9d6d-1705ae01bb99",
        "Details": "product already has 5 custom relationships, cannot associate more as it has reached the limit of 5 custom relationships"
      },
      {
        "ID": "bde79675-4783-40b7-8a7e-ac6df41459c6",
        "Details": "product already has 5 custom relationships, cannot associate more as it has reached the limit of 5 custom relationships"
      },
      {
        "ID": "aaddd5f4-a5f8-42e8-be9a-097986f22e58",
        "Details": "exceeded maximum allowed associations (2000). Please review and try again"
      }
    ],
    "owner": "store",
    "timestamps": {
      "created_at": "2024-08-08T09:29:08.295Z",
      "updated_at": "2024-08-08T09:29:08.295Z"
    }
  }
}

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