Coupon
Create coupon
Enables you to create a coupon that can be applied to get discounts
post/api-offers/coupon/create
Request
- Base URLhttps://live.copilot.fabric.inc
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Headers
x-site-contextstring required
Example:{"date": "2023-01-01T00:00:00.000Z", "channel": 12, "account": "1234abcd5678efgh9ijklmno","stage":"production"}
The x-site-context header is a JSON object that contains information about the source you wish to pull from. The mandatory account is the 24 character identifier found in Copilot. The channel (Sales channel ID), stage (environment name), and date attributes can be used to further narrow the scope of your data source.
Request body
Example request
{
"title": "CREATE COUPON",
"buyOperator": "OR",
"promo": [
{
"discount": [
{
"unit": "%OFF",
"value": 10,
"ON": {
"kind": "SKU",
"value": "*",
"quantity": 2,
"includeOperator": "OR",
"excludeOperator": "AND"
}
}
],
"targetProducts": [
{
"kind": "SKU",
"value": "*",
"operator": "IN"
}
],
"condition": [
{
"includeOperator": "OR",
"excludeOperator": "AND",
"conditions": [
{
"key": "SKU",
"value": "*",
"operator": "IN"
}
]
}
]
}
],
"startDate": "2019-08-24T14:15:22Z",
"endDate": "2019-08-25T14:15:22Z",
"isExclusive": true,
"type": "PRODUCT",
"stackingType": "STACKABLE",
"level": 1,
"termsAndConditions": [
{
"title": "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"
]
}
],
"shipmentMethodIds": [
"1000001"
],
"eligiblePriceList": [
10000056
],
"note": "Independence day sale!",
"limits": [
{
"kind": "ORDER",
"value": 2
}
],
"additionalAttributes": [
{
"key": "type",
"value": "Birthday",
"attributeId": 100000
}
]
}Response
OK
Changes
No recorded changes to this operation across all 2 revisions of this API.