limit
and created_at
.
Parameter name | Description |
---|---|
limit | A limit on the number of objects to be returned; between 1 and 100. |
created_at | A filter on the list based on the object created_at field. The value is a dictionary with the following options: before , after . A date value must be presented in ISO 8601 format (2016-11-16T14:14:31Z or 2016-11-16 ). Examples: - [created_at][before]=2017-09-08T13:52:18.227Z - [created_at][after]=2017-09-08 |
Paging the results
Some of the list API methods use thepage
query parameter to display another page of results.
However, the following list API methods use the starting_after_id
query parameter:
- List customer activity
- List member activity
- List member activity (with campaign ID)
- List campaign transactions
- List voucher transactions
- List loyalty campaign transactions
- List loyalty card transactions
- List loyalty card transactions (with campaign ID)
- List customer redeemables
- List referral code holders
- List referral code holders (with campaign ID)
- List bin entries
- List campaign templates
- Management – List campaign templates
more_starting_after
key that takes a string value with an ID. Use this ID with the starting_after_id
query parameter to display another page of results.
Response format
The listing method returns a dictionary with a data property that contains an array of resources. The maximum number of resources returned is determined by thelimit
query parameter. If no more resources are available, the resulting array on a given page will be empty. The result can be narrowed down according to the specified (or default) filters.
Property name | Description |
---|---|
object | A string describing the object type returned. |
data_ref | The value for this property indicates the property name containing the results array. |
data | An array that contains objects for a given list endpoint. In older methods, this is replaced by the name of the respective resource, e.g. publications . |
total | Total number of records for given filtering query. In some methods, this field is absent. |
has_more | It indicates that there are more results to be returned for given filter parameters. |
more_starting_after | Present in some of the newer endpoints; it provides an ID that can be used with a starting_after_id query parameter to return another page of results. |
Shortcuts
List API methods offer a list of query parameters. These parameters allow you to filter the results. Each API resource enables a specific set of options which can be used for simplifying a query. If you need advanced options, read the next section.Resource | Shortcuts | Example |
---|---|---|
Vouchers | customer``campaign``category | {api-url}/vouchers?customer=source_id |
Redemptions | campaign_name``customer``voucher_code``related_object_id``related_object_parent_id | {api-url}/redemptions?customer=customer_id {api-url}/redemptions?customer=source_id |
Customers | email``name | {api-url}/[email protected] |
Publications | campaign_name``customer_id``voucher_code``result``voucher_type``is_referral_code``parent_object_id``related_object_id | {api-url}/publications?campaign_name=TEST |
Validation Rule Assignments | related_object_id``rule | {api-url}/validation-rules-assignments?related_object_id=promo_id |
Advanced filters for fetching resources
Moreover, API methods for fetching resources offer extended capabilities for filtering data. A user can build advanced queries by passing parameters that define search criteria.Resource | Examples |
---|---|
Vouchers | [filters][active][conditions][$active]=true``[filters][active][conditions][$expired]=true``[filters][active][conditions][$enabled]=true``[filters][active][conditions][$disabled]=true``[filters][redemption.redeemed_quantity][conditions][$is]=0``[filters][is_referral_code][conditions][$is]=true``[filters][expiration_date][conditions][$before]=2024-04-29T00:00:00.000Z [filters][metadata.seq_number][conditions][$is]=1 |
Campaigns | [filters][metadata.seq_number][conditions][$is]=1``[filters][metadata.test][conditions][$is]=true |
Products and Skus | [filters][updated_at][conditions][$after][0]=2020-08-20T14:17:09Z``[filters][updated_at][conditions][$before][0]=2020-08-20T14:17:09Z``[filters][created_at][conditions][$after][0]=2020-08-20T14:17:09Z``[filters][created_at][conditions][$before][0]=2020-08-20T14:17:09Z |
List all promotion stacks | [created_at][before]=2021-12-30T13:52:18.227Z``[created_at][after]=2021-12-30T13:52:18.227Z``[filters][created_at][conditions][$before][0]=2021-12-30T13:52:18.227Z``[filters][created_at][conditions][$after][0]=2021-12-30T13:52:18.227Z``[updated_at][before]=2021-12-30T13:52:18.227Z``[updated_at][after]=2021-12-30T13:52:18.227Z``[filters][updated_at][conditions][$before][0]=2021-12-30T13:52:18.227Z``[filters][updated_at][conditions][$after][0]=2021-12-30T13:52:18.227Z |