Deduct points
curl --request POST \
--url https://api.rigaly.com/api/v1/points/redeem \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user_id": "6f1c9f3a-0000-4000-8000-000000000000",
"points": 1000,
"description": "$10 store credit"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_id: '6f1c9f3a-0000-4000-8000-000000000000',
points: 1000,
description: '$10 store credit'
})
};
fetch('https://api.rigaly.com/api/v1/points/redeem', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.rigaly.com/api/v1/points/redeem"
payload = {
"user_id": "6f1c9f3a-0000-4000-8000-000000000000",
"points": 1000,
"description": "$10 store credit"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.rigaly.com/api/v1/points/redeem",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'user_id' => '6f1c9f3a-0000-4000-8000-000000000000',
'points' => 1000,
'description' => '$10 store credit'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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": {
"customer": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Jane Doe"
},
"points_redeemed": 1000,
"balance": 4600,
"transaction": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "earn",
"points": 123,
"description": "<string>",
"points_multiplier": 1,
"created_at": "2023-11-07T05:31:56Z"
}
}
}{
"success": false,
"error": {
"message": "Provide exactly one of \"user_id\" or \"identifier\""
}
}{
"success": false,
"error": {
"message": "Customer not found. Check the user_id or identifier."
}
}Points
Deduct points
Deducts raw points from a customer’s balance (for store credit,
discounts applied in your own system, etc.). Fails if the balance is
insufficient. Supports Idempotency-Key.
To redeem a Rigaly reward, use the redemptions endpoints instead.
POST
/
api
/
v1
/
points
/
redeem
Deduct points
curl --request POST \
--url https://api.rigaly.com/api/v1/points/redeem \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user_id": "6f1c9f3a-0000-4000-8000-000000000000",
"points": 1000,
"description": "$10 store credit"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
user_id: '6f1c9f3a-0000-4000-8000-000000000000',
points: 1000,
description: '$10 store credit'
})
};
fetch('https://api.rigaly.com/api/v1/points/redeem', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.rigaly.com/api/v1/points/redeem"
payload = {
"user_id": "6f1c9f3a-0000-4000-8000-000000000000",
"points": 1000,
"description": "$10 store credit"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.rigaly.com/api/v1/points/redeem",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'user_id' => '6f1c9f3a-0000-4000-8000-000000000000',
'points' => 1000,
'description' => '$10 store credit'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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": {
"customer": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Jane Doe"
},
"points_redeemed": 1000,
"balance": 4600,
"transaction": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "earn",
"points": 123,
"description": "<string>",
"points_multiplier": 1,
"created_at": "2023-11-07T05:31:56Z"
}
}
}{
"success": false,
"error": {
"message": "Provide exactly one of \"user_id\" or \"identifier\""
}
}{
"success": false,
"error": {
"message": "Customer not found. Check the user_id or identifier."
}
}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:
255Body
application/json