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

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

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

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

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

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/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&nbsp;",
        "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
        }
    }
}
 

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.