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

You are viewing an old version of the API
Accumulate loyalty points BETA

Adds points to a loyalty account.

  • If you are using the Orders API to manage orders, you only provide the order_id. The endpoint reads the order to compute points to add to the buyer's account.
  • If you are not using the Orders API to manage orders, you first perform a client-side computation to compute the points.
    For spend-based and visit-based programs, you can call CalculateLoyaltyPoints to compute the points. For more information, see Loyalty Program Overview. You then provide the points in a request to this endpoint.

For more information, see Accumulate points.

Required permissions: LOYALTY_WRITE

Path Parameters

Name Description
account_id
string

Required

The loyalty account ID to which to add the points.

Request Body

Name Description
accumulate_points
LoyaltyEventAccumulatePoints

Required

The points to add to the account. If you are using the Orders API to manage orders, you
specify the order ID. Otherwise, specify the points to add.

idempotency_key
string

Required

A unique string that identifies the AccumulateLoyaltyPoints request. Keys can be any valid string but must be unique for every request.

Max Length 128 Min Length 1
location_id
string

Required

The location where the purchase was made.

Response Fields

Name Description
errors
Error [ ]

Any errors that occurred during the request.

event
LoyaltyEvent

The resulting loyalty event.

Examples

You are viewing an old version of the API
POST /v2/loyalty/accounts/{account_id}/accumulate
cURL
  • cURL
  • Ruby
  • Python
  • C#
  • Java
  • PHP
curl https://connect.squareup.com/v2/loyalty/accounts/5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd/accumulate \
  -X POST \
  -H 'Square-Version: 2020-06-25' \
  -H 'Authorization: Bearer ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "accumulate_points": {
      "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY"
    },
    "location_id": "P034NEENMD09F",
    "idempotency_key": "58b90739-c3e8-4b11-85f7-e636d48d72cb"
  }'
Response JSON
{
  "event": {
    "id": "ee46aafd-1af6-3695-a385-276e2ef0be26",
    "type": "ACCUMULATE_POINTS",
    "created_at": "2020-05-08T21:41:12Z",
    "accumulate_points": {
      "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd",
      "points": 6,
      "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY"
    },
    "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd",
    "location_id": "P034NEENMD09F",
    "source": "LOYALTY_API"
  }
}

Share Feedback

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