All API requests require authentication using a Bearer token. You can find your API key in your GMK Online account settings. If you do not have one you will need to contact the GMK sales office to set one up.
Header Format:
Authorization: Bearer your-api-key-here
POST /stock-query-by-brand.php
| Name | Type | Required | Description |
|---|---|---|---|
| brand | string | Yes | The brand code to query products for |
| format | string | No | Response format (json, xml, csv, text). Defaults to json |
{
"status": "success",
"data": {
"brand": "example-brand",
"products": [
{
"sku": "ABC123",
"description": "Product Description",
"stock_status": "IN_STOCK",
"quantity": 10,
"timestamp": "2025-03-04T15:38:15Z",
"last_updated": "2025-03-04 15:38:15"
}
]
}
}
<?xml version="1.0"?>
<stock>
<status>success</status>
<data>
<brand>example-brand</brand>
<products>
<product>
<sku>ABC123</sku>
<description>Product Description</description>
<stock_status>IN_STOCK</stock_status>
<quantity>10</quantity>
<timestamp>2025-03-04T15:38:15Z</timestamp>
<last_updated>2025-03-04 15:38:15</last_updated>
</product>
</products>
</data>
</stock>
sku,description,stock_status,quantity,timestamp,last_updated
ABC123,"Product Description","IN_STOCK",10,"2025-03-04T15:38:15Z","2025-03-04 15:38:15"
brand: example-brand
Products:
ABC123: 10 - Product Description
The API may return the following error responses:
| Status Code | Description |
|---|---|
| 401 Unauthorized | Invalid or missing API key |
| 400 Bad Request | Missing brand parameter or invalid format specified |
Error Response Format:
{
"status": "error",
"message": "Error description here"
}
curl -X POST \
'https://api.gmk.co.uk/stock-query-by-cat' \
-H 'Authorization: Bearer your-api-key-here' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'brand=example-brand&format=json'
$apiKey = 'your-api-key-here';
$brand = 'example-brand';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.gmk.co.uk/stock-query-by-cat');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
'brand' => $brand,
'format' => 'json'
]));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $apiKey
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$data = json_decode($response, true);
curl_close($ch);
Use this form to test the API with your credentials.
No test run yet
If you need assistance with the API or have any questions, please contact our support team.
Contact Support