Retrieve a coupon
Use this endpoint to retrieve the details of a coupon by its ID.
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.
Response
OK
Example response
{
"id": "638a0227945d970008be0f86",
"name": "Christmas 2022 coupons",
"status": "SCHEDULED",
"type": "PRODUCT",
"startAt": "2022-08-24T14:15:22Z",
"endAt": "2019-08-25T14:15:22Z",
"buyOperator": "OR",
"note": "Independence day sale!",
"isExclusive": true,
"couponCodes": [
"XMAS2022"
],
"couponCodesCount": 100,
"details": [
{
"discounts": [
{
"unit": "PERCENTAGE_OFF",
"amount": 15,
"type": "SKU",
"values": "null",
"maximumQuantity": 2,
"includeOperator": "OR",
"excludeOperator": "AND",
"discountId": "1",
"sets": [
"A"
]
}
],
"targetProducts": [
{
"type": "SKU",
"values": "*",
"operator": "IN",
"discountId": "1"
}
],
"conditions": [
{
"id": "6380e7ecb419a30009865fad",
"operator": "AND",
"includeOperator": "OR",
"excludeOperator": "AND",
"conditions": [
{
"type": "SKU",
"values": "*",
"operator": "IN"
}
],
"set": "A"
}
]
}
],
"termsAndConditions": [
{
"name": "Terms Applied",
"description": "Items can't be exchanged"
}
],
"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"
]
}
],
"proximityMessages": {
"threshold": 1,
"localizedMessages": [
{
"locales": [
"en-CA"
],
"message": "Buy some more to get the discount!"
}
]
},
"shipmentMethodIds": [
"1000001"
],
"eligiblePriceLists": [
10000056
],
"limits": [
{
"type": "SITE_WIDE",
"quantity": 30
}
],
"additionalAttributes": [
{
"name": "eventName",
"values": "Store sale"
}
],
"createdAt": "2019-08-20T14:15:22Z",
"updatedAt": "2019-08-20T14:15:22Z",
"level": 3,
"stackingType": "STACKABLE",
"singleMultiUse": "MULTI_USE"
}Changes
No recorded changes to this operation across all 2 revisions of this API.