Redeem a voucher
curl --request POST \
--url https://app.giftvoucherbrilliance.co.uk/api/external/v1/tenants/{tenant}/redemptions \
--header 'Accept: <accept>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"redemption_token": "<string>",
"voucher_id": 2
}
'const options = {
method: 'POST',
headers: {
Accept: '<accept>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({redemption_token: '<string>', voucher_id: 2})
};
fetch('https://app.giftvoucherbrilliance.co.uk/api/external/v1/tenants/{tenant}/redemptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.giftvoucherbrilliance.co.uk/api/external/v1/tenants/{tenant}/redemptions"
payload = {
"redemption_token": "<string>",
"voucher_id": 2
}
headers = {
"Accept": "<accept>",
"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://app.giftvoucherbrilliance.co.uk/api/external/v1/tenants/{tenant}/redemptions",
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([
'redemption_token' => '<string>',
'voucher_id' => 2
]),
CURLOPT_HTTPHEADER => [
"Accept: <accept>",
"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;
}{
"data": {
"voucher": {
"id": 123,
"reference": "<string>",
"current_balance": 123,
"initial_balance": 123,
"currency": "<string>",
"is_monetary": true,
"allow_part_redeem": true,
"product_title": "<string>",
"recipient_name": "<string>",
"customer_name": "<string>",
"redemption_status": "<string>",
"void": true,
"date_valid_start": "2023-12-25",
"date_valid_end": "2023-12-25"
},
"tenant": {
"id": 123,
"name": "<string>",
"type": "<string>",
"source_tenant_id": 123,
"source_tenant_name": "<string>",
"source_tenant_type": "<string>"
},
"redeemed_at": "2023-11-07T05:31:56Z",
"actor": {
"id": 123,
"name": "<string>"
}
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>"
}Redemptions
Redeem a voucher
redeem_vouchers permission required. This operation changes voucher state.
All successful responses include X-Request-Id and Cache-Control: private, no-store. Requests are limited to 120 per minute.
POST
/
tenants
/
{tenant}
/
redemptions
Redeem a voucher
curl --request POST \
--url https://app.giftvoucherbrilliance.co.uk/api/external/v1/tenants/{tenant}/redemptions \
--header 'Accept: <accept>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"redemption_token": "<string>",
"voucher_id": 2
}
'const options = {
method: 'POST',
headers: {
Accept: '<accept>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({redemption_token: '<string>', voucher_id: 2})
};
fetch('https://app.giftvoucherbrilliance.co.uk/api/external/v1/tenants/{tenant}/redemptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.giftvoucherbrilliance.co.uk/api/external/v1/tenants/{tenant}/redemptions"
payload = {
"redemption_token": "<string>",
"voucher_id": 2
}
headers = {
"Accept": "<accept>",
"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://app.giftvoucherbrilliance.co.uk/api/external/v1/tenants/{tenant}/redemptions",
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([
'redemption_token' => '<string>',
'voucher_id' => 2
]),
CURLOPT_HTTPHEADER => [
"Accept: <accept>",
"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;
}{
"data": {
"voucher": {
"id": 123,
"reference": "<string>",
"current_balance": 123,
"initial_balance": 123,
"currency": "<string>",
"is_monetary": true,
"allow_part_redeem": true,
"product_title": "<string>",
"recipient_name": "<string>",
"customer_name": "<string>",
"redemption_status": "<string>",
"void": true,
"date_valid_start": "2023-12-25",
"date_valid_end": "2023-12-25"
},
"tenant": {
"id": 123,
"name": "<string>",
"type": "<string>",
"source_tenant_id": 123,
"source_tenant_name": "<string>",
"source_tenant_type": "<string>"
},
"redeemed_at": "2023-11-07T05:31:56Z",
"actor": {
"id": 123,
"name": "<string>"
}
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>"
}Authorizations
Bearer token created in the GVB API Access page.
Headers
Must be application/json.
Available options:
application/json Path Parameters
Authorised tenant identifier from the tenant directory.
Body
application/json
Use the short-lived token returned by resolve, or an authorised voucher id. Amount is in major units.
Response
Successful response.
Show child attributes
Show child attributes
⌘I