Skip to main content

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

NameRequiredTypeDescription
idRequiredstringSpecifies The unique identifier for the promotion.

Headers

NameRequiredTypeDescription
AuthorizationRequiredstringThe Bearer token required to get access to the API.

Query parameters

NameRequiredTypeDescription
filterOptionalstringFilter attributes. For more information, see Filtering.
page[limit]OptionalintegerThe number of records per page.
page[offset]OptionalintegerThe number of records to offset the results by.
sortOptionalstringSupported 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:

AttributeTypeOperatorsExample
idstringeqeq(id,8dac76b3-9282-4730-b1dd-bdd2a95610cb)
codestringeqeq(code,cart1off)
used_onstringgt,ge,le and ltgt(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
}
]
}