Introduction
API for Gift Voucher Brilliance
This documentation aims to provide all the information you need to work with our API.
Base URL
https://admin.giftvoucherbrilliance.co.uk
Authenticating requests
To authenticate requests, include an Authorization
header with the value "Bearer {YOUR_AUTH_KEY}"
.
All authenticated endpoints are marked with a requires authentication
badge in the documentation below.
You can retrieve your token by visiting your dashboard and clicking API on the menu. If you don't have this feature, please contact support@giftvoucherbrilliance.co.uk.
Order
Return details about the latest orders.
requires authentication
Example request:
curl --request GET \
--get "https://admin.giftvoucherbrilliance.co.uk/api/orders?page=14&expanded=1" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://admin.giftvoucherbrilliance.co.uk/api/orders"
);
const params = {
"page": "14",
"expanded": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://admin.giftvoucherbrilliance.co.uk/api/orders',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page'=> '14',
'expanded'=> '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"orderNumber": 5,
"discountCode": "qui",
"discountTotal": "0",
"total": 73.44,
"shippingCost": 63.11,
"orderDate": null,
"numVouchers": 1,
"customer": 4172
}
}
Received response:
Request failed with error:
Return details about a single order.
requires authentication
Example request:
curl --request GET \
--get "https://admin.giftvoucherbrilliance.co.uk/api/orders/ipsum?$order=doloribus&expanded=" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://admin.giftvoucherbrilliance.co.uk/api/orders/ipsum"
);
const params = {
"$order": "doloribus",
"expanded": "0",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://admin.giftvoucherbrilliance.co.uk/api/orders/ipsum',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'$order'=> 'doloribus',
'expanded'=> '0',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"orderNumber": 6,
"discountCode": "incidunt",
"discountTotal": "0",
"total": 15.64,
"shippingCost": 96.67,
"orderDate": null,
"numVouchers": 1,
"customer": 4173
}
}
Received response:
Request failed with error:
Shop
Endpoints for getting information about the current shop which is decided via the API Token used.
Return details about the current authenicated shop
requires authentication
Example request:
curl --request GET \
--get "https://admin.giftvoucherbrilliance.co.uk/api/shop" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://admin.giftvoucherbrilliance.co.uk/api/shop"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://admin.giftvoucherbrilliance.co.uk/api/shop',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 59
{
"data": {
"title": "Clockwork",
"url": "https://clockwork.giftvoucherbrilliance.co.uk"
}
}
Received response:
Request failed with error:
Voucher
Return details about the latest vouchers issued.
requires authentication
Example request:
curl --request GET \
--get "https://admin.giftvoucherbrilliance.co.uk/api/vouchers-sold?page=6" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://admin.giftvoucherbrilliance.co.uk/api/vouchers-sold"
);
const params = {
"page": "6",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://admin.giftvoucherbrilliance.co.uk/api/vouchers-sold',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page'=> '6',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"code": "nof-000912-000521",
"description": "Afternoon Tea<br/>for One",
"issuedDate": "2024-06-14 14:15:44",
"validFromDate": "2024-06-14 14:15:44",
"expiryDate": "2024-12-29 00:00:00",
"personalisation": {
"to": "ipsum",
"message": "Id hic ullam similique est. Ut qui illo omnis voluptatibus quia libero. Fugit placeat non aut ducimus. Sapiente est aut consequatur officia."
},
"total": 25.78,
"paid": 25.78,
"balance": 56.42,
"status": "Unredeemed",
"customerName": "Kevin Murray",
"partRedeemable": false,
"delivery": {
"method": "Post",
"type": "Vouchers will be sent via email",
"cost": 54.54
}
}
}
Received response:
Request failed with error:
Return details about a single voucher.
requires authentication
Example request:
curl --request GET \
--get "https://admin.giftvoucherbrilliance.co.uk/api/vouchers-sold/non" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://admin.giftvoucherbrilliance.co.uk/api/vouchers-sold/non"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://admin.giftvoucherbrilliance.co.uk/api/vouchers-sold/non',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"code": "qcs-000703-000273",
"description": "Back, Face & Scalp Massage ",
"issuedDate": "2024-11-16 19:35:40",
"validFromDate": "2024-11-16 19:35:40",
"expiryDate": "2025-09-09 00:00:00",
"personalisation": {
"to": "eos",
"message": "Culpa voluptatum ab aut vitae asperiores occaecati. Neque optio blanditiis consequuntur minus nisi aut est. Pariatur fugit dolorem eligendi qui eos tempora sequi. Non et sunt et."
},
"total": 32.36,
"paid": 32.36,
"balance": 47.25,
"status": "Redeemed",
"customerName": "Oscar Smith",
"partRedeemable": false,
"delivery": {
"method": "Email",
"cost": 22.05,
"email": null
}
}
}
Received response:
Request failed with error:
Redeem a voucher.
requires authentication
Example request:
curl --request POST \
"https://admin.giftvoucherbrilliance.co.uk/api/voucher/quia/redeem" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"amount\": 7
}"
const url = new URL(
"https://admin.giftvoucherbrilliance.co.uk/api/voucher/quia/redeem"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"amount": 7
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://admin.giftvoucherbrilliance.co.uk/api/voucher/quia/redeem',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'amount' => 7,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"code": "ftu-000770-000018",
"description": "Prosecco Afternoon Tea<br/>2 people ",
"issuedDate": "2024-10-25 07:10:06",
"validFromDate": "2024-10-25 07:10:06",
"expiryDate": "2026-07-26 00:00:00",
"personalisation": {
"to": "ducimus",
"message": "Aut rem autem voluptatum. Eum magni enim fugit quae. Libero dolor magni quia."
},
"total": 47.29,
"paid": 47.29,
"balance": 66.78,
"status": "Redeemed",
"customerName": "Matthew Wilkinson",
"partRedeemable": false,
"delivery": {
"method": "Email",
"cost": 47.82,
"email": null
}
}
}
Received response:
Request failed with error: