Points and loyalty
Create loyalty ranks, define reward thresholds and assign a rank to a customer through the iStores API.
Authentication and endpoints
Use your API bearer token and send Content-Type: application/json for writes. The Points app must be active for your store.
| Operation | Endpoint | Permission |
|---|---|---|
| List ranks | GET /points | points |
| Read a rank | GET /points/{point_rank_id} | points |
| Create a rank | POST /points | points |
| Edit a rank | PUT /points/{point_rank_id} | points |
| Delete a rank | DELETE /points/{point_rank_id} | points |
| Set a customer's rank | PUT /customer/{customer_id}/point_rank | customersEdit |
List and read ranks
The list returns up to 100 ranks on the first page. These routes do not expose page or limit query parameters. The response includes success, response, results, pages, page, per_page, and request_id. Each list item contains id, name, and points.
Response fields
A single-rank response includes id, name, points, status, image, settings, and a descriptions array under response. Descriptions include their numeric language_id. For a write, convert that array into an object keyed by language ID.
Create and edit ranks
POST and PUT require the same complete payload. PUT replaces the settings object, so read the rank first and preserve any existing settings you want to retain.
Fields and example payload
| Field | Required | Meaning |
|---|---|---|
| descriptions | Yes | Object keyed by accepted numeric language IDs |
| descriptions.*.name | Yes | Rank name |
| descriptions.*.description | No | Description string or null |
| status | Yes | 0 or 1 |
| points | Yes | Numeric reward threshold, 0 or greater |
| image | Yes | Image URL matching the configured CDN pattern |
| settings | Yes | Complete settings object |
| settings.min_usage | No | Minimum spendable points balance, 0 or greater; defaults to 0 |
| settings.reward_rates | No | Reward percentages keyed by numeric customer-group IDs |
| settings.replace_logo | No | Email logo replacement preference, 0 or 1; defaults to 0 |
Example payload:
Code(json)
Language ID, customer-group ID, and image URL are illustrative. Use accepted IDs and an image from the store's configured CDN. The existing default rank remains at a zero threshold and cannot be deleted.
Create, edit, and delete return HTTP 200 with { "success": true, "response": { "id": 123 }, "request_id": "..." }.
Set a customer's rank
Enable the points system in your store settings before assigning customer ranks. Pass an enabled rank belonging to the same store:
Example request and reward behavior
Code(json)
The current rank is the highest enabled rank whose points threshold is no greater than the customer's non-expired reward total. A total of 0 is valid. Selection does not depend on reward rates or customer groups.
Changing the rank adds a reward adjustment equal to the selected threshold minus the current reward total. The customer's spendable points balance stays unchanged. Saving the currently matching rank adds no reward adjustment.
A successful change returns HTTP 200 with a message under response:
Code(json)
Errors
An inactive points app blocks every route with HTTP 404. Missing API permissions return 403. Invalid write payloads, a customer or enabled rank outside the authenticated store, deletion of the default rank, and customer rank changes while the points system is disabled return 422.
Status codes and next steps
An empty rank list and a missing rank on a read return 404. Updating or deleting a missing rank returns 422. Existing authentication and rate limits apply.