For the complete documentation index, see llms.txt. This page is also available as Markdown.

Bulk change redeemed rewards’ status

Management This method allows changing the status of multiple Reward redemptions in a single request. The body is a list of groups; each group applies its own status (and optional comment) to its own issued reward ids, so one request can set different statuses for different rewards.

Each issued reward id is processed independently and the response reports the outcome per item, so a 200 does not mean every item succeeded — the caller must read each row's ok field. A failure on one item never affects the others. This includes field-level problems that can be attributed to a single item: an unknown or missing status, a comment longer than 255 characters, and an id that is not a uuid are all reported as that item's failure, not as a rejection of the request. A 400 is reserved for a body that carries no item to report against — not valid JSON, not a list of groups, no groups at all, or a group with no issued reward ids — and for a total id count over the configured limit, which rejects the whole request and changes nothing.

post
Authorizations
AuthorizationstringRequired

Open Loyalty has the JWT authorization. To learn what a JSON Web Token is and how it works, check out Introduction to JSON Web Tokens https://jwt.io/introduction/

Obtain an access token

Send a request with the parameters username and password

Definition

POST /api/admin/login_check Go to definition
POST /api/{storeCode}/member/login_check Go to definition

Example

curl {HOST}/api/admin/login_check
    -H 'Content-Type: application/json;charset=UTF-8'
    -H 'Accept: application/json, text/plain, */*'
    --data-binary '{"username":"admin","password":"password"}'

Example Response

{
    "token":"eyJhbGciOiJSUzI1NiIsInR5cCI6...",
    "refresh_token":"0558f8bb29948c4e54c443f..."
}

Using JSON Web Token

Add authorization header to each request
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...
You can now access any API method you want under the /api prefix.

Example

curl {HOST}/api/{storeCode}/analytics/members
    -H 'Accept: application/json'
    -H 'Content-type: application/x-www-form-urlencoded'
    -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...'

Refresh JSON Web Token

You can refresh token using refresh_token that was given during login.
There are two endpoints
To refresh admin token POST /api/token/refresh Go to definition
To refresh member token POST /api/{storeCode}/token/refresh Go to definition

Path parameters
storeCodestringRequired

Store code

Bodyobject[]

List of groups. Each group applies its status (and optional comment) to its own issuedRewardIds, so a single request can set different statuses for different rewards. The total number of issued reward ids across all groups must not exceed a configurable limit; exceeding it rejects the whole request with a 400.

The constraints below describe valid input. Violating one of the per-item constraints — an unknown status, a comment over 255 characters, or an issuedRewardIds entry that is not a uuid — is not rejected with a 400: the request is accepted and that item is reported as failed in the response.

issuedRewardIdsstring · uuid[] · min: 1Required

IDs of the issued rewards that should receive this group's status.

statusstring · enumRequired

Status to apply to every issued reward in this group.

Possible values:
commentstring · max: 255 · nullableOptional

Comment related to the status change (optional).

Responses
200

Per-item report of the bulk status change.

application/json
issuedRewardIdstringRequired

ID of the issued reward this report line refers to. Rows appear in the order the ids were submitted, one row per submitted id, so a repeated id appears once per occurrence. A uuid is required here and is what every row carries, with one exception: a row rejected with invalid_issued_reward_id echoes the submitted value back verbatim, since that is the only way for the caller to recognise which of its inputs was rejected.

okbooleanRequired

Whether the status change succeeded for this issued reward.

errorstring · enum · nullableOptional

Per-item failure reason; null (and omitted) when ok is true. Field-level problems that belong to one item are reported here rather than rejecting the request, so a 200 response can still contain failed rows.

Possible values:
post/api/{storeCode}/redemption/status/bulk
POST /api/{storeCode}/redemption/status/bulk HTTP/1.1
Host: openloyalty.localhost
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 97

[
  {
    "issuedRewardIds": [
      "123e4567-e89b-12d3-a456-426614174000"
    ],
    "status": "issued",
    "comment": "text"
  }
]
[
  {
    "issuedRewardId": "text",
    "ok": true,
    "error": "issued_reward_not_found"
  }
]

Last updated

Was this helpful?