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

This API is authenticated 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=19&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"
);

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

Example response (200):


{
    "data": {
        "orderNumber": 5,
        "discountCode": "tenetur",
        "discountTotal": "0",
        "total": 34.08,
        "shippingCost": 7,
        "orderDate": null,
        "numVouchers": 1,
        "customer": 4577
    }
}
 

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/fuga?$order=iure&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/fuga"
);

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

Example response (200):


{
    "data": {
        "orderNumber": 6,
        "discountCode": "debitis",
        "discountTotal": "0",
        "total": 84.53,
        "shippingCost": 3.63,
        "orderDate": null,
        "numVouchers": 1,
        "customer": 4578
    }
}
 

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

Example response (200):


{
    "data": {
        "code": "wod-000327-000142",
        "description": "Back, Face & Scalp Massage ",
        "issuedDate": "2024-08-21 14:08:07",
        "validFromDate": "2024-08-21 14:08:07",
        "expiryDate": "2025-08-07 00:00:00",
        "personalisation": {
            "to": "quam",
            "message": "Quis qui fugit nihil quia. Optio sunt omnis reprehenderit qui. Recusandae rerum facere ut. Est tempora sunt quibusdam dolores."
        },
        "total": 80.31,
        "paid": 80.31,
        "balance": 89.54,
        "status": "Unredeemed",
        "customerName": "Sally Hughes",
        "partRedeemable": false,
        "delivery": {
            "method": "Post",
            "type": "Envelope Standard 1st class",
            "cost": 93.96
        }
    }
}
 

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/quisquam" \
    --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/quisquam"
);

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/quisquam',
    [
        '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": "gxo-000409-000149",
        "description": "Back, Face & Scalp Massage ",
        "issuedDate": "2024-09-19 13:42:45",
        "validFromDate": "2024-09-19 13:42:45",
        "expiryDate": "2025-12-20 00:00:00",
        "personalisation": {
            "to": "nostrum",
            "message": "Non aut quia officia nesciunt provident quis iure omnis. Molestiae ex facere voluptatibus est molestiae. Eius eius ullam esse ullam voluptas dolor dignissimos. Nostrum velit dolor ea consequatur."
        },
        "total": 15.19,
        "paid": 15.19,
        "balance": 27.72,
        "status": "Unredeemed",
        "customerName": "Chelsea Griffiths",
        "partRedeemable": false,
        "delivery": {
            "method": "Post",
            "type": "Vouchers will be sent via email",
            "cost": 75.53
        }
    }
}
 

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/recusandae/redeem" \
    --header "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"amount\": 16
}"
const url = new URL(
    "https://admin.giftvoucherbrilliance.co.uk/api/voucher/recusandae/redeem"
);

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

let body = {
    "amount": 16
};

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

Example response (200):


{
    "data": {
        "code": "arn-000459-000194",
        "description": "Afternoon Tea<br/>for One",
        "issuedDate": "2025-03-04 10:23:18",
        "validFromDate": "2025-03-04 10:23:18",
        "expiryDate": "2026-11-06 00:00:00",
        "personalisation": {
            "to": "impedit",
            "message": "Delectus qui aut rerum. Eligendi et alias aperiam. Dolor debitis fugit pariatur quod iure. Quam est et eius sint ut inventore."
        },
        "total": 86.35,
        "paid": 86.35,
        "balance": 61.4,
        "status": "Unredeemed",
        "customerName": "Paul Wright",
        "partRedeemable": false,
        "delivery": {
            "method": "Post",
            "type": "Vouchers will be sent via email",
            "cost": 75.61
        }
    }
}
 

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.