• Example searches: “transaction”, “CreateOrder”, “/v2/locations”, “inventory”, “delete customer”

You are viewing an old version of the API
Search loyalty rewards

POST /v2/loyalty/rewards/search

Searches for loyalty rewards in a loyalty account.

In the current implementation, the endpoint supports search by the reward status.

If you know a reward ID, use the RetrieveLoyaltyReward endpoint.

Search results are sorted by updated_at in descending order.


Permissions
LOYALTY_READ
Guide
Loyalty rewards
Try in API Explorer
Name Description
query
SearchLoyaltyRewardsRequestLoyaltyRewardQuery

The search criteria for the request. If empty, the endpoint retrieves all loyalty rewards in the loyalty program.

limit
integer (32-bit)

The maximum number of results to return in the response.

Min 1 Max 30
cursor
string

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
Error [ ]

Any errors that occurred during the request.

rewards
LoyaltyReward [ ]

The loyalty rewards that satisfy the search criteria. These are returned in descending order by updated_at.

cursor
string

The pagination cursor to be used in a subsequent request. If empty, this is the final response.

Examples

You are viewing an old version of the API
POST /v2/loyalty/rewards/search
cURL
  • cURL
  • Ruby
  • Python
  • C#
  • Java
  • PHP
  • Node.js
curl https://connect.squareup.com/v2/loyalty/rewards/search \
  -X POST \
  -H 'Square-Version: 2021-05-13' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "query": {
      "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd"
    },
    "limit": 10
  }'
Response JSON
{
  "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"
    }
  ]
}

Share Feedback

Thanks for visiting the Square API documentation. What's on your mind?