POST
/
api-offers
/
promo
/
list
curl --request POST \
  --url https://live.copilot.fabric.inc/api-offers/promo/list \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-site-context: <x-site-context>' \
  --data '{
  "offset": 0,
  "limit": 10,
  "keyword": "PROMO",
  "sortBy": "updatedAt",
  "sortOrder": "desc"
}'
{
  "query": {
    "limit": 10,
    "offset": 0,
    "count": 50
  },
  "promos": [
    {
      "_id": "abcdefg1ee7ce20123456789",
      "promoId": 100013,
      "promoCodes": [
        "SUMMER100",
        "SUMMER20"
      ],
      "promoCount": 0,
      "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"
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-site-context
string
required

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.

Example:

"{\"date\": \"2023-01-01T00:00:00.000Z\", \"channel\": 12, \"account\": \"1234abcd5678efgh9ijklmno\",\"stage\":\"production\"}"

Body

application/json
offset
number

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.

Required range: x >= 0
Example:

0

limit
number
default:10

The maximum number of records per page.

Required range: 1 <= x <= 100
Example:

10

keyword
string

Keyword to filter the matched promotion titles or promotional codes or coupon codes

Example:

"PROMO"

sortBy
enum<string>
default:updatedAt

Field by which you want to sort the records

Available options:
updatedAt,
title,
startDate,
endDate
Example:

"updatedAt"

sortOrder
enum<string>
default:desc

Sorting order of the records<br />desc: Descending order<br />asc: Ascending order

Available options:
desc,
asc
Example:

"desc"

Response

200
application/json
OK
query
object
promos
object[]

Represents the conditions based on which the promotions apply. For example, consider the type is USER_SEGMENT with multiple values. To target all the specified segments, use the AND operator and to target any one of the segments, use the OR operator.