POST
/
coupons

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

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.

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.

Body

application/json

Coupon record detail

name
string
required

Coupon name

Required string length: 3 - 120
startAt
string
required

Coupon start time

endAt
string
required

Coupon end time

type
enum<string>
required

Coupon types. The options are:<br>Product: Also referred to as SKU promotion. Coupon discount is applied on SKUs based on the value mentioned in the discounts array of the request body.<br>CART: Also referred to as cart promotion. 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: Discounts are applied 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
couponCodes
string[]
required

A list of coupon codes.

details
object[]
required

Coupon creation details.

buyOperator
enum<string>
default: OR

Operator for conditions array. It's applied when the coupon type is BUYGET. It's used as an operator between different condition objects mentioned in the conditions array.

Available options:
AND,
OR
isExclusive
boolean
default: false

true: It's exclusively a coupon, and can't be applied if other promotions are already applied.<br>false: Coupon can be applied in addition to the promotions.

limits
object[]

Restrictions or conditions that apply to the use of a coupon.

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.

additionalAttributes
object[]

Merchant-specified attributes associated with the coupon.

note
string

A brief note or description of the coupon.

level
integer

The order in which the coupons must be executed.

Required range: 0 < x < 5
stackingType
enum<string>

Defines the rules for how a promotion can be combined with other promotions. This field determines whether a specific promotion can be applied in conjunction with other active promotions during a transaction or if it must be used exclusively. If configured, stackingType will have precedence over the isStackable and isAlwaysApplied Possible values: - STACKABLE: This promotion can be combined with other stackable promotions, allowing multiple discounts to be applied together. The order in which stackable promotions are applied is determined by the level field, with promotions having a higher priority (lower numeric value) being applied before those with a lower priority.

  • EXCLUSIVE: This promotion can't be combined with any other promotions. The level field is used to determine which exclusive promotion will be evaluated and applied first. Once an exclusive promotion is applied, no other promotions can be used in the same transaction.
  • TYPE_EXCLUSIVE: This promotion can't be combined with other promotions of the same type. The level field is used to determine which promotion within the same type will be evaluated and applied first.
  • UNIVERSAL: This promotion can be combined with any other promotions without restrictions. Universal promotions will be evaluated last.
Available options:
STACKABLE,
EXCLUSIVE,
TYPE_EXCLUSIVE,
UNIVERSAL
isStackable
boolean

true: Coupon can be stacked, meaning a coupon can be applied with other coupons<br>false: Coupon can't be applied with other coupons

isAlwaysApplied
boolean

Set true to always apply the coupon, even on non-stackable promotions, or false to apply coupon based on configured conditions.

singleMultiUse
enum<string>

Determines whether the coupon is valid for single use or for multiple uses. The options are:<br>SINGLE_USE: The coupon can be used only once.<br>MULTI_USE: The coupon can be used multiple times.

Available options:
SINGLE_USE,
MULTI_USE

Response

201 - application/json

The coupon details.

id
string
required

A 24-character system-generated coupon ID.

name
string
required

The name of the coupon.

status
enum<string>
required

The status of the coupon.

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

The start time of a coupon.

endAt
string
required

The end time of a coupon.

type
enum<string>
required

Coupon types. The options are:<br>Product: Also referred to as SKU promotion. Coupon discount is applied on SKUs based on the value mentioned in the discounts array of the request body.<br>CART: Also referred to as cart promotion. 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: Discounts are applied 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
required

Record's creation time

updatedAt
string
required

Record's last updated time

couponCodesCount
integer

The total number of coupon codes.

level
integer

Coupon execution order

Required range: 0 < x < 5
stackingType
enum<string>

Defines the rules for how a promotion can be combined with other promotions. This field determines whether a specific promotion can be applied in conjunction with other active promotions during a transaction or if it must be used exclusively. If configured, stackingType will have precedence over the isStackable and isAlwaysApplied Possible values: - STACKABLE: This promotion can be combined with other stackable promotions, allowing multiple discounts to be applied together. The order in which stackable promotions are applied is determined by the level field, with promotions having a higher priority (lower numeric value) being applied before those with a lower priority.

  • EXCLUSIVE: This promotion can't be combined with any other promotions. The level field is used to determine which exclusive promotion will be evaluated and applied first. Once an exclusive promotion is applied, no other promotions can be used in the same transaction.
  • TYPE_EXCLUSIVE: This promotion can't be combined with other promotions of the same type. The level field is used to determine which promotion within the same type will be evaluated and applied first.
  • UNIVERSAL: This promotion can be combined with any other promotions without restrictions. Universal promotions will be evaluated last.
Available options:
STACKABLE,
EXCLUSIVE,
TYPE_EXCLUSIVE,
UNIVERSAL
isStackable
boolean

true indicates that the coupon can be stacked, meaning a coupon can be applied with other coupons, and false indicates that the coupon can't be applied with other coupons.

isAlwaysApplied
boolean

Set true to always apply the promotion, even on non-stackable promotions, or false to apply promotion based on configured conditions.

singleMultiUse
enum<string>

Determines whether the coupon is valid for single use or for multiple uses. The options are:<br>SINGLE_USE: The coupon can be used only once.<br>MULTI_USE: The coupon can be used multiple times.

Available options:
MULTI_USE,
SINGLE_USE
couponCodes
string[]

An array of available coupon codes.

promotionMessages
object[]

Message description for the promotion

additionalAttributes
object[]

A placeholder for additional attributes, in name-values pairs.