Enable or disable a coupon
Change coupon status by ID. Enable a coupon: Only disabled coupons can be enabled. Disable a coupon: Only not expired coupons can be disabled.
Request
- Base URLhttps://api.fabric.inc/v3
- AuthHTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
A 24-character system-generated coupon ID, generated using the create coupon endpoint.
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.
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.
A unique identifier obtained from Copilot for the System app in the fabric ecosystem, essential for OpenID Connect authentication flows.
A unique request ID.
Request body
Response
OK
Example response
{
"id": "6380e7ecb419a30009865fad",
"name": "Christmas 2022 coupons",
"status": "DISABLED",
"startAt": "2022-08-24T14:15:22Z",
"endAt": "2019-08-25T14:15:22Z",
"type": "PRODUCT",
"couponCodesCount": 100,
"createdAt": "2019-08-20T14:15:22Z",
"updatedAt": "2019-08-20T14:15:22Z",
"level": 3,
"stackingType": "STACKABLE",
"singleMultiUse": "MULTI_USE",
"couponCodes": [
"SUMMER1000001"
],
"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"
]
}
],
"additionalAttributes": [
{
"name": "type",
"values": "Birthday",
"attributeId": 100000
}
]
}Changes
No recorded changes to this operation across all 2 revisions of this API.