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

Example response (200):


{
    "data": {
        "orderNumber": 5,
        "discountCode": "nam",
        "discountTotal": "0",
        "total": 41.81,
        "shippingCost": 26.25,
        "orderDate": null,
        "numVouchers": 1,
        "customer": 3728
    }
}
 

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

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

Example response (200):


{
    "data": {
        "orderNumber": 6,
        "discountCode": "accusantium",
        "discountTotal": "0",
        "total": 65.29,
        "shippingCost": 85.84,
        "orderDate": null,
        "numVouchers": 1,
        "customer": 3729
    }
}
 

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": "uyv-000993-000702",
        "description": "Mud Rasul<br/>2 people (45 mins) &nbsp;",
        "issuedDate": "2024-03-07 02:34:58",
        "validFromDate": "2024-03-07 02:34:58",
        "expiryDate": "2024-07-30 00:00:00",
        "personalisation": {
            "to": "alias",
            "message": "Quia facilis rerum maxime quis id. Non porro laboriosam at cumque qui. Unde hic eos hic optio enim iure. Fugit ipsa deserunt illo autem ipsa ullam."
        },
        "total": 82.9,
        "paid": 82.9,
        "balance": 52.55,
        "status": "Unredeemed",
        "customerName": "Emma Wilkinson",
        "partRedeemable": true,
        "delivery": {
            "method": "Email",
            "cost": 87.12,
            "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/perferendis" \
    --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/perferendis"
);

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/perferendis',
    [
        '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": "ugj-000180-000130",
        "description": "Mud Rasul<br/>2 people (45 mins) &nbsp;",
        "issuedDate": "2023-07-18 10:46:25",
        "validFromDate": "2023-07-18 10:46:25",
        "expiryDate": "2025-11-10 00:00:00",
        "personalisation": {
            "to": "fugiat",
            "message": "Cumque beatae vel veritatis magnam veniam magni est. Et dolorem aperiam ad voluptatem explicabo aliquid eligendi. Doloremque nisi eveniet dolores."
        },
        "total": 93.28,
        "paid": 93.28,
        "balance": 59.72,
        "status": "Unredeemed",
        "customerName": "Olivia Mason",
        "partRedeemable": false,
        "delivery": {
            "method": "Post",
            "type": "Gift Box Signed 1st class ",
            "cost": 30.62
        }
    }
}
 

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

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

let body = {
    "amount": 19
};

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

Example response (200):


{
    "data": {
        "code": "cxv-000039-000962",
        "description": "Monetary Vouchers<br/>To the value of &pound;40.00",
        "issuedDate": "2023-05-30 15:22:43",
        "validFromDate": "2023-05-30 15:22:43",
        "expiryDate": "2025-01-27 00:00:00",
        "personalisation": {
            "to": "commodi",
            "message": "Sit quia dolorum dolores corrupti mollitia. Non placeat aliquam totam voluptate dolor est earum aut. Laboriosam repellendus ea qui. Voluptas voluptatum est impedit et et necessitatibus."
        },
        "total": 17.76,
        "paid": 17.76,
        "balance": 89.4,
        "status": "Redeemed",
        "customerName": "Jackson Stewart",
        "partRedeemable": false,
        "delivery": {
            "method": "Email",
            "cost": 52.53,
            "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.