Get Rule Promotion Code Usages
GEThttps://useast.api.elasticpath.com/v2/rule-promotions/:promotionID/codes/:code/usages
Retrieves a list of usage records for a specific Rule Promotion code.
- Provides insights into how many times a specific code was used.
- Can be filtered and paginated to refine results.
- Useful for tracking the performance of individual promotion codes.
Request
Path Parameters
promotionID stringrequired
The unique identifier of the rule promotion.
code stringrequired
The specific promotion code for which to retrieve usage records.
Query Parameters
id
: Filter by usage ID.used_on
: Filter by date with operatorsgt
,ge
,le
,lt
.
filter string
Filter attributes to refine the results. Supported attributes:
Example: gt(used_on,2024-02-01T00:00:00Z)
page[limit] integer
The number of records per page.
Example: 10
page[offset] integer
The number of records to offset the results by.
Example: 0
Header Parameters
Authorization Bearerrequired
The Bearer token required to get access to the API.
Responses
- 200
- 401
- 404
Successful response
- application/json
- Schema
- Example (auto)
- Example
Schema
data object[]
meta object
{
"data": [
{
"id": "string",
"order_id": "string",
"code_id": "string",
"code": "string",
"times_used": 0,
"used_on": "2024-07-29T15:51:28.071Z",
"customer_id": "string",
"customer_email": "string",
"meta": {
"timestamps": {
"updated_at": "2024-07-29T15:51:28.071Z"
}
},
"updated_by": "string",
"anonymized": true
}
],
"meta": {
"pagination": {
"total": 0,
"limit": 0,
"offset": 0,
"current": 0
}
}
}
{
"data": [
{
"id": "c2f45a8d-6ebf-4b6a-8b1c-d2e7c9e0f45f",
"order_id": "1a3b5c7d-9e2f-4a5b-8c1d-6e3f9b0d4c5f",
"code_id": "5d7e9f2b-3c4a-6b8d-1e9f-0a2b3c4d5e6f",
"code": "holiday50",
"times_used": 2,
"used_on": "2024-02-18T10:30:00.000Z",
"customer_id": "7e6c5d4b-3a2f-1e9d-8b0c-9f4e7d6c3b5a",
"customer_email": "vipuser@example.com",
"meta": {
"timestamps": {
"updated_at": "2024-02-18T10:35:00.000Z"
},
"updated_by": "Admin-User-456"
}
}
],
"meta": {
"pagination": {
"total": 20,
"limit": 10,
"offset": 0,
"current": 1
}
}
}
Unauthorized
- application/json
- Schema
- Example (auto)
- Example
Schema
errors object[]
{
"errors": [
{
"status": 0,
"title": "string",
"detail": "string"
}
]
}
{
"errors": [
{
"status": 401,
"title": "Unauthorized",
"detail": "Authentication is required to access this resource."
}
]
}
Not Found
- application/json
- Schema
- Example (auto)
- Example
Schema
errors object[]
{
"errors": [
{
"status": 0,
"title": "string",
"detail": "string"
}
]
}
{
"errors": [
{
"status": 404,
"title": "Promotion Code Not Found",
"detail": "No usages found for the specified promotion code."
}
]
}
Authorization: http
name: BearerAuthtype: httpscheme: bearer
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://useast.api.elasticpath.com/v2/rule-promotions/:promotionID/codes/:code/usages");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
ResponseClear