Get Rule Promotions
GEThttps://useast.api.elasticpath.com/v2/rule-promotions
Retrieves a list of rule-based promotions, including information such as discount type, eligibility criteria, and configuration details. This endpoint supports filtering to refine results based on specific promotion attributes.
Use query parameters to filter promotions by:
- Code – Retrieve a specific promotion by its code.
- Promotion name – Search for promotions by name.
- Activation status – Filter by whether a promotion is active or not.
- Stackability – Identify promotions that can or cannot be combined with others.
- Start and end dates – Retrieve promotions based on their validity periods.
Request
Query Parameters
filter string
This parameter accepts a filtering expression that uses specific operators and attributes.
The following operators and attributes are available when filtering on this endpoint. See Supported Filtering Characters.
Attribute | Type | Operator | Example |
---|---|---|---|
code | string , number | eq | eq(code,summer2024) |
name | string | like ,ilike | ilike(name, 'Summer *') |
enabled | boolean | eq | eq(enabled, true) |
stackable | boolean | eq | eq(stackable, true) |
override_stacking | boolean | eq | eq(override_stacking, true) |
start | date | lt , le , eq , gt , ge | gt(start, 2025-01-01T00:00:00.000Z) |
end | date | lt , le , eq , gt , ge | lt(end, 2025-01-01T00:00:00.000Z) |
Please note: promotion codes are case-insensitive. You can search for codes using only numbers
or codes containing both string
and numbers
.
Header Parameters
Authorization Bearerrequired
The Bearer token required to get access to the API.
Responses
- 200
OK
- application/json
- Schema
- Example (auto)
Schema
- Array [
- ]
data object
[
{
"data": {
"type": "rule_promotion",
"id": "string",
"store_id": "string",
"name": "string",
"description": "string",
"priority": 0,
"enabled": true,
"automatic": true,
"stackable": true,
"override_stacking": true,
"rule_set": {
"catalog_ids": [
"string"
],
"currencies": [
"string"
],
"rules": {
"strategy": "string",
"operator": "string",
"args": [
"string"
],
"children": [
{
"strategy": "string",
"operator": "string",
"args": [
"string"
]
}
]
},
"actions": [
{
"strategy": "string",
"args": [
"string"
],
"condition": {
"strategy": "string",
"children": [
{
"strategy": "string",
"operator": "string",
"args": [
"string"
]
}
]
},
"limitations": {
"max_discount": 0,
"max_quantity": 0,
"items": {
"max_items": 0,
"price_strategy": "cheapest"
}
}
}
]
},
"start": "2024-07-29T15:51:28.071Z",
"end": "2024-07-29T15:51:28.071Z",
"meta": {
"timestamps": {
"created_at": "2024-07-29T15:51:28.071Z",
"updated_at": "2024-07-29T15:51:28.071Z"
}
}
}
}
]
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");
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