Search loyalty rewards
Searches for loyalty rewards.
This endpoint accepts a request with no query filters and returns results for all loyalty accounts.
If you include a query
object, loyalty_account_id
is required and status
is optional.
If you know a reward ID, use the RetrieveLoyaltyReward endpoint.
Search results are sorted by updated_at
in descending order.
Name | Description |
---|---|
query
|
The search criteria for the request. If empty, the endpoint retrieves all loyalty rewards in the loyalty program. |
limit
|
The maximum number of results to return in the response. The default value is 30. |
cursor
|
A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. For more information, see Pagination. |
Response Fields
Name | Description |
---|---|
errors
|
Any errors that occurred during the request. |
rewards
|
The loyalty rewards that satisfy the search criteria.
These are returned in descending order by |
cursor
|
The pagination cursor to be used in a subsequent request. If empty, this is the final response. |
Examples
- cURL
- Ruby
- Python
- C#
- Java
- PHP
- Node.js
curl https://connect.squareup.com/v2/loyalty/rewards/search \
-X POST \
-H 'Square-Version: 2023-01-19' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"query": {
"loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd"
},
"limit": 10
}'
{
"rewards": [
{
"id": "d03f79f4-815f-3500-b851-cc1e68a457f9",
"status": "REDEEMED",
"loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd",
"reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f",
"points": 10,
"order_id": "PyATxhYLfsMqpVkcKJITPydgEYfZY",
"created_at": "2020-05-08T22:00:44Z",
"updated_at": "2020-05-08T22:01:17Z",
"redeemed_at": "2020-05-08T22:01:17Z"
},
{
"id": "9f18ac21-233a-31c3-be77-b45840f5a810",
"status": "REDEEMED",
"loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd",
"reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f",
"points": 10,
"created_at": "2020-05-08T21:55:42Z",
"updated_at": "2020-05-08T21:56:00Z",
"redeemed_at": "2020-05-08T21:56:00Z"
},
{
"id": "a8f43ebe-2ad6-3001-bdd5-7d7c2da08943",
"status": "DELETED",
"loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd",
"reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f",
"points": 10,
"order_id": "5NB69ZNh3FbsOs1ox43bh1xrli6YY",
"created_at": "2020-05-01T21:49:54Z",
"updated_at": "2020-05-08T21:55:10Z"
},
{
"id": "a051254c-f840-3b45-8cf1-50bcd38ff92a",
"status": "ISSUED",
"loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd",
"reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f",
"points": 10,
"order_id": "LQQ16znvi2VIUKPVhUfJefzr1eEZY",
"created_at": "2020-05-01T20:20:37Z",
"updated_at": "2020-05-01T20:20:40Z"
}
]
}