MENU navbar-image

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

Authenticate requests to this API's endpoints by sending 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=16&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": "16",
    "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'=> '16',
            'expanded'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


{
    "data": {
        "orderNumber": 5,
        "discountCode": "nulla",
        "discountTotal": "0",
        "total": 49.78,
        "shippingCost": 69.69,
        "orderDate": null,
        "numVouchers": 1,
        "customer": 4512
    }
}
 

Request      

GET api/orders

Query Parameters

page  integer optional  

The page number to return.

expanded  boolean optional  

Expand related values to full objects e.g return all orders with customer details.

Return details about a single order.

requires authentication

Example request:
curl --request GET \
    --get "https://admin.giftvoucherbrilliance.co.uk/api/orders/libero?$order=assumenda&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/libero"
);

const params = {
    "$order": "assumenda",
    "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/libero',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            '$order'=> 'assumenda',
            'expanded'=> '1',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


{
    "data": {
        "orderNumber": 6,
        "discountCode": "expedita",
        "discountTotal": "0",
        "total": 55.03,
        "shippingCost": 64.06,
        "orderDate": null,
        "numVouchers": 1,
        "customer": 4513
    }
}
 

Request      

GET api/orders/{order_number}

URL Parameters

order_number  string  

Query Parameters

$order  string  

The order ID of the order to return.

expanded  boolean optional  

Expand related values to full objects e.g return the order with voucher and customer details.

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"
    }
}
 

Request      

GET api/shop

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=7" \
    --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": "7",
};
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'=> '7',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


{
    "data": {
        "code": "qoo-000725-000471",
        "description": "Lunch or Pre-Theatre Supper<br/>Two Courses for One Guest&nbsp;",
        "issuedDate": "2025-05-19 04:14:09",
        "validFromDate": "2025-05-19 04:14:09",
        "expiryDate": "2026-02-26 00:00:00",
        "personalisation": {
            "to": "quidem",
            "message": "Earum eum et delectus est molestiae harum incidunt. Iste quae incidunt id velit animi. Est maxime vel asperiores iusto. Ab maxime dicta tenetur."
        },
        "total": 7.56,
        "paid": 7.56,
        "balance": 39.7,
        "status": "Unredeemed",
        "customerName": "Courtney Hill",
        "partRedeemable": false,
        "delivery": {
            "method": "Email",
            "cost": 75.82,
            "email": null
        }
    }
}
 

Request      

GET api/vouchers-sold

Query Parameters

page  integer optional  

The page number to return.

Return details about a single voucher.

requires authentication

Example request:
curl --request GET \
    --get "https://admin.giftvoucherbrilliance.co.uk/api/vouchers-sold/quos" \
    --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/quos"
);

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/quos',
    [
        '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": "sgz-000481-000623",
        "description": "Mud Rasul<br/>2 people (45 mins) &nbsp;",
        "issuedDate": "2025-01-05 05:40:37",
        "validFromDate": "2025-01-05 05:40:37",
        "expiryDate": "2026-12-07 00:00:00",
        "personalisation": {
            "to": "numquam",
            "message": "Commodi eos eum excepturi aut. Aut esse voluptate quisquam commodi non molestias. Laborum reiciendis in ratione non ut. Quod dignissimos qui quod veritatis qui esse itaque dolorum."
        },
        "total": 11.23,
        "paid": 11.23,
        "balance": 0.92,
        "status": "Unredeemed",
        "customerName": "Amber Mitchell",
        "partRedeemable": true,
        "delivery": {
            "method": "Post",
            "type": "Vouchers will be sent via email",
            "cost": 45.92
        }
    }
}
 

Request      

GET api/vouchers-sold/{code_voucher_id}

URL Parameters

code_voucher_id  string  

The ID of the code voucher.

code  string  

The code of the voucher to return.

Redeem a voucher.

requires authentication

Example request:
curl --request POST \
    "https://admin.giftvoucherbrilliance.co.uk/api/voucher/aut/redeem" \
    --header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"amount\": 8
}"
const url = new URL(
    "https://admin.giftvoucherbrilliance.co.uk/api/voucher/aut/redeem"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_TOKEN}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "amount": 8
};

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/aut/redeem',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'amount' => 8,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


{
    "data": {
        "code": "sfr-000522-000360",
        "description": "Back, Face & Scalp Massage ",
        "issuedDate": "2024-06-25 23:33:32",
        "validFromDate": "2024-06-25 23:33:32",
        "expiryDate": "2026-06-06 00:00:00",
        "personalisation": {
            "to": "provident",
            "message": "Omnis vel perspiciatis totam tempora aperiam et. Et omnis vitae et quia cupiditate qui ratione. Debitis distinctio non laudantium officia eum rerum ut."
        },
        "total": 86.88,
        "paid": 86.88,
        "balance": 37.2,
        "status": "Redeemed",
        "customerName": "Vanessa Jones",
        "partRedeemable": true,
        "delivery": {
            "method": "Email",
            "cost": 70.3,
            "email": null
        }
    }
}
 

Request      

POST api/voucher/{code_voucher_id}/redeem

URL Parameters

code_voucher_id  string  

The ID of the code voucher.

code  string  

The code of the voucher to be redeemed.

Body Parameters

amount  integer optional  

If the voucher has partRedeemable set to true then you can pass this value. It should be an amount equal or less than the balance of the voucher. The value provided must be of smallest monetary unit of the currency used (integer) e.g £10.43 => 1043.