post https://{host}/v1/promotions//link
This API is used to link the code of the cart promotion earned by the customer to the customer id.
Example request
curl --location 'https://eu.api.capillarytech.com/api_gateway/v1/promotions/code/link' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic Z2VvcmdlLmJ1a2w6NzYzNDkxOGI3MGQ3YzI4ZjU4ZjY3MmNhZjY1ZmY=' \
--header 'Cookie: _cfuvidt2b9D_Wbvu39g2t0iystT.W9RDJ0-1751522911573-0.0.1.1-604800000; _cfuvid=DWAI.W93CwD8HSqqIDN38lKP84bJoUrRqwVps-1761979737913-0.0.1.1-604800000' \
--data '{
"customerId": 566881933,
"code": "DQCV73",
"mode": "DISCOUNT"
}'Prerequisites
- Authentication: Basic or OAuth authentication.
- Default access group
Rate limit
- Demo and Testing Clusters: 1,000 requests per minute per API key
- Other Organizations: The rate limit is brand-specific.
To modify the limit, create a ticket with the Capillary Product support team.
Body parameters
| Field | Type | Required | Description |
|---|---|---|---|
| customerId | Number | Yes | Specifies the unique identifier for the customer. |
| code | String | Yes | Specifies the promotion code to be linked. |
| mode | String | Yes | Specifies the promotion mode. Enum: DISCOUNT, PAYMENT_VOUCHER. |
Example response
{
"data": {
"id": "68fb18d331d91c625a8d9e52",
"orgId": 100458,
"promotionId": "68fb18a431d91c625a8d9e51",
"promotionName": "eratg",
"code": "DQCV73",
"customerId": 566881933,
"active": true,
"createdOn": 1761286355257,
"createdOnISO": "2025-10-24T06:12:35Z",
"validTill": 1763787599999,
"validTillISO": "2025-11-22T04:59:59Z",
"mode": "DISCOUNT",
"redeemableFrom": 1761286355257,
"redeemableFromISO": "2025-10-24T06:12:35Z"
}
}Response parameters
| Field | Type | Description |
|---|---|---|
| data | Object | Defines the primary response object, containing the linked promotion code details. |
| errors | Array | Defines a list of error objects. |
| ..id | String | Specifies the unique identifier for this specific promotion code record. |
| ..orgId | Number | Specifies the Organization ID to which the code belongs. |
| ..promotionId | String | Specifies the unique identifier for the cart promotion that this code activates. |
| ..promotionName | String | Specifies the name of the cart promotion the code is linked to. |
| ..code | String | Specifies the cart promotion code itself. |
| ..customerId | Number | Specifies the Customer identifier that this code is now linked to. |
| ..active | Boolean | Indicates whether the code is currently active and available for use. |
| ..createdOn | Number | Indicates the creation timestamp in epoch milliseconds. |
| ..createdOnISO | String | Specifies the creation timestamp in ISO 8601 format. |
| ..validTill | Number | Indicates the expiration timestamp in epoch milliseconds. |
| ..validTillISO | String | Specifies the expiration timestamp in ISO 8601 format. |
| ..mode | String | Specifies the promotion's operational mode. |
| ..redeemableFrom | Number | Indicates the timestamp in epoch milliseconds from when the code can be first used. |
| ..redeemableFromISO | String | Specifies the timestamp in ISO 8601 format from when the code is redeemable. |
