Skip to main content

Get a Promotion Code Usage

GET Get a Promotion Code Usage

https://useast.api.elasticpath.com/v2/promotions/:id/codes/:code-name/usages

Use this endpoint to track the usage history of a specific promotion code within the specific promotion. For example, order_id, code, times_used.

Parameters

Path parameters

NameRequiredTypeDescription
idRequiredstringSpecifies the unique identifier for the promotion.
code-nameRequiredstringSpecifies the name of the code. For example, 10OFF.

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 attribute is used_on. 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, -used_on. The default sort order is used_on in ascending order. See Sorting.

Filtering

AttributeTypeOperatorsExample
codestringeqeq(code,cart1off)
idstringeq
used_onstringgt,ge,le and ltgt(used_on,2023-07-11)

Request Example

curl https://useast.api.elasticpath.com/v2/promotions/:id/codes/:code-name/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
}
]
}