API introduction
Quick start
On this page
This page takes you from nothing to a first call, a page of orders and a webhook. It works for any GroKeeper store: you need the store's own address and a key that the store makes for you. Allow about ten minutes.
Before you start#
| You need | Where it comes from |
|---|---|
The store's own address, for example https://yourstore.example.com | The store owner tells you. Every store has its own address. There is no shared GroKeeper address for the API. |
| An API key | A Super Admin of the store makes it (step 1). It is shown only once. |
| A way to send requests | curl, the language you work in, or the Postman collection. |
| For webhooks: a public https address of your own | Your server must be reachable from the internet. Private and localhost addresses are refused. |
Good to know
The base address of the API is the store's own address followed by /api/v1, for example https://yourstore.example.com/api/v1. If you connect to more than one store, each store has its own address and its own keys.
Step 1: the store makes a key#
Only a Super Admin of the store can make a key. Send them this list, or sit with them while they do it.
- Open Settings > API & webhooks > API keys and press Create API key.
- Name the key after what will use it, for example "Accounting sync".
- Tick only the permissions (scopes) it needs. For this quick start,
read:productsandread:ordersare enough. Tick a write permission only when your software really has to change something. - Optional: the internet addresses of your server (an allow-list), an expiry date, and a limit of requests per minute (the default is 120).
- Press Create key and copy the key. It is shown only once. The store keeps only a scrambled copy and cannot show it again. If it is lost, rotate the key to get a new secret.
Keep the key where your software reads secrets (a secret manager, or an environment variable on your server), never in the code. More on keys and scopes.
Step 2: send the key with every request#
Authorization: Bearer YOUR_API_KEYYou can use the header X-Api-Key: YOUR_API_KEY instead. Never put the key in the address of a request, where it would be saved in logs.
Step 3: make your first call#
List one product. The key needs the read:products scope. Replace the address with the store's own address and YOUR_API_KEY with your key.
curl -s "https://yourstore.example.com/api/v1/products?limit=1" \
-H "Authorization: Bearer YOUR_API_KEY"<?php
$ch = curl_init('https://yourstore.example.com/api/v1/products?limit=1');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_KEY',
],
]);
$response = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status >= 400) {
// $response['error']['code'] and $response['error']['message'] say what to fix
}// Node.js 18 or newer (fetch is built in). Save as call.mjs and run: node call.mjs
const res = await fetch('https://yourstore.example.com/api/v1/products?limit=1', {
headers: {
Authorization: 'Bearer YOUR_API_KEY',
},
});
const json = await res.json();
if (!res.ok) {
// json.error.code and json.error.message say what to fix
}# Python 3 with the requests library (pip install requests)
import requests
res = requests.get(
"https://yourstore.example.com/api/v1/products?limit=1",
headers={"Authorization": "Bearer YOUR_API_KEY"},
timeout=30,
)
data = res.json()
if not res.ok:
# data["error"]["code"] and data["error"]["message"] say what to fix
print(data["error"])A status of 200 means it worked. The answer has data (what you asked for), meta and, for lists, links:
{
"data": [
{
"id": 7,
"sku": "SAMPLE-001",
"name": "Sample Product",
"slug": "sample-product",
"active": false,
"category": "Sample Category",
"url": "https://example.com/product/sample-product",
"short": "A short description of the product.",
"images": [
"https://example.com/img/products/sample-product.jpg"
],
"variants": [
{
"id": 31,
"label": "250 g",
"price": 399,
"mrp": 449,
"stock": 120
},
{
"id": 32,
"label": "500 g",
"price": 749,
"mrp": 849,
"stock": 60
}
]
}
],
"meta": {
"page": 1,
"per_page": 25,
"total": 1,
"last_page": 1
},
"links": {
"first": "https://yourstore.example.com/api/v1/products?page=1",
"last": "https://yourstore.example.com/api/v1/products?page=1",
"prev": null,
"next": null
}
}| You see | What to do |
|---|---|
401 missing_api_key or invalid_api_key | Check that the header is there and that the whole key was copied. |
403 insufficient_scope | The key lacks a permission. error.required_scope names it. Ask the store to add it. |
403 ip_not_allowed | The key has an allow-list and your server's address is not on it. |
404 not_found | Check the address: the store's own web address, then /api/v1/products. |
429 rate_limited | Wait the seconds in Retry-After. |
503 service_busy | The store is busy for a moment. Wait the seconds in Retry-After and send the same request again. |
Every error code is on Responses and errors.
Step 4: read a page of orders#
Paid orders, 25 at a time. The key needs the read:orders scope.
curl -s "https://yourstore.example.com/api/v1/orders?payment_status=paid&limit=25" \
-H "Authorization: Bearer YOUR_API_KEY"<?php
$ch = curl_init('https://yourstore.example.com/api/v1/orders?payment_status=paid&limit=25');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_KEY',
],
]);
$response = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status >= 400) {
// $response['error']['code'] and $response['error']['message'] say what to fix
}// Node.js 18 or newer (fetch is built in). Save as call.mjs and run: node call.mjs
const res = await fetch('https://yourstore.example.com/api/v1/orders?payment_status=paid&limit=25', {
headers: {
Authorization: 'Bearer YOUR_API_KEY',
},
});
const json = await res.json();
if (!res.ok) {
// json.error.code and json.error.message say what to fix
}# Python 3 with the requests library (pip install requests)
import requests
res = requests.get(
"https://yourstore.example.com/api/v1/orders?payment_status=paid&limit=25",
headers={"Authorization": "Bearer YOUR_API_KEY"},
timeout=30,
)
data = res.json()
if not res.ok:
# data["error"]["code"] and data["error"]["message"] say what to fix
print(data["error"])- Each order has its items, the customer's name and contact details, the delivery address and the read-only
source(where the order came from). Treat it as personal data. meta.totalis how many orders match andlinks.nextis the address of the next page, ornullon the last page. Follow it until it isnull. Ask forlimit=100to read faster.- To keep another system up to date, ask only for what changed: add
updated_since=2026-11-21T10:00:00Zand remember the time of your last successful read. See Pagination. - An order number such as
GK-261008-7WNMis text. The first letters are the store's own order prefix, so never rely on them.
Step 5: create a webhook#
Instead of asking again and again, let the store tell you. A webhook is made in the store's admin by a Super Admin.
- Open Settings > API & webhooks > Webhooks and press Add webhook.
- Give it a name (for example "Order feed") and the public https address of your receiver, for example
https://integrations.example.com/hooks/grokeeper. - Choose the events. Start with Order paid (
order.paid). Leave Include customers' personal details on only if your software needs them. - Press Create webhook and copy the signing secret. It is shown only once.
- Open the webhook and press Send test event. Your address receives a message with
"test": trueand made-up data.
Your receiver gets a POST with a JSON body like this (the headers are on the Webhooks page):
{
"id": "evt_example0001",
"type": "order.paid",
"created": "2026-11-21T10:15:00Z",
"api_version": "2026-11-21",
"test": true,
"data": {
"id": 1024,
"number": "GK-261008-7WNM",
"status": "placed",
"payment_status": "paid",
"total": 1217,
"...": "the rest of the order, as the API returns it"
}
}- Check the signature in the header
X-GroKeeper-Signaturebefore you trust the message: working code in PHP, Node.js and Python. - Answer with a 2xx status within 5 seconds. Do the slow work afterwards.
- Ignore repeats: keep the
idof every event you have handled. The same event can arrive more than once.
Where to go next#
- Integration recipes: four worked examples with curl, JavaScript, PHP and Python.
- Go-live checklist and Security best practices: before you connect a real store.
- API reference: every call, its fields and its errors.
- API changes: what each platform version added.