PUT
/
coupon-codes
/
batch
curl --request PUT \
  --url https://api.fabric.inc/v3/coupon-codes/batch \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-fabric-channel-id: <x-fabric-channel-id>' \
  --header 'x-fabric-tenant-id: <x-fabric-tenant-id>' \
  --data '{
  "data": [
    {
      "identifier": {
        "promotionId": "6380e7ecb419a30009865fad",
        "couponCode": "XMAS2022"
      },
      "userId": "6380e7ecb419a30009865fad",
      "status": "ACTIVE",
      "additionalAttributes": [
        {
          "name": "brand",
          "values": "Nike"
        }
      ]
    }
  ]
}'
{
  "data": [
    {
      "id": "641cf99d2de161c5a6d7a481",
      "title": "Summer coupons",
      "userId": "5e2cfb9b45570b000864c4b5",
      "couponCode": "SUMMER",
      "versionId": 3,
      "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"
    }
  ]
}

Authorizations

Authorization
string
headerrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-fabric-tenant-id
string
required

Merchant's 24-character tenant ID

x-fabric-channel-id
string
required

The sales channel ID.

x-client-id
string

The platform where the request is made.

x-fabric-request-id
string

A unique request ID.

Body

application/json
data
object[]
required

The coupon codes to be updated.

Response

200 - application/json
data
object[]

The list of updated coupon codes.

errors
object[]

The list of possible errors.