Storefront and loyalty

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.

OperationEndpointPermission
List ranksGET /pointspoints
Read a rankGET /points/{point_rank_id}points
Create a rankPOST /pointspoints
Edit a rankPUT /points/{point_rank_id}points
Delete a rankDELETE /points/{point_rank_id}points
Set a customer's rankPUT /customer/{customer_id}/point_rankcustomersEdit

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
FieldRequiredMeaning
descriptionsYesObject keyed by accepted numeric language IDs
descriptions.*.nameYesRank name
descriptions.*.descriptionNoDescription string or null
statusYes0 or 1
pointsYesNumeric reward threshold, 0 or greater
imageYesImage URL matching the configured CDN pattern
settingsYesComplete settings object
settings.min_usageNoMinimum spendable points balance, 0 or greater; defaults to 0
settings.reward_ratesNoReward percentages keyed by numeric customer-group IDs
settings.replace_logoNoEmail logo replacement preference, 0 or 1; defaults to 0

Example payload:

Code(json)
{ "descriptions": { "1": { "name": "Gold", "description": "" } }, "status": 1, "points": 1000, "image": "https://res.cloudinary.com/YOUR_CLOUD/image/upload/YOUR_IMAGE.png", "settings": { "min_usage": 0, "reward_rates": { "1": 5 }, "replace_logo": 0 } }

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)
{ "point_rank_id": 123 }

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)
{ "success": true, "response": { "message": "Customer 42 point rank updated successfully" }, "request_id": "..." }

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.