POST
/
promotions
curl --request POST \
  --url https://api.fabric.inc/v3/promotions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-fabric-tenant-id: <x-fabric-tenant-id>' \
  --data '{
  "name": "Black Friday Promotion",
  "startAt": "2019-08-24T14:15:22.000Z",
  "endAt": "2019-08-25T14:15:22.000Z",
  "type": "PRODUCT",
  "buyOperator": "OR",
  "details": [
    {
      "discounts": [
        {
          "unit": "PERCENTAGE_OFF",
          "amount": 15,
          "type": "SKU",
          "values": "null",
          "maximumQuantity": 2,
          "includeOperator": "OR",
          "excludeOperator": "AND",
          "discountId": "1",
          "isAutoAdd": false,
          "sets": [
            "A"
          ]
        }
      ],
      "targetProducts": [
        {
          "type": "SKU",
          "values": "*",
          "operator": "IN",
          "discountId": "1"
        }
      ],
      "conditions": [
        {
          "id": "6380e7ecb419a30009865fad",
          "operator": "AND",
          "includeOperator": "OR",
          "excludeOperator": "AND",
          "conditions": [
            {
              "type": "SKU",
              "values": "*",
              "operator": "IN"
            }
          ],
          "set": "A"
        }
      ]
    }
  ],
  "termsAndConditions": [
    {
      "name": "Terms Applied",
      "description": "Items can'\''t be exchanged"
    }
  ],
  "promotionMessages": [
    {
      "title": "Buy 2 get 1 free",
      "message": "Offer valid at participating stores through September 5, 2023.",
      "pages": [
        "PDP",
        "Cart"
      ],
      "locales": [
        "en-CA",
        "fr-CA"
      ]
    }
  ],
  "proximityMessages": {
    "threshold": 1,
    "localizedMessages": [
      {
        "locales": [
          "en-CA"
        ],
        "message": "Buy some more to get the discount!"
      }
    ]
  },
  "promotionConditionDetail": {
    "type": "SKU",
    "values": "*",
    "operator": "IN"
  },
  "shipmentMethodIds": [
    "1000001"
  ],
  "eligiblePriceLists": [
    10000056
  ],
  "limits": [
    {
      "type": "ORDER",
      "quantity": 3
    }
  ],
  "additionalAttributes": [
    {
      "name": "eventName",
      "values": "Store sale"
    }
  ],
  "note": "Independence day sale",
  "level": 3,
  "stackingType": "STACKABLE",
  "isStackable": false,
  "isAlwaysApplied": false
}'
{
  "id": "6380e7ecb419a30009865fad",
  "name": "Black Friday Promotion",
  "status": "SCHEDULED",
  "startAt": "2019-08-24T14:15:22.000Z",
  "endAt": "2019-08-25T14:15:22.000Z",
  "type": "PRODUCT",
  "createdAt": "2019-08-20T14:15:22.000Z",
  "updatedAt": "2019-08-20T14:15:22.000Z",
  "level": 3,
  "stackingType": "STACKABLE",
  "isStackable": false,
  "isAlwaysApplied": false,
  "additionalAttributes": [
    {
      "name": "type",
      "values": "Birthday",
      "attributeId": 100000
    }
  ],
  "promotionMessages": [
    {
      "title": "Buy 2 get 1 free",
      "message": "Offer valid at participating stores through September 5, 2023.",
      "pages": [
        "PDP",
        "Cart"
      ],
      "locales": [
        "en-CA",
        "fr-CA"
      ]
    }
  ]
}

Authorizations

Authorization
string
header
required

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

Headers

x-fabric-tenant-id
string
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.

Required string length: 24
x-fabric-channel-id
string

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.

Example:

"12"

x-client-id
string

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

x-fabric-request-id
string

A unique request ID.

Example:

"263e731c-45c8-11ed-b878-0242ac120002"

Body

application/json

Promotion details to be created

Response

201
application/json
Created

The details of the promotion.