Create coupon
Create a coupon with the requested conditions.
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Headers
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.
24
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.
"12"
A unique identifier obtained from Copilot for the System app in the fabric ecosystem, essential for OpenID Connect authentication flows.
A unique request ID.
"263e731c-45c8-11ed-b878-0242ac120002"
Body
Coupon record detail
Coupon name
3 - 120
"Christmas 2022 coupons"
The timestamp in UTC format indicating when the coupon becomes valid.
"2022-08-24T14:15:22.000Z"
The timestamp in UTC format indicating when the coupon becomes invalid.
"2019-08-25T14:15:22.000Z"
The type of coupon promotion you want to create. The following are the coupon promotion types you can create:
PRODUCT
: A SKU coupon promotion. Applies a discount to SKUs based on the value specified in thediscount
object of the request body.CART
: A cart coupon promotion. Applies a discount to the minimum order amount of the cart based on theORDER_VALUE
specified in thecondition
object of the request body.QUANTITY
: A quantity coupon promotion. Provides discounts on items based on the quantity requirement set in the promotion.SHIPPING
: A shipping coupon promotion. Provides discounts on the shipping cost.BUYGET
: A BuyGet coupon promotion. Specifies the Buy conditions and corresponding Get discounts.SPEND_GET
: A SpendGet coupon promotion. Specifies the total order value required to qualify for discounts and the applicable discounts based on the order value.
PRODUCT
, CART
, QUANTITY
, SHIPPING
, BUYGET
, SPEND_GET
"PRODUCT"
An array containing coupon codes.
The coupon code.
Coupon creation details.
Coupon creation detail.
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.
AND
, OR
"OR"
true
: Makes the coupon exclusive, meaning it can't be applied if another promotion is already applied.false
: Allows the coupon to be applied with other promotions.
true
Restrictions or conditions that apply to the use of a coupon.
Coupon limit detail. Limits for coupons can only be configured at cart level.
Terms and conditions for the promotion
Promotion terms and conditions
Message description for the promotion
Message description for the promotion
Required for Shipping type promotion to provide eligible shipment methods.
Shipping method ID. This ID is used to evaluate cart promotion.
Price list IDs to be considered for this promotion.
The price list ID.
Merchant-specified attributes associated with the coupon.
Merchant-specified attributes associated with the coupon.
A brief note or description of the coupon.
"Independence day sale!"
The order in which the coupons must be executed.
0 <= x <= 5
3
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. Thelevel
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. Thelevel
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.
STACKABLE
, EXCLUSIVE
, TYPE_EXCLUSIVE
, UNIVERSAL
"STACKABLE"
true
: Allows the coupon to be stacked so it can be applied with other coupons.false
: Disables coupon stacking.
false
Set true
to always apply the coupon, even on non-stackable promotions, or false
to apply coupon based on configured conditions.
false
Determines whether the coupon is valid for single use or for multiple uses. The options are:
SINGLE_USE
: The coupon can be used only once.MULTI_USE
: The coupon can be used multiple times.
SINGLE_USE
, MULTI_USE
"MULTI_USE"
Response
The coupon details.
A 24-character system-generated coupon ID, generated using the create coupon endpoint.
"6380e7ecb419a30009865fad"
The name of the coupon.
"Christmas 2022 coupons"
The status of the coupon.
ACTIVE
, SCHEDULED
, DISABLED
, EXPIRED
"SCHEDULED"
The timestamp in UTC format indicating when the coupon becomes valid.
"2022-08-24T14:15:22.000Z"
The timestamp in UTC format indicating when the coupon expires and is no longer valid.
"2019-08-25T14:15:22.000Z"
The type of coupon promotion you want to create. The following are the coupon promotion types you can create:
PRODUCT
: A SKU coupon promotion. Applies a discount to SKUs based on the value specified in thediscount
object of the request body.CART
: A cart coupon promotion. Applies a discount to the minimum order amount of the cart based on theORDER_VALUE
specified in thecondition
object of the request body.QUANTITY
: A quantity coupon promotion. Provides discounts on items based on the quantity requirement set in the promotion.SHIPPING
: A shipping coupon promotion. Provides discounts on the shipping cost.BUYGET
: A BuyGet coupon promotion. Specifies the Buy conditions and corresponding Get discounts.SPEND_GET
: A SpendGet coupon promotion. Specifies the total order value required to qualify for discounts and the applicable discounts based on the order value.
PRODUCT
, CART
, QUANTITY
, SHIPPING
, BUYGET
, SPEND_GET
"PRODUCT"
The timestamp in UTC format indicating when the coupon was created.
"2019-08-20T14:15:22.000Z"
The timestamp in UTC format indicating when the coupon was last updated.
"2019-08-20T14:15:22.000Z"
The total number of coupon codes.
100
Coupon execution order
0 <= x <= 5
3
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. Thelevel
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. Thelevel
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.
STACKABLE
, EXCLUSIVE
, TYPE_EXCLUSIVE
, UNIVERSAL
"STACKABLE"
true
: Allows the coupon to be stacked so it can be applied with other coupons.false
: Disables coupon stacking.
false
Set true
to always apply the promotion, even on non-stackable promotions, or false
to apply promotion based on configured conditions.
false
Determines whether the coupon is valid for single use or for multiple uses. The options are:
SINGLE_USE
: The coupon can be used only once.MULTI_USE
: The coupon can be used multiple times.
MULTI_USE
, SINGLE_USE
"MULTI_USE"
An array containing available coupon codes.
["SUMMER1000001"]
Message description for the promotion
Message description for the promotion
A placeholder for additional attributes, in name-values pairs.
Details of additional attributes.
Was this page helpful?