Validate a redemption code
curl --request GET \
--url https://api.rigaly.com/api/v1/redemptions/{code} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.rigaly.com/api/v1/redemptions/{code}', 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}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.rigaly.com/api/v1/redemptions/{code}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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": "pending",
"expires_at": "2023-11-07T05:31:56Z",
"points_used": 123,
"cashback_cents": 123,
"reward": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Free Coffee",
"description": "<string>",
"conditions": "Valid for SKUs COF-M-* only",
"points_cost": 500,
"type": "standard"
},
"customer": {
"name": "Jane Doe"
}
}
}
}{
"success": false,
"error": {
"message": "REDEMPTION_NOT_IN_STORE:shipping"
}
}{
"success": false,
"error": {
"message": "Reward not found"
}
}{
"success": false,
"error": {
"message": "REDEMPTION_LIMIT_REACHED:10"
}
}Redemptions
Validate a redemption code
Validates a customer’s redemption code without consuming it.
Returns the reward (including its conditions text) and the customer,
so your system can check the purchase against the reward before
completing. Codes are created when customers redeem a reward in the
Rigaly app.
Only in_store rewards produce a code to validate: shipping and digital
redemptions are rejected with REDEMPTION_NOT_IN_STORE:<mode> (400).
A code whose reward has since hit its redemption cap is rejected with
REDEMPTION_LIMIT_REACHED:<max> (409) — the code cannot be honored.
GET
/
api
/
v1
/
redemptions
/
{code}
Validate a redemption code
curl --request GET \
--url https://api.rigaly.com/api/v1/redemptions/{code} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.rigaly.com/api/v1/redemptions/{code}', 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}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.rigaly.com/api/v1/redemptions/{code}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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": "pending",
"expires_at": "2023-11-07T05:31:56Z",
"points_used": 123,
"cashback_cents": 123,
"reward": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Free Coffee",
"description": "<string>",
"conditions": "Valid for SKUs COF-M-* only",
"points_cost": 500,
"type": "standard"
},
"customer": {
"name": "Jane Doe"
}
}
}
}{
"success": false,
"error": {
"message": "REDEMPTION_NOT_IN_STORE:shipping"
}
}{
"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_...
Path Parameters
The short redemption code the customer shows (from the Rigaly app).
Example:
"AB12CD34"