Skip to content

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.

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 os
from alter_sdk import App
from 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()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathobjectRequired within parentAdditional keys: not allowed
path.account_idstringRequired within parent
bodyModelRequired within parentExpand Accumulate Loyalty Points — request body — body

Referenced models: Accumulate Loyalty Points — request body — body

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Accumulate Loyalty Points — response body

Referenced models: Accumulate Loyalty Points — response body

7 more schemas are linked from the tables above, on the schema pages.

Accumulate Loyalty Points — request body — body
FieldTypePresenceDescription and constraints
$objectRootRepresents an [AccumulateLoyaltyPoints](api-endpoint:Loyalty-AccumulateLoyaltyPoints) request.
accumulate_pointsModelRequired within parentExpand 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_keystringRequired within parentA 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_idstringRequired within parentThe [location](entity:Location) where the purchase was made.

Referenced models: Accumulate Loyalty Points — request body — body accumulate points

Accumulate Loyalty Points — response body
FieldTypePresenceDescription and constraints
$objectRootRepresents an [AccumulateLoyaltyPoints](api-endpoint:Loyalty-AccumulateLoyaltyPoints) response.
errorsarrayOptionalAny errors that occurred during the request.
errors[]ModelEach itemExpand Get Shift — response body — errors item
eventModelOptionalExpand Adjust Loyalty Points — response body — event
The resulting loyalty event. Starting in Square version 2022-08-17, this field is no longer returned.
eventsarrayOptionalThe 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[]ModelEach itemExpand 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
FieldTypePresenceDescription and constraints
$objectRootProvides metadata when the event `type` is `ACCUMULATE_POINTS`.
loyalty_program_idstringOptionalThe ID of the [loyalty program](entity:LoyaltyProgram).
Maximum length: 36
Read only: true
order_idJSONOptional
order_id (anyOf 1)stringAlternativeThe 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)nullAlternative
pointsJSONOptional
points (anyOf 1)integerAlternativeThe number of points accumulated by the event.
Minimum: 1
points (anyOf 2)nullAlternative
Get Shift — response body — errors item
FieldTypePresenceDescription and constraints
$objectRootRepresents 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.
categorystringRequired within parentIndicates 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
codeModelRequired within parentExpand Get Shift — response body — errors item code
The specific code of the error.
See [ErrorCode](#type-errorcode) for possible values
detailstringOptionalA human-readable description of the error for debugging purposes.
fieldstringOptionalThe 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
FieldTypePresenceDescription and constraints
$objectRootProvides 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_pointsModelOptionalExpand Adjust Loyalty Points — response body — event accumulate points
Provides metadata when the event `type` is `ACCUMULATE_POINTS`.
Read only: true
accumulate_promotion_pointsModelOptionalExpand Adjust Loyalty Points — response body — event accumulate promotion points
Provides metadata when the event `type` is `ACCUMULATE_PROMOTION_POINTS`.
Read only: true
adjust_pointsModelOptionalExpand Adjust Loyalty Points — response body — event adjust points
Provides metadata when the event `type` is `ADJUST_POINTS`.
Read only: true
create_rewardModelOptionalExpand Adjust Loyalty Points — response body — event create reward
Provides metadata when the event `type` is `CREATE_REWARD`.
Read only: true
created_atstringRequired within parentThe timestamp when the event was created, in RFC 3339 format.
Minimum length: 1
Read only: true
delete_rewardModelOptionalExpand Adjust Loyalty Points — response body — event delete reward
Provides metadata when the event `type` is `DELETE_REWARD`.
Read only: true
expire_pointsModelOptionalExpand Adjust Loyalty Points — response body — event expire points
Provides metadata when the event `type` is `EXPIRE_POINTS`.
Read only: true
idstringRequired within parentThe Square-assigned ID of the loyalty event.
Minimum length: 1
Read only: true
location_idstringOptionalThe ID of the [location](entity:Location) where the event occurred.
Read only: true
loyalty_account_idstringRequired within parentThe ID of the [loyalty account](entity:LoyaltyAccount) associated with the event.
Maximum length: 36
Minimum length: 1
Read only: true
other_eventModelOptionalExpand Adjust Loyalty Points — response body — event other event
Provides metadata when the event `type` is `OTHER`.
Read only: true
redeem_rewardModelOptionalExpand Adjust Loyalty Points — response body — event redeem reward
Provides metadata when the event `type` is `REDEEM_REWARD`.
Read only: true
sourcestringRequired within parentDefines 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
typestringRequired within parentThe 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
FieldTypePresenceDescription and constraints
$objectRootProvides metadata when the event `type` is `REDEEM_REWARD`.
loyalty_program_idstringRequired within parentThe ID of the [loyalty program](entity:LoyaltyProgram).
Maximum length: 36
Minimum length: 1
Read only: true
order_idstringOptionalThe 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_idstringOptionalThe 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
FieldTypePresenceDescription and constraints
$objectRootProvides metadata when the event `type` is `EXPIRE_POINTS`.
loyalty_program_idstringRequired within parentThe Square-assigned ID of the [loyalty program](entity:LoyaltyProgram).
Maximum length: 36
Minimum length: 1
Read only: true
pointsJSONRequired within parent
points (anyOf 1)integerAlternativeThe number of points expired.
points (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$

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"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand how our website, product, and documentation are used.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

Advertising

Shares visits and sign-ups with Meta, Reddit, and X so we can measure which of our ads work.

You can change these choices at any time from Cookie settings.