Customers
Add or remove loyalty points
Adds points to a customer or removes them, with a reason that shows in their points history.
POST/stores/{storeId}/v1/customers/{id}/loyalty-adjustments
points is a non-zero integer up to 100,000 in either direction, and reason is 3 to 240 characters. The merchant's loyalty program must be on. A customer without a points account gets one, without welcome points. Spending points stays with the customer at checkout.
Path parameters
- idstringrequired
Headers
- Idempotency-Keystringrequired
Request body
- pointsintegerrequired
- Positive adds, negative removes, and it cannot be zero.
- reasonstringrequired
- It shows in the points history of the customer.
Response
- dataobjectrequired
- customer_idstring
- pointsinteger
- balanceinteger
- The balance after this movement.
- executionobject
- Who executed the request: the app, version, installation and store. Field names here are camelCase.
- appIdstring (uuid)
- versionIdstring (uuid)
- installationIdstring (uuid)
- storeIdstring (uuid)
- requestIdstring (uuid)
- generationinteger
- routeEpochinteger
- appAuthEpochinteger
- grantRevisioninteger
- metaobjectrequired
- request_idstring (uuid)
- The request ID; include it in any support request.
Errors
| HTTP | Code | Meaning |
|---|---|---|
| 400 | IDEMPOTENCY_KEY_REQUIRED | No Idempotency-Key header. |
| 404 | RESOURCE_NOT_FOUND | The ID does not exist in this store. |
| 409 | INSUFFICIENT_LOYALTY_POINTS | The customer does not have that many points. |
| 409 | LOYALTY_DISABLED | The loyalty program is off on this store, or its plan does not include it. |
| 409 | LOYALTY_EMAIL_INVALID | The customer has no usable email; points are held by email. |
| 422 | INVALID_POINTS | points is zero, not an integer, or too large. |
| 422 | INVALID_TEXT | reason is outside its limits. |
| 403 | SCOPE_REQUIRED | The token does not carry the required scope. |
| 503 | APPS_SCOPE_RUNTIME_NOT_READY | The resource is not enabled on this merchant's store yet. |
Shared codes are listed in Errors.