Coupons

Search for coupons

Use this endpoint to search for coupons based on filter conditions.

post/coupons/search

Request

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.

Request body

sizenumber

The maximum number of records per page.

offsetinteger

The number of records to skip before returning records. For example, with an offset of 20 and limit of 10, you will get records from 21 to 30.

sort'+updatedAt' | '+name' | '+startAt' | '+endAt' | '+level' | '-updatedAt' | '-name' | '-startAt' | '-endAt' | '-level'

The criteria to sort the results. Use the format {sort order}{field name}, where - refers to a descending order and + refers to an ascending order.

Example request

{
  "size": 10,
  "offset": 10,
  "filters": [
    {
      "field": "name",
      "value": "Summer",
      "operator": "EQUAL"
    }
  ]
}

Response

OK

Example response

{
  "query": {
    "size": 10,
    "offset": 10,
    "count": 50
  },
  "data": [
    {
      "id": "abcdefg1ee7ce20123456789",
      "couponCodes": [
        "SUMMER100",
        "SUMMER20"
      ],
      "status": "SCHEDULED",
      "name": "CREATE PROMO",
      "startAt": "2019-08-24T14:15:22Z",
      "endAt": "2019-08-25T14:15:22Z",
      "updatedAt": "2019-08-20T14:15:22Z",
      "singleMultiUse": "MULTI_USE",
      "type": "PRODUCT",
      "level": 1,
      "stackingType": "STACKABLE",
      "isStackable": true,
      "additionalAttributes": [
        {
          "name": "type",
          "values": "Birthday",
          "attributeId": 100000
        }
      ],
      "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!"
          }
        ]
      }
    }
  ]
}

Changes

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