Loyalty
SearchLoyaltyAccounts
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.
post/v2/loyalty/accounts/search
Request body
Example request
{
"request_body": {
"limit": 10,
"query": {
"mappings": [
{
"phone_number": "+14155551234"
}
]
}
}
}Response
Success
Example response
{
"loyalty_accounts": [
{
"balance": 10,
"created_at": "2020-05-08T21:44:32Z",
"customer_id": "Q8002FAM9V1EZ0ADB2T5609X6NET1H0",
"id": "79b807d2-d786-46a9-933b-918028d7a8c5",
"lifetime_points": 20,
"mapping": {
"created_at": "2020-05-08T21:44:32Z",
"id": "66aaab3f-da99-49ed-8b19-b87f851c844f",
"phone_number": "+14155551234"
},
"program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd",
"updated_at": "2020-05-08T21:44:32Z"
}
]
}