Coupon Codes

Bulk update coupon codes

Use this endpoint to update multiple coupon codes using identifiers. Identifiers are a unique combination of a coupon code and a promotion ID. You can update up to 25 codes at a time.

put/coupon-codes/batch

Request

Headers

x-fabric-tenant-idstring required

A header used by fabric to identify the tenant making the request. You must include tenant id in the authentication header for an API request to access any of fabric’s endpoints. You can retrieve the tenant id , which is also called account id, from Copilot. This header is required.

x-fabric-channel-idstring
Example:12

x-fabric-channel-id identifies the sales channel where the API request is being made; primarily for multichannel use cases. The channel ids are 12 corresponding to US and 13 corresponding to Canada. The default channel id is 12. This field is required.

x-client-idstring

A unique identifier obtained from Copilot for the System app in the fabric ecosystem, essential for OpenID Connect authentication flows.

x-fabric-request-idstring
Example:263e731c-45c8-11ed-b878-0242ac120002

A unique request ID.

Request body

Example request

{
  "data": [
    {
      "identifier": {
        "promotionId": "6380e7ecb419a30009865fad",
        "couponCode": "XMAS2022"
      },
      "userId": "6380e7ecb419a30009865fad",
      "status": "ACTIVE",
      "additionalAttributes": [
        {
          "name": "brand",
          "values": "Nike"
        }
      ]
    }
  ]
}

Response

Accepted

Example response

{
  "data": [
    {
      "id": "641cf99d2de161c5a6d7a481",
      "title": "Summer coupons",
      "userId": "5e2cfb9b45570b000864c4b5",
      "couponCode": "SUMMER",
      "promotionId": "641cf986ca5b2c3180787e05",
      "startAt": "2023-08-10T19:00:00.000Z",
      "endAt": "2023-08-10T09:10:57.811Z",
      "status": "ACTIVE",
      "additionalAttributes": [
        {
          "name": "brand",
          "values": "2"
        }
      ],
      "promotionAdditionalAttributes": [
        {
          "name": "eventName",
          "values": "Store sale"
        }
      ],
      "createdAt": "2019-08-20T14:15:22Z",
      "updatedAt": "2019-08-20T14:15:22Z"
    }
  ],
  "errors": [
    {
      "identifier": {
        "promotionId": "6380e7ecb419a30009865fad",
        "couponCode": "XMAS2022"
      },
      "type": "COUPON_CODE_NOT_FOUND",
      "message": "Coupon code not found"
    }
  ]
}

Changes

No recorded changes to this operation across all 2 revisions of this API.