Skip to content

Square: Search Loyalty Events

Square loyalty.searchLoyaltyEvents: arguments, response, policy and SDK examples.

← Loyalty operations · Get started

Operation square.searchloyaltyevents

Provider route: POST /v2/loyalty/events/search. 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"]["searchLoyaltyEvents"]>[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.searchLoyaltyEvents(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.search_loyalty_events(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
bodyModelRequired within parentExpand Search Loyalty Events — request body — body

Referenced models: Search Loyalty Events — 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 Search Loyalty Events — response body

Referenced models: Search Loyalty Events — response body

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

Search Loyalty Events — response body
FieldTypePresenceDescription and constraints
$objectRootA response that contains loyalty events that satisfy the search
criteria, in order by the `created_at` date.
cursorstringOptionalThe pagination cursor to be used in a subsequent
request. If empty, this is the final response.
For more information,
see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
errorsarrayOptionalAny errors that occurred during the request.
errors[]ModelEach itemExpand Get Shift — response body — errors item
eventsarrayOptionalThe loyalty events that satisfy the search criteria.
events[]ModelEach itemExpand Adjust Loyalty Points — response body — event

Referenced models: Get Shift — response body — errors item, Adjust Loyalty Points — response body — event

Search Loyalty Events — request body — body
FieldTypePresenceDescription and constraints
$objectRootA request to search for loyalty events.
cursorstringOptionalA pagination cursor returned by a previous call to this endpoint.
Provide this to retrieve the next set of results for your original query.
For more information, see [Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).
limitintegerOptionalThe maximum number of results to include in the response.
The last page might contain fewer events.
The default is 30 events.
Maximum: 30
Minimum: 1
queryModelOptionalExpand Search Loyalty Events — request body — body query
A set of one or more predefined query filters to apply when
searching for loyalty events. The endpoint performs a logical AND to
evaluate multiple filters and performs a logical OR on arrays
that specifies multiple field values.

Referenced models: Search Loyalty Events — request body — body query

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

Search Loyalty Events — request body — body query
FieldTypePresenceDescription and constraints
$objectRootRepresents a query used to search for loyalty events.
filterJSONOptional
filter (anyOf 1)ModelAlternativeExpand Search Loyalty Events — request body — body query filter date time filter, location filter, loyalty account filter, order filter, type filter
The query filter criteria.
filter (anyOf 2)nullAlternative

Referenced models: Search Loyalty Events — request body — body query filter date time filter, location filter, loyalty account filter, order filter, type filter

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 adjust points
FieldTypePresenceDescription and constraints
$objectRootProvides metadata when the event `type` is `ADJUST_POINTS`.
loyalty_program_idstringOptionalThe Square-assigned ID of the [loyalty program](entity:LoyaltyProgram).
Maximum length: 36
Read only: true
pointsJSONRequired within parent
points (anyOf 1)integerAlternativeThe number of points added or removed.
points (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
reasonJSONOptional
reason (anyOf 1)stringAlternativeThe reason for the adjustment of points.
Maximum length: 3500
reason (anyOf 2)nullAlternative

SDK function policy ID: square.searchloyaltyevents. Catalog operation: SearchLoyaltyEvents. 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_READ"]

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.