Coupon

Search for coupons

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

post/api-offers/coupon/search

Request

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

offsetnumber

The number of records to skip before returning records. For example, when offset is 20 and limit is 10, this endpoint returns records from 21 to 30.

limitnumber

The maximum number of records per page.

sort'+updatedAt' | '+title' | '+startDate' | '+endDate' | '+level' | '-updatedAt' | '-title' | '-startDate' | '-endDate' | '-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

{
  "limit": 10,
  "filters": [
    {
      "field": "title",
      "value": "Black Friday",
      "operator": "EQUAL"
    }
  ]
}

Response

OK

Example response

{
  "query": {
    "limit": 10,
    "count": 50
  },
  "data": [
    {
      "_id": "abcdefg1ee7ce20123456789",
      "promoId": 100013,
      "promoCodes": [
        "SUMMER100",
        "SUMMER20"
      ],
      "state": "SCHEDULED",
      "isImplicit": true,
      "title": "CREATE PROMO",
      "startDate": "2019-08-24T14:15:22Z",
      "endDate": "2019-08-25T14:15:22Z",
      "isExclusive": true,
      "eligiblePriceList": [
        10000056
      ],
      "level": 1,
      "stackingType": "STACKABLE",
      "updatedAt": "2019-08-20T14:15:22Z"
    }
  ]
}

Changes

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