Get Usages for Promotion
GET
Get Usages for Promotion
https://useast.api.elasticpath.com/v2/promotions/:id/usages
Use this endpoint to track the usage history of the specific promotion. For example, order_id
, code
, times_used
, and so on.
Parameters
Path parameters
Name | Required | Type | Description |
---|---|---|---|
id | Required | string | Specifies The unique identifier for the promotion. |
Headers
Name | Required | Type | Description |
---|---|---|---|
Authorization | Required | string | The Bearer token required to get access to the API. |
Query parameters
Name | Required | Type | Description |
---|---|---|---|
filter | Optional | string | Filter attributes. For more information, see Filtering. |
page[limit] | Optional | integer | The number of records per page. |
page[offset] | Optional | integer | The number of records to offset the results by. |
sort | Optional | string | Supported attributes are code , customer_id , order_id , customer_email , id , used_on , updated_at . When specified, the results are sorted in ascending order based on the value of the field. To sort in descending order, prefix the attribute with -, for example, -updated_at. The default sort order is updated_at in descending order. See Sorting. |
Filtering
The following operators and attributes are available for filtering usages:
Attribute | Type | Operators | Example |
---|---|---|---|
id | string | eq | eq(id,8dac76b3-9282-4730-b1dd-bdd2a95610cb) |
code | string | eq | eq(code,cart1off) |
used_on | string | gt ,ge ,le and lt | gt(used_on,2023-07-11) |
Request Example
curl https://useast.api.elasticpath.com/v2/promotions/:id/usages \
-H "Authorization: Bearer XXXX" \
-H "Content-Type: application/json" \
Response Example
200 OK
{
"data": [
{
"id": "a042bd4b-21a6-4f55-8add-5a3e8b862ddc",
"order_id": "01e2a292-f92e-4579-973c-2f3bc70acec1",
"code_id": "7905c48a-55b0-4bf0-abd7-c2cdbbb944e9",
"code": "cart2uses",
"times_used": 1,
"used_on": "2023-05-30T23:10:56.016Z",
"cusomter_id" : "1eaf092c-f6e1-48e6-a64f-1c092b711916",
"customer_email": "test@email.com",
"meta": {
"timestamps": {
"updated_at": "2024-01-03T17:37:47.111Z"
}
},
"anonymized": false
}
]
}