Download OpenAPI specification:Download
Read and change the loyalty data of the customer who is logged in to the shop.
Use it to build your own loyalty UI instead of the ready-made theme blocks the app ships with. Those blocks call these same endpoints, so you lose nothing by replacing them.
The loyalty data that the app syncs into Shopify (customer metafields, shop metaobjects) is an internal detail of those blocks and may change without notice — build against this API instead.
Loyalty endpoints a storefront may call on behalf of the logged-in customer.
Two supported ways to reach them:
/apps/loyalty-proxy/... on the shop domain. Shopify signs the request and appends logged_in_customer_id; no credentials of your own.X-Shopify-Session-Token header. The customer is taken from the token, never from the query string.Every endpoint except GET /config acts on the logged-in customer and answers 401 without one.
Points earned, points spent and rewards redeemed, newest first.
| logged_in_customer_id | string Appended by the Shopify App Proxy. Ignored when a session token is used. |
[- {
- "activityId": "a2c8f1de-0b44-4c9e-9d21-77f0b3ac1e58",
- "activityType": "POINTS_EARNED",
- "description": "You earned 42 Sparks for order #1042",
- "metadata": "{\"pointsChange\":42,\"orderNumber\":\"#1042\"}",
- "timestamp": "2022-03-10T12:15:50"
}
]Month and day only, as --MM-DD. It can be set once; afterwards the stored date is returned with 409.
| logged_in_customer_id | string Appended by the Shopify App Proxy. Ignored when a session token is used. |
| birthdate required | string^--\d{2}-\d{2}$ Day and month of birth as an ISO-8601 MonthDay, |
{- "birthdate": "--08-24"
}{- "success": true,
- "birthdate": "--08-24"
}Branding, earning rules and the reward options a member can redeem. Shop-scoped: this is the one endpoint that needs no logged-in customer.
| logged_in_customer_id | string Appended by the Shopify App Proxy. Ignored when a session token is used. |
{- "branding": {
- "rewardCurrencyName": "Sparks",
- "rewardSymbol": "✦",
- "programWelcomeMessage": "Join and start collecting Sparks on every order."
}, - "earning": {
- "pointsPerCurrencyEnabled": true,
- "pointsPerCurrencyAmountCents": 100,
- "pointsPerCurrencyPoints": 1,
- "pointsPerCurrencyDescription": "Earn 1 Spark per €1 spent",
- "pointsPerCurrencyMinOrderValueCents": 0,
- "pointsForPurchaseEnabled": false,
- "pointsForPurchase": 10,
- "pointsForPurchaseDescription": "10 Sparks on every order",
- "pointsForPurchaseMinOrderValueCents": 5000,
- "pointsForRegistrationEnabled": true,
- "pointsForRegistration": 100,
- "pointsForRegistrationDescription": "100 Sparks just for joining",
- "pointsForBirthdayEnabled": true,
- "pointsForBirthday": 50,
- "pointsForBirthdayDescription": "50 Sparks on your birthday",
- "pointsExpirationMonths": 12
}, - "rewardOptions": [
- {
- "optionId": "6b1f0f4c-2f3a-4a1e-9a7c-0d2f8e5b1c33",
- "name": "€5 off your order",
- "description": "Applies to any order over €20.",
- "discountType": "PERCENTAGE",
- "discountValue": 5,
- "pointsCost": 500
}
]
}Ends the membership. Points and coupons are no longer usable.
| logged_in_customer_id | string Appended by the Shopify App Proxy. Ignored when a session token is used. |
{- "success": true,
- "message": "You have successfully left the loyalty program."
}Points balance, pending points and the coupons the customer currently holds.
| logged_in_customer_id | string Appended by the Shopify App Proxy. Ignored when a session token is used. |
{- "memberId": "3f1a7c02-95d1-4a2e-8f0b-1c6de2a9b410",
- "email": "ada@example.com",
- "firstName": "Ada",
- "lastName": "Lovelace",
- "birthdate": "--08-24",
- "activePoints": 420,
- "pendingPoints": 50,
- "totalPoints": 470,
- "coupons": [
- {
- "couponId": "c81d4e2f-6a90-4b13-9f77-2b0c5e6a8d41",
- "memberId": "3f1a7c02-95d1-4a2e-8f0b-1c6de2a9b410",
- "code": "LOYALTY-5EUR-A7K2",
- "title": "€5 off your order",
- "description": "Applies to any order over €20.",
- "discountType": "PERCENTAGE",
- "discountValue": 5,
- "minOrderValue": 20,
- "status": "AVAILABLE",
- "validFrom": "2022-03-10T12:15:50",
- "validUntil": "2022-03-10T12:15:50",
- "redeemedAt": "2022-03-10T12:15:50",
- "pointsCost": 500,
- "isValid": true
}
]
}Exchanges the member's points for the reward option and returns the coupon to show the customer. Option ids come from GET /config.
| logged_in_customer_id | string Appended by the Shopify App Proxy. Ignored when a session token is used. |
| optionId required | string
|
{- "optionId": "6b1f0f4c-2f3a-4a1e-9a7c-0d2f8e5b1c33"
}{- "couponId": "c81d4e2f-6a90-4b13-9f77-2b0c5e6a8d41",
- "memberId": "3f1a7c02-95d1-4a2e-8f0b-1c6de2a9b410",
- "code": "LOYALTY-5EUR-A7K2",
- "title": "€5 off your order",
- "description": "Applies to any order over €20.",
- "discountType": "PERCENTAGE",
- "discountValue": 5,
- "minOrderValue": 20,
- "status": "AVAILABLE",
- "validFrom": "2022-03-10T12:15:50",
- "validUntil": "2022-03-10T12:15:50",
- "redeemedAt": "2022-03-10T12:15:50",
- "pointsCost": 500,
- "isValid": true
}Creates a membership for the logged-in customer. Calling it again for a customer who is already a member returns that membership instead of failing.
| logged_in_customer_id | string Appended by the Shopify App Proxy. Ignored when a session token is used. |
| registrationSource | string Where the customer joined from, stored for reporting. Defaults to |
| consentGiven required | boolean Whether the customer agreed to the loyalty terms. Must be |
{- "registrationSource": "STOREFRONT",
- "consentGiven": true
}{- "success": true,
- "memberId": "3f1a7c02-95d1-4a2e-8f0b-1c6de2a9b410",
- "email": "ada@example.com",
- "firstName": "Ada",
- "lastName": "Lovelace",
- "activePoints": 100,
- "pendingPoints": 0,
- "totalRewardPoints": 100
}