Coupon Codes

Get all coupon codes

This endpoint provides coupon code lists. Use parameters to filter results, for example, set status as 'ACTIVE' for active coupons, or add userId for user-specific coupon codes. Navigate the results using the query parameters size and startCursor.

get/coupon-codes

Request

Query parameters

sizeinteger

The maximum number of records per page.

startCursorstring
Example:H796HJHGANLSADS

Specifies the record from which the search will start, effectively skipping all records before this point.

userIdstring
Example:user0001

Filter coupon codes by user ID

promotionIdstring
Example:641cf986ca5b2c3180787e09

Filter coupon codes by promotion ID generated using the create promotion endpoint.

couponCodestring
Example:SUMMER

Filter coupon codes generated using the generate coupon codes endpoint.

status'ACTIVE' | 'INACTIVE' | 'REDEEMED'

Filter coupon codes by their status

startFromstring
Example:2023-03-24T01:14:50.967Z

Filter coupon codes based on the start date of the coupon, in UTC format. startFrom and StartTo represent date range for the start date of the coupon code. For example, you can find coupon codes where start date is from '2023-03-01T01:14:50.967Z' to '2023-03-10T01:14:50.967Z'

startTostring
Example:2023-03-24T01:14:50.967Z

Filter coupon codes based on the start date of the coupon, in UTC format. startFrom and StartTo represent date range for the start date of the coupon code. For example, you can find coupon codes where start date is from '2023-03-01T01:14:50.967Z' to '2023-03-10T01:14:50.967Z'

endFromstring
Example:2023-04-24T01:14:50.967Z

Filter coupon codes based on the end date of the coupon, in UTC format. endFrom and endTo represent date range for the end date of the coupon code. For example, you can find coupon codes where end date is from '2023-04-01T01:14:50.967Z' to '2023-04-10T01:14:50.967Z'

endTostring
Example:2023-03-24T01:14:50.967Z

Filter coupon codes based on the end date of coupon, in UTC format. endFrom and endTo represent date range for the end date of the coupon code. For example, you can find coupon codes where end date is from '2023-04-01T01:14:50.967Z' to '2023-04-10T01:14:50.967Z'

additionalAttributesstring
Example:[{"name":"brand","values":"123"}]

Filter coupon codes by additional attributes. <br> This filter needs to be a valid JSON array and name:values pairs to be able to make the search.

promotionAdditionalAttributesstring
Example:[{"name":"type","values":"Holiday"}]

Filter coupon codes by supplementary attributes of a promotion.<br> This filter needs to be a valid JSON array and name:values pairs to be able to make the search.

titlestring
Example:Summer promotion

Filter coupon codes by promotion title

Headers

x-fabric-tenant-idstring 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.

x-fabric-channel-idstring
Example:12

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-idstring

A unique identifier obtained from Copilot for the System app in the fabric ecosystem, essential for OpenID Connect authentication flows.

x-fabric-request-idstring
Example:263e731c-45c8-11ed-b878-0242ac120002

A unique request ID.

Response

OK

Example response

{
  "query": {
    "size": 10,
    "nextCursor": "H796HJHGANLSADS"
  },
  "data": [
    {
      "id": "641cf99d2de161c5a6d7a481",
      "title": "Summer coupons",
      "userId": "5e2cfb9b45570b000864c4b5",
      "couponCode": "SUMMER",
      "promotionId": "641cf986ca5b2c3180787e05",
      "startAt": "2023-08-10T19:00:00.000Z",
      "endAt": "2023-08-10T09:10:57.811Z",
      "status": "ACTIVE",
      "additionalAttributes": [
        {
          "name": "brand",
          "values": "2"
        }
      ],
      "promotionAdditionalAttributes": [
        {
          "name": "eventName",
          "values": "Store sale"
        }
      ],
      "createdAt": "2019-08-20T14:15:22Z",
      "updatedAt": "2019-08-20T14:15:22Z"
    }
  ]
}

Changes

No recorded changes to this operation across all 2 revisions of this API.