POST /v2/loyalty/accounts/search

Searches for loyalty accounts in a loyalty program.

You can search for a loyalty account using the phone number or customer ID associated with the account. To return all loyalty accounts, specify an empty query object or omit it entirely.

Search results are sorted by created_at in ascending order.

Servers

Request headers

Name Type Required Description
Content-Type String Yes The media type of the request body.

Default value: "application/json"

Request body fields

Name Type Required Description
query Object No

The search criteria for the loyalty accounts.

query.customer_ids[] Array No

The set of customer IDs to use in the loyalty account search.

This cannot be combined with mappings.

Max: 30 customer IDs

query.mappings[] Array No

The set of mappings to use in the loyalty account search.

This cannot be combined with customer_ids.

Max: 30 mappings

query.mappings[].id String No

The Square-assigned ID of the mapping.

query.mappings[].created_at String No

The timestamp when the mapping was created, in RFC 3339 format.

query.mappings[].phone_number String No

The phone number of the buyer, in E.164 format. For example, "+14155551111".

limit Integer No

The maximum number of results to include in the response.

cursor String No

A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query.

For more information, see Pagination.

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.