Reference API
Věrnostní karty
Doplněk Věrnostní karty: karta podle čísla nebo načteného QR kódu, přičtení razítek či bodů (i podle útraty) a výdej odměny z pokladny nebo e-shopu. S reference je opakovaný požadavek bezpečný.
Každý endpoint přijímá i hlavičku DOOHUB-Account (agentury: id klientského účtu).
/loyalty/cards/{code}One loyalty card
Add-on Loyalty cards (Payments → Add-ons). code is the card number (10 characters, spaces ignored) or the scanned QR text DHL-<number>. With the program, its rewards and the last 10 movements; the holder's e-mail is never returned.
Jakýkoli klíč
Parametry
| Název | Typ | Popis |
|---|---|---|
| codev cestě · povinný | string |
Chyby
401Missing, invalid or revoked API key.403The plan doesn't include the API or the account doesn't have the Loyalty cards add-on (addon_required).404Not found in this account.429More than 120 requests a minute; see Retry-After.
curl "https://admin.doohub.online/api/v1/loyalty/cards/{code}" \
-H "Authorization: Bearer dh_…"{
"data": {
"number": "string",
"holder": "string",
"balance": 0,
"lifetime": 0,
"visits": 0,
"blocked": false,
"created_at": "2026-11-02T09:30:00Z",
"last_activity_at": "2026-11-02T09:30:00Z",
"program": {
"id": "3f2b8c1e-5d4a-4c7e-9b61-2a8e0f6d1c47",
"name": "string",
"kind": "stamps",
"currency": "CZK",
"enabled": false
},
"rewards": [
{
"id": "3f2b8c1e-5d4a-4c7e-9b61-2a8e0f6d1c47",
"name": "string",
"cost": 0
}
],
"events": [
{
"id": 0,
"kind": "issue",
"points": 0,
"balance": 0,
"note": "string",
"source": "string",
"created_at": "2026-11-02T09:30:00Z"
}
]
}
}/loyalty/cards/{code}/pointsAdd points or take a reward
Write key (agencies: the client's campaign or screen manager). earn: stamps per visit by default, points as given, or amount_minor spent (points programs: points per 1 unit of the currency). redeem: the reward's cost is taken off (reward_id). Send a reference (e.g. the receipt number): a repeated request with the same reference returns the first result (200, repeated: true) and is not counted twice; without it a second earn within the program's pause is refused (too_soon).
Klíč pro zápis
Parametry
| Název | Typ | Popis |
|---|---|---|
| codev cestě · povinný | string |
Tělo požadavku
| Pole | Typ | Popis |
|---|---|---|
| action | earn | redeem | |
| points | integer | |
| amount_minor | integer | Amount spent in minor units (points programs). |
| reward_id | string (uuid) | Required for redeem. |
| note | string | |
| reference | string | Your id of the operation (receipt number): retries are not counted twice. |
Chyby
401Missing, invalid or revoked API key.403The key can only read (write_required), the client's role doesn't allow it (client_role) or no Loyalty cards add-on (addon_required).404No such card or reward in this account.409Not enough points (insufficient_balance), a double scan (too_soon), a blocked card (card_blocked) or a disabled program (program_disabled).422Invalid input or a rule of the platform (code and message say which).429More than 120 requests a minute; see Retry-After.
curl -X POST "https://admin.doohub.online/api/v1/loyalty/cards/{code}/points" \
-H "Authorization: Bearer dh_…" \
-H "Content-Type: application/json" \
-d '{"action":"earn","points":1,"amount_minor":0,"reward_id":"3f2b8c1e-5d4a-4c7e-9b61-2a8e0f6d1c47","note":"string","reference":"string"}'{
"action": "earn",
"points": 1,
"amount_minor": 0,
"reward_id": "3f2b8c1e-5d4a-4c7e-9b61-2a8e0f6d1c47",
"note": "string",
"reference": "string"
}{
"data": {
"number": "string",
"action": "string",
"points": 0,
"bonus": 0,
"balance": 0,
"repeated": false
}
}