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=17&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": "17",
"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'=> '17',
'expanded'=> '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"orderNumber": 5,
"discountCode": "sit",
"discountTotal": "0",
"total": 36.19,
"shippingCost": 0.92,
"orderDate": null,
"numVouchers": 1,
"customer": 4375
}
}
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/et?$order=minima&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/et"
);
const params = {
"$order": "minima",
"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/et',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'$order'=> 'minima',
'expanded'=> '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"orderNumber": 6,
"discountCode": "consequuntur",
"discountTotal": "0",
"total": 4.92,
"shippingCost": 84.84,
"orderDate": null,
"numVouchers": 1,
"customer": 4376
}
}
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=9" \
--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": "9",
};
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'=> '9',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"code": "sdo-000428-000376",
"description": "Prosecco Afternoon Tea<br/>2 people ",
"issuedDate": "2024-04-17 10:08:28",
"validFromDate": "2024-04-17 10:08:28",
"expiryDate": "2026-04-13 00:00:00",
"personalisation": {
"to": "et",
"message": "Qui nihil officia esse aut quia. Est aut sapiente est consequatur rerum. Nam sit quis aut similique natus porro. Nesciunt sed ex rerum omnis nostrum veniam."
},
"total": 31.97,
"paid": 31.97,
"balance": 7.79,
"status": "Unredeemed",
"customerName": "Yvette Wilson",
"partRedeemable": true,
"delivery": {
"method": "Post",
"type": "Vouchers will be sent via email",
"cost": 41.42
}
}
}
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/asperiores" \
--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/asperiores"
);
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/asperiores',
[
'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": "rmo-000775-000982",
"description": "Afternoon Tea<br/>for Two",
"issuedDate": "2024-06-04 13:40:32",
"validFromDate": "2024-06-04 13:40:32",
"expiryDate": "2026-08-06 00:00:00",
"personalisation": {
"to": "consequuntur",
"message": "Dicta nihil rem qui qui. Fuga ad quia aperiam ut et. Occaecati cupiditate dolorum voluptatem accusantium omnis. Vel alias earum modi magni fugiat cumque reprehenderit."
},
"total": 0.63,
"paid": 0.63,
"balance": 23.56,
"status": "Redeemed",
"customerName": "Tyler Kennedy",
"partRedeemable": false,
"delivery": {
"method": "Email",
"cost": 20.48,
"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/et/redeem" \
--header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"amount\": 10
}"
const url = new URL(
"https://admin.giftvoucherbrilliance.co.uk/api/voucher/et/redeem"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"amount": 10
};
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/et/redeem',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'amount' => 10,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"data": {
"code": "dfi-000510-000180",
"description": "Ultimate Spa Treatment<br/>For Two ",
"issuedDate": "2024-10-28 14:47:22",
"validFromDate": "2024-10-28 14:47:22",
"expiryDate": "2025-07-16 00:00:00",
"personalisation": {
"to": "ad",
"message": "Assumenda exercitationem velit quia repellat. Dolor asperiores eius quibusdam nihil nulla. Eum optio minus voluptas minus possimus unde."
},
"total": 25.01,
"paid": 25.01,
"balance": 37.56,
"status": "Redeemed",
"customerName": "Zachary Thompson",
"partRedeemable": false,
"delivery": {
"method": "Post",
"type": "Vouchers will be sent via email",
"cost": 13.78
}
}
}
Received response:
Request failed with error: