Complete a redemption
curl --request POST \
--url https://api.rigaly.com/api/v1/redemptions/{code}/complete \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.rigaly.com/api/v1/redemptions/{code}/complete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.rigaly.com/api/v1/redemptions/{code}/complete"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.rigaly.com/api/v1/redemptions/{code}/complete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"success": true,
"message": "<string>",
"data": {
"redemption": {
"code": "AB12CD34",
"status": "completed",
"reward_name": "Free Coffee",
"points_cost": 500,
"type": "standard",
"cashback_cents": 123
},
"transaction": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "redeem",
"points": 500,
"created_at": "2023-11-07T05:31:56Z"
}
}
}{
"success": false,
"error": {
"message": "Provide exactly one of \"user_id\" or \"identifier\""
}
}{
"success": false,
"error": {
"message": "Reward not found"
}
}{
"success": false,
"error": {
"message": "REDEMPTION_LIMIT_REACHED:10"
}
}Redemptions
Complete a redemption
Consumes the redemption code: verifies ownership, pending status,
expiry, reward cooldowns/eligibility, the reward’s redemption cap, and
the customer’s balance; deducts the points; and marks the redemption
completed. This is the same engine Rigaly PTS terminals use. Supports
Idempotency-Key.
In-store rewards only — the same REDEMPTION_NOT_IN_STORE:<mode> (400)
and REDEMPTION_LIMIT_REACHED:<max> (409) rejections as the validate
endpoint apply.
POST
/
api
/
v1
/
redemptions
/
{code}
/
complete
Complete a redemption
curl --request POST \
--url https://api.rigaly.com/api/v1/redemptions/{code}/complete \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.rigaly.com/api/v1/redemptions/{code}/complete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.rigaly.com/api/v1/redemptions/{code}/complete"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.rigaly.com/api/v1/redemptions/{code}/complete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"success": true,
"message": "<string>",
"data": {
"redemption": {
"code": "AB12CD34",
"status": "completed",
"reward_name": "Free Coffee",
"points_cost": 500,
"type": "standard",
"cashback_cents": 123
},
"transaction": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "redeem",
"points": 500,
"created_at": "2023-11-07T05:31:56Z"
}
}
}{
"success": false,
"error": {
"message": "Provide exactly one of \"user_id\" or \"identifier\""
}
}{
"success": false,
"error": {
"message": "Reward not found"
}
}{
"success": false,
"error": {
"message": "REDEMPTION_LIMIT_REACHED:10"
}
}Authorizations
API key from the Rigaly dashboard: Authorization: Bearer rgly_sk_...
Headers
Optional. Retries with the same key within 24h replay the original response instead of repeating the operation.
Maximum string length:
255Path Parameters
The short redemption code the customer shows (from the Rigaly app).
Example:
"AB12CD34"