Square: Accumulate Loyalty Points
Square loyalty.accumulateLoyaltyPoints: arguments, response, policy and SDK examples.
← Loyalty operations · Get started
Operation square.accumulateloyaltypoints
Provider route: POST /v2/loyalty/accounts/{account_id}/accumulate. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”Install @alter-ai/sdk @alter-ai/square with npm, or alter-sdk-square with pip. Supply your connected customer’s grant ID and the arguments described below.
import { App } from "@alter-ai/sdk";import { SquareIntegration } from "@alter-ai/square";
async function execute(input: Parameters<SquareIntegration["loyalty"]["accumulateLoyaltyPoints"]>[0]) { const app = new App({ apiKey: process.env.ALTER_API_KEY! }); try { const provider = new SquareIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! }); const call = await provider.loyalty.accumulateLoyaltyPoints(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom alter_sdk_square import SquareIntegration
async def execute(arguments): async with App(api_key=os.environ["ALTER_API_KEY"]) as app: provider = SquareIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]}) call = await provider.loyalty.accumulate_loyalty_points(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | object | Required within parent | Additional keys: not allowed |
path.account_id | string | Required within parent | |
body | Model | Required within parent | Expand Accumulate Loyalty Points — request body — body |
Referenced models: Accumulate Loyalty Points — request body — body
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Accumulate Loyalty Points — response body |
Referenced models: Accumulate Loyalty Points — response body
Schemas
Section titled “Schemas”7 more schemas are linked from the tables above, on the schema pages.
Accumulate Loyalty Points — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents an [AccumulateLoyaltyPoints](api-endpoint:Loyalty-AccumulateLoyaltyPoints) request. |
accumulate_points | Model | Required within parent | Expand Accumulate Loyalty Points — request body — body accumulate points The points to add to the account. If you are using the Orders API to manage orders, specify the order ID. Otherwise, specify the points to add. |
idempotency_key | string | Required within parent | A unique string that identifies the `AccumulateLoyaltyPoints` request. Keys can be any valid string but must be unique for every request. Maximum length: 128 Minimum length: 1 |
location_id | string | Required within parent | The [location](entity:Location) where the purchase was made. |
Referenced models: Accumulate Loyalty Points — request body — body accumulate points
Accumulate Loyalty Points — response body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents an [AccumulateLoyaltyPoints](api-endpoint:Loyalty-AccumulateLoyaltyPoints) response. |
errors | array | Optional | Any errors that occurred during the request. |
errors[] | Model | Each item | Expand Get Shift — response body — errors item |
event | Model | Optional | Expand Adjust Loyalty Points — response body — event The resulting loyalty event. Starting in Square version 2022-08-17, this field is no longer returned. |
events | array | Optional | The resulting loyalty events. If the purchase qualifies for points, the `ACCUMULATE_POINTS` event is always included. When using the Orders API, the `ACCUMULATE_PROMOTION_POINTS` event is included if the purchase also qualifies for a loyalty promotion. |
events[] | Model | Each item | Expand Adjust Loyalty Points — response body — event |
Referenced models: Get Shift — response body — errors item, Adjust Loyalty Points — response body — event
Accumulate Loyalty Points — request body — body accumulate points
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Provides metadata when the event `type` is `ACCUMULATE_POINTS`. |
loyalty_program_id | string | Optional | The ID of the [loyalty program](entity:LoyaltyProgram). Maximum length: 36 Read only: true |
order_id | JSON | Optional | |
order_id (anyOf 1) | string | Alternative | The ID of the [order](entity:Order) for which the buyer accumulated the points. This field is returned only if the Orders API is used to process orders. |
order_id (anyOf 2) | null | Alternative | |
points | JSON | Optional | |
points (anyOf 1) | integer | Alternative | The number of points accumulated by the event. Minimum: 1 |
points (anyOf 2) | null | Alternative |
Get Shift — response body — errors item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents an error encountered during a request to the Connect API. See [Handling errors](https://developer.squareup.com/docs/build-basics/handling-errors) for more information. |
category | string | Required within parent | Indicates which high-level category of error has occurred during a request to the Connect API. The high-level category for the error. See [ErrorCategory](#type-errorcategory) for possible values Known values: API_ERROR, AUTHENTICATION_ERROR, INVALID_REQUEST_ERROR, RATE_LIMIT_ERROR, PAYMENT_METHOD_ERROR, REFUND_ERROR, MERCHANT_SUBSCRIPTION_ERROR, EXTERNAL_VENDOR_ERROR |
code | Model | Required within parent | Expand Get Shift — response body — errors item code The specific code of the error. See [ErrorCode](#type-errorcode) for possible values |
detail | string | Optional | A human-readable description of the error for debugging purposes. |
field | string | Optional | The name of the field provided in the original request (if any) that the error pertains to. |
Referenced models: Get Shift — response body — errors item code
Adjust Loyalty Points — response body — event
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Provides information about a loyalty event. For more information, see [Search for Balance-Changing Loyalty Events](https://developer.squareup.com/docs/loyalty-api/loyalty-events). |
accumulate_points | Model | Optional | Expand Adjust Loyalty Points — response body — event accumulate points Provides metadata when the event `type` is `ACCUMULATE_POINTS`. Read only: true |
accumulate_promotion_points | Model | Optional | Expand Adjust Loyalty Points — response body — event accumulate promotion points Provides metadata when the event `type` is `ACCUMULATE_PROMOTION_POINTS`. Read only: true |
adjust_points | Model | Optional | Expand Adjust Loyalty Points — response body — event adjust points Provides metadata when the event `type` is `ADJUST_POINTS`. Read only: true |
create_reward | Model | Optional | Expand Adjust Loyalty Points — response body — event create reward Provides metadata when the event `type` is `CREATE_REWARD`. Read only: true |
created_at | string | Required within parent | The timestamp when the event was created, in RFC 3339 format. Minimum length: 1 Read only: true |
delete_reward | Model | Optional | Expand Adjust Loyalty Points — response body — event delete reward Provides metadata when the event `type` is `DELETE_REWARD`. Read only: true |
expire_points | Model | Optional | Expand Adjust Loyalty Points — response body — event expire points Provides metadata when the event `type` is `EXPIRE_POINTS`. Read only: true |
id | string | Required within parent | The Square-assigned ID of the loyalty event. Minimum length: 1 Read only: true |
location_id | string | Optional | The ID of the [location](entity:Location) where the event occurred. Read only: true |
loyalty_account_id | string | Required within parent | The ID of the [loyalty account](entity:LoyaltyAccount) associated with the event. Maximum length: 36 Minimum length: 1 Read only: true |
other_event | Model | Optional | Expand Adjust Loyalty Points — response body — event other event Provides metadata when the event `type` is `OTHER`. Read only: true |
redeem_reward | Model | Optional | Expand Adjust Loyalty Points — response body — event redeem reward Provides metadata when the event `type` is `REDEEM_REWARD`. Read only: true |
source | string | Required within parent | Defines whether the event was generated by the Square Point of Sale. Defines whether the event was generated by the Square Point of Sale. See [LoyaltyEventSource](#type-loyaltyeventsource) for possible values Known values: SQUARE, LOYALTY_API Read only: true |
type | string | Required within parent | The type of the loyalty event. The type of the loyalty event. See [LoyaltyEventType](#type-loyaltyeventtype) for possible values Known values: ACCUMULATE_POINTS, CREATE_REWARD, REDEEM_REWARD, DELETE_REWARD, ADJUST_POINTS, EXPIRE_POINTS, OTHER, ACCUMULATE_PROMOTION_POINTS Read only: true |
Referenced models: Adjust Loyalty Points — response body — event redeem reward, Adjust Loyalty Points — response body — event accumulate points, Adjust Loyalty Points — response body — event accumulate promotion points, Adjust Loyalty Points — response body — event adjust points, Adjust Loyalty Points — response body — event create reward, Adjust Loyalty Points — response body — event delete reward, Adjust Loyalty Points — response body — event expire points, Adjust Loyalty Points — response body — event other event
Adjust Loyalty Points — response body — event redeem reward
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Provides metadata when the event `type` is `REDEEM_REWARD`. |
loyalty_program_id | string | Required within parent | The ID of the [loyalty program](entity:LoyaltyProgram). Maximum length: 36 Minimum length: 1 Read only: true |
order_id | string | Optional | The ID of the [order](entity:Order) that redeemed the reward. This field is returned only if the Orders API is used to process orders. Read only: true |
reward_id | string | Optional | The ID of the redeemed [loyalty reward](entity:LoyaltyReward). This field is returned only if the event source is `LOYALTY_API`. Maximum length: 36 Read only: true |
Adjust Loyalty Points — response body — event expire points
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Provides metadata when the event `type` is `EXPIRE_POINTS`. |
loyalty_program_id | string | Required within parent | The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram). Maximum length: 36 Minimum length: 1 Read only: true |
points | JSON | Required within parent | |
points (anyOf 1) | integer | Alternative | The number of points expired. |
points (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: square.accumulateloyaltypoints. Catalog operation: AccumulateLoyaltyPoints. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.
Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.
Required provider scopes: ["LOYALTY_WRITE"]
Pinned headers: {"Square-Version": "2026-11-18"}