POST
/
promotions
curl --request POST \
  --url https://api.fabric.inc/v3/promotions \
  --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 '{
  "name": "Black Friday Promotion",
  "startAt": "2019-08-24T14:15:22Z",
  "endAt": "2019-08-25T14:15:22Z",
  "type": "PRODUCT",
  "buyOperator": "OR",
  "details": [
    {
      "discounts": [
        {
          "unit": "PERCENTAGE_OFF",
          "amount": 15,
          "type": "SKU",
          "values": "null",
          "maximumQuantity": 2,
          "includeOperator": "AND",
          "excludeOperator": "AND",
          "discountId": "1",
          "isAutoAdd": true,
          "sets": [
            "A"
          ]
        }
      ],
      "targetProducts": [
        {
          "type": "SKU",
          "values": "*",
          "operator": "IN",
          "discountId": "1"
        }
      ],
      "conditions": [
        {
          "id": "6380e7ecb419a30009865fad",
          "operator": "AND",
          "includeOperator": "AND",
          "excludeOperator": "AND",
          "conditions": [
            {
              "type": "SKU",
              "values": "*",
              "operator": "IN"
            }
          ],
          "set": "A"
        }
      ]
    }
  ],
  "termsAndConditions": [
    {
      "name": "Terms Applied",
      "description": "Items cannot be exchanged"
    }
  ],
  "promotionMessages": [
    {
      "title": "Buy 1 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": [
          "<string>"
        ],
        "message": "<string>"
      }
    ]
  },
  "shipmentMethodIds": [
    "1000001"
  ],
  "eligiblePriceLists": [
    10000056
  ],
  "limits": [
    {
      "type": "ORDER",
      "quantity": 3
    }
  ],
  "additionalAttributes": [
    {
      "name": "eventName",
      "values": "Store sale"
    }
  ],
  "note": "Independence day sale",
  "level": 3,
  "isStackable": true,
  "isAlwaysApplied": true
}'
{
  "id": "6380e7ecb419a30009865fad",
  "name": "Black Friday Promotion",
  "status": "SCHEDULED",
  "startAt": "2019-08-24T14:15:22Z",
  "endAt": "2019-08-25T14:15:22Z",
  "type": "PRODUCT",
  "createdAt": "2019-08-20T14:15:22Z",
  "updatedAt": "2019-08-20T14:15:22Z",
  "level": 3,
  "isStackable": true,
  "isAlwaysApplied": true,
  "additionalAttributes": [
    {
      "key": "type",
      "value": "Birthday",
      "attributeId": 100000
    }
  ],
  "promotionMessages": [
    {
      "title": "Buy 1 get 1 free",
      "message": "Offer valid at participating stores through September 5, 2023.",
      "pages": [
        "PDP",
        "Cart"
      ],
      "locales": [
        "en-CA",
        "fr-CA"
      ]
    }
  ]
}

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
name
string
required

The name of the promotion.

startAt
string
required

Promotion start time

endAt
string
required

Promotion end time

type
enum<string>
required

Promotion types. The options are:<br />Product: Also referred to as SKU promotion. Promotion or discount is applied on SKUs based on the value mentioned in the discount object of the request body.<br />CART: Also referred to as cart promotion. Promotion or discount is applied on the minimum order amount of the cart based on the ORDER_VALUE mentioned in the condition object of the request body.<br />QUANTITY: Quantity promotion provides discounts on items based on the quantity requirement set in the promotion.<br />SHIPPING: Shipping promotion provides discounts on the shipping cost.<br />BUYGET: BuyGet promotion specifies the Buy conditions and corresponding Get discounts.<br />SPEND_GET: SpendGet promotion specifies the total order value required to qualify for discounts and the discounts applicable based on the order value.

Available options:
PRODUCT,
CART,
QUANTITY,
SHIPPING,
BUYGET,
SPEND_GET
buyOperator
enum<string>
default: OR

Operator for conditions array. It is applied only when the promotion type is BUYGET. It is used as an operator between different conditions mentioned in the details array.

Available options:
AND,
OR
details
object[]
required

Promotion setup details

termsAndConditions
object[]

Terms and conditions for the promotion

promotionMessages
object[]

Message description for the promotion

proximityMessages
object
shipmentMethodIds
string[]

Required for Shipping type promotion to provide eligible shipment methods.

eligiblePriceLists
integer[]

Price list IDs to be considered for this promotion.

limits
object[]

Restrictions or conditions that apply to the use of a promotion

additionalAttributes
object[]

Merchant-specified attributes associated with the promotion.

note
string

Promotion note or description

level
integer

Promotion execution order. Promotion types are assigned a default execution order. First, level 1 promotions will be evaluated. The result of level 1 will be used as a base price for level 2. Similarly, the result of level 2 will be used as a base price for level 3, and so on.

isStackable
boolean

true: Promotion can be stacked, meaning their discounts will be summed together. Stackable promotions will be applied even if other promotions are applied.<br />false: Promotion cannot be applied if other promotions are applied

isAlwaysApplied
boolean

A flag indicating whether the promotion is always applied regardless of any exclusive promotions on the same item. Set to true if the promotion is always applied and set to false if the promotion is not applied on the item by default.

Response

201 - application/json
id
string
required

A 24-character system-generated promotion ID.

name
string
required

The name of the promotion.

status
enum<string>
required

The current status of the promotion.

Available options:
ACTIVE,
SCHEDULED,
DISABLED,
EXPIRED
startAt
string
required

The start time of the promotion, in UTC format.

endAt
string
required

The end time of the promotion, in UTC format.

type
enum<string>
required

Promotion types. The options are:<br />Product: Also referred to as SKU promotion. Promotion or discount is applied on SKUs based on the value mentioned in the discount object of the request body.<br />CART: Also referred to as cart promotion. Promotion or discount is applied on the minimum order amount of the cart based on the ORDER_VALUE mentioned in the condition object of the request body.<br />QUANTITY: Quantity promotion provides discounts on items based on the quantity requirement set in the promotion.<br />SHIPPING: Shipping promotion provides discounts on the shipping cost.<br />BUYGET: BuyGet promotion specifies the Buy conditions and corresponding Get discounts.<br />SPEND_GET: SpendGet promotion specifies the total order value required to qualify for discounts and the discounts applicable based on the order value.

Available options:
PRODUCT,
CART,
QUANTITY,
SHIPPING,
BUYGET,
SPEND_GET
createdAt
string

Record's creation time

updatedAt
string

Record's last updated time

level
integer

Promotion execution order. Promotion types are assigned a default execution order. First, level 1 promotions will be evaluated. The result of level 1 will be used as a base price for level 2. Similarly, the result of level 2 will be used as a base price for level 3, and so on.

isStackable
boolean

true: Promotion can be applied on top of other promotions<br />false: Promotion cannot be applied with any other promotions

isAlwaysApplied
boolean

A flag indicating whether the promotion is always applied regardless of any exclusive promotions on the same item. Set to true if the promotion is always applied and set to false if the promotion is not applied on the item by default.

additionalAttributes
object[]

A placeholder for additional attributes related to promotions, in key-value pairs.

promotionMessages
object[]

Message description for the promotion