Obsah dokumentace

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).

get/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ázevTypPopis
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.
Požadavek
curl "https://admin.doohub.online/api/v1/loyalty/cards/{code}" \
  -H "Authorization: Bearer dh_…"
Odpověď 200
{
  "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"
      }
    ]
  }
}
post/loyalty/cards/{code}/points

Add 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ázevTypPopis
codev cestě · povinnýstring

Tělo požadavku

PoleTypPopis
actionearn | redeem
pointsinteger
amount_minorintegerAmount spent in minor units (points programs).
reward_idstring (uuid)Required for redeem.
notestring
referencestringYour 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.
Požadavek
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"}'
Příklad těla
{
  "action": "earn",
  "points": 1,
  "amount_minor": 0,
  "reward_id": "3f2b8c1e-5d4a-4c7e-9b61-2a8e0f6d1c47",
  "note": "string",
  "reference": "string"
}
Odpověď 200
{
  "data": {
    "number": "string",
    "action": "string",
    "points": 0,
    "bonus": 0,
    "balance": 0,
    "repeated": false
  }
}

Cookies jsou malé soubory, které si web ukládá ve vašem prohlížeči. Nezbytné nelze vypnout, ostatní kategorie povolujete vy.

Nezbytné

Vždy zapnuté

Přihlášení, volba účtu a jazyka, uložení vaší volby cookies a ochrana plateb. Bez nich web nefunguje.

sb-…-auth-token, doohub_account, NEXT_LOCALE, doohub_consent, doohub_ref, doohub_sidebar, doohub_menu, doohub_theme, doohub_support_return, doohub_mfa_later, doohub_signed_in, __stripe_mid, __stripe_sid

Žádné analytické ani marketingové cookies nepoužíváme, proto se vás na souhlas neptáme. Kdybychom je zavedli, zeptáme se předem.