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

You are viewing an old version of the API
Create loyalty reward

POST /v2/loyalty/rewards

Creates a loyalty reward.

In the process, the endpoint does following:

  • Uses the reward_tier_id in the request to determine the number of points to lock for this reward.
  • If the request includes order_id, it adds the reward and related discount to the order.

After a reward is created, the points are locked and not available for the buyer to redeem another reward.


Permissions
LOYALTY_WRITE
Guide
Loyalty rewards
Try in API Explorer
Name Description
reward
LoyaltyReward

Required

The reward to create.

idempotency_key
string

Required

A unique string that identifies this CreateLoyaltyReward request. Keys can be any valid string, but must be unique for every request.

Min Length 1 Max Length 128

Response Fields

Name Description
errors
Error [ ]

Any errors that occurred during the request.

reward
LoyaltyReward

The loyalty reward created.

Examples

You are viewing an old version of the API
POST /v2/loyalty/rewards
cURL
  • cURL
  • Ruby
  • Python
  • C#
  • Java
  • PHP
  • Node.js
curl https://connect.squareup.com/v2/loyalty/rewards \
  -X POST \
  -H 'Square-Version: 2021-05-13' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "reward": {
      "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd",
      "reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f",
      "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY"
    },
    "idempotency_key": "18c2e5ea-a620-4b1f-ad60-7b167285e451"
  }'
Response JSON
{
  "reward": {
    "id": "a8f43ebe-2ad6-3001-bdd5-7d7c2da08943",
    "status": "ISSUED",
    "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd",
    "reward_tier_id": "e1b39225-9da5-43d1-a5db-782cdd8ad94f",
    "points": 10,
    "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY",
    "created_at": "2020-05-01T21:49:54Z",
    "updated_at": "2020-05-01T21:49:54Z"
  }
}

Share Feedback

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