v1

latestOpenAPI 3.0.0Apache 2.02026-07-142008071.1 MB
Loyalty

AccumulateLoyaltyPoints

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 first call CalculateLoyaltyPoints to compute the points
    that you provide to this endpoint.

Note: The country of the seller's Square account determines whether tax is included in the purchase amount when accruing points for spend-based and visit-based programs. For more information, see Availability of Square Loyalty.

post/v2/loyalty/accounts/{account_id}/accumulate

Path parameters

account_idstring required

The loyalty account ID to which to add the points.

Request body

idempotency_keystring required

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

location_idstring required

The location where the purchase was made.

Example request

{
  "request_body": {
    "accumulate_points": {
      "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY"
    },
    "idempotency_key": "58b90739-c3e8-4b11-85f7-e636d48d72cb",
    "location_id": "P034NEENMD09F"
  },
  "request_params": "?account_id=5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd"
}

Response

Success

Example response

{
  "event": {
    "accumulate_points": {
      "loyalty_program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd",
      "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY",
      "points": 6
    },
    "created_at": "2020-05-08T21:41:12Z",
    "id": "ee46aafd-1af6-3695-a385-276e2ef0be26",
    "location_id": "P034NEENMD09F",
    "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd",
    "source": "LOYALTY_API",
    "type": "ACCUMULATE_POINTS"
  }
}