V1 and V2Products (V2 beta)

Update related products

PATCH
/api/v2/products/{product_id}/relationships/{relationship_id}

Modify selected relationship attributes

Modify the quantity of the related products.

Note: If the payload includes a product that doesn't exist or is not linked to the product, it will be silently ignored. No error will be returned, as the system avoids extra processing to check for product validity.

A 200 OK status code will be returned upon successful call

Request format

fieldtypedescription
product_relationshipsArray of objectslist with product and quantities

A product_relationship object is defined by:

fieldtypedescription
product_idstringproduct identifier
quantitynumberrelationship quantity

Authorization

bearerAuth
AuthorizationBearer <token>

Obtain a token via POST /auth/api/get-token (15 minute lifetime), then send it as Authorization: Bearer <token>.

In: header

Path Parameters

product_id*string
relationship_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X PATCH 'https://example.com/api/v2/products/string/relationships/string' \  -H 'Content-Type: application/json' \  --data-raw '{  "product_relationships": [    {      "quantity": 1,      "product_id": "5d0baf07d4bf5513d190245f"    },    {      "quantity": 9,      "product_id": "5d0baf07d4bf5513d1902460"    },    {      "quantity": 6,      "product_id": "5d0baf07d4bf5513d1902461"    },    {      "quantity": 1,      "product_id": "5d0baf07d4bf5513d1902462"    }  ]}'
Empty