Get code pool counts
curl --request GET \
--url https://api.rigaly.com/api/v1/rewards/{id}/pool \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.rigaly.com/api/v1/rewards/{id}/pool', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.rigaly.com/api/v1/rewards/{id}/pool"
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/rewards/{id}/pool",
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": "Code pool retrieved successfully",
"data": {
"reward_id": "3f2b1c9e-7d4a-4f1b-8c2e-9a0d1e2f3b4c",
"total": 5000,
"available": 4863,
"consumed": 137,
"capacity": 100000
}
}{
"success": false,
"error": {
"message": "REWARD_NOT_POOL_SOURCED"
}
}{
"success": false,
"error": {
"message": "Reward not found"
}
}Rewards
Get code pool counts
Counts for a reward whose digital_asset_source is pool. Poll it to
know when to refill: at available: 0 the reward switches itself off
(deactivated_by_pool: true) and disappears from the customer app.
Any other reward returns REWARD_NOT_POOL_SOURCED (400). See the
pool lifecycle.
GET
/
api
/
v1
/
rewards
/
{id}
/
pool
Get code pool counts
curl --request GET \
--url https://api.rigaly.com/api/v1/rewards/{id}/pool \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.rigaly.com/api/v1/rewards/{id}/pool', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.rigaly.com/api/v1/rewards/{id}/pool"
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/rewards/{id}/pool",
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": "Code pool retrieved successfully",
"data": {
"reward_id": "3f2b1c9e-7d4a-4f1b-8c2e-9a0d1e2f3b4c",
"total": 5000,
"available": 4863,
"consumed": 137,
"capacity": 100000
}
}{
"success": false,
"error": {
"message": "REWARD_NOT_POOL_SOURCED"
}
}{
"success": false,
"error": {
"message": "Reward not found"
}
}