API dla firm

Połącz swój system kasowy (POS), kiosk samoobsługowy albo aplikację do zamówień z Gotowe.app. Twój system tworzy zamówienie i oznacza je jako gotowe – tablet przy kasie, telefon klienta i ekran dla klientów widzą zmianę od razu, a Ty dostajesz powiadomienie (webhook) o każdej zmianie.

API jest dostępne w planie Business (konta firmowe). Klucze i webhooki tworzysz na stronie „Lokale” po zalogowaniu kontem firmy.

Szybki start

  1. Zaloguj się kontem firmy, otwórz Lokale → API i webhooki i kliknij Utwórz klucz. Skopiuj klucz – pokazujemy go tylko raz.
  2. Pobierz listę lokali, żeby poznać ich id:
    curl https://gotowe.app/api/v1/locations \
      -H "Authorization: Bearer gt_live_TWOJ_KLUCZ"
  3. Utwórz zamówienie. Odpowiedź zawiera numer do wydrukowania na paragonie i link (lub kod QR) dla klienta:
    curl -X POST https://gotowe.app/api/v1/orders \
      -H "Authorization: Bearer gt_live_..." \
      -H "Content-Type: application/json" \
      -d '{"location": 12, "label": "Bez cebuli"}'
  4. Gdy kuchnia skończy, oznacz zamówienie jako gotowe – telefon klienta zagra dźwięk i zacznie migać:
    curl -X POST https://gotowe.app/api/v1/orders/4821/ready \
      -H "Authorization: Bearer gt_live_..."

Uwierzytelnianie

Adres bazowy: https://gotowe.app/api/v1. Każde zapytanie wysyła klucz w nagłówku Authorization: Bearer gt_live_… (albo X-Api-Key). Treść zapytań i odpowiedzi to JSON (Content-Type: application/json), czasy są w UTC (ISO 8601).

Klucz działa dla wszystkich lokali firmy. Trzymaj go wyłącznie na serwerze – nigdy w aplikacji na telefonie ani w kodzie strony. Jeśli wycieknie, unieważnij go i utwórz nowy.

Endpoints

ŚcieżkaCo robi
GET/locationsLokale firmy: id, nazwa, czy aktywny, link do QR przy kasie.
POST/ordersNowe zamówienie. Body: location (id lokalu; można pominąć, gdy firma ma jeden lokal), opcjonalnie label (do 40 znaków, np. „Bez cebuli”, widoczne dla klienta i kasjera). Numer nadajemy sami – kolejny w danym dniu, według numeracji ustawionej na koncie firmy. Jeśli w Lokale → API i webhooki → Numer zamówienia z API wybierzesz Numer z systemu kasowego, wysyłasz go sam w polu number (liczba 1–99999, np. numer paragonu; "0453" zapiszemy jako 453). Wtedy number jest wymagane.
GET/ordersZamówienia z dnia. Parametry: location, status (waiting, ready, collected, cancelled), day (YYYY-MM-DD, domyślnie dziś). Do 500 wyników, od najnowszych.
GET/orders/{id}Jedno zamówienie.
GET/orders/{id}/qr.svgKod QR dla klienta (SVG) – do pokazania na ekranie kiosku lub wydruku.
POST/orders/{id}/readyGotowe do odbioru: powiadamia klienta.
POST/orders/{id}/collectedOdebrane: zamyka zamówienie.
POST/orders/{id}/cancelAnulowane.
POST/orders/{id}/reopenCofnięcie: zamówienie wraca do „czeka” (jak „Cofnij” na tablecie).

Dozwolone zmiany statusu: waiting → ready → collected, a także waiting/ready → cancelled i cofnięcie do waiting. Inna zmiana zwraca 409 invalid_transition z aktualnym statusem.

Obiekt zamówienia

{
  "order": {
    "id": 4821,
    "number": 17,
    "status": "waiting",
    "label": "Bez cebuli",
    "location": { "id": 12, "name": "Burger Bar Mokotów" },
    "customerUrl": "https://gotowe.app/o/Xk2v9QpL0aZt",
    "qrUrl": "https://gotowe.app/api/v1/orders/4821/qr.svg",
    "createdAt": "2026-11-02T12:30:05Z",
    "openedAt": null,
    "readyAt": null,
    "closedAt": null
  }
}

Błędy i limity

Błędy mają kod HTTP i treść {"error": "kod", "message": "opis"}:

401unauthorizedbrak klucza lub klucz nieważny
402subscription_requiredplan firmy nie jest opłacony
400location_requiredpodaj location
404location_not_found / not_foundnie ma takiego lokalu lub zamówienia w tej firmie
409invalid_transitionta zmiana statusu nie jest możliwa
400number_required / invalid_numberwłączony numer z systemu kasowego: podaj number od 1 do 99999
400pos_numbers_offwysłano number, a numery nadaje Gotowe.app (zmień ustawienie albo nie wysyłaj pola)
409number_in_usezamówienie z tym numerem w tym lokalu jeszcze czeka albo jest gotowe; numer zwolni się po odbiorze lub anulowaniu
429rate_limitedza dużo zapytań – spróbuj za minutę

Limit: 300 zapytań na minutę na klucz. Do 10 kluczy i 5 webhooków na firmę.

Webhooks

Webhook to adres na Twoim serwerze, na który wysyłamy POST z JSON-em przy każdej zmianie zamówienia – bez względu na to, czy zmiana przyszła z API, z tabletu, czy z telefonu klienta. Dodajesz go w Lokale → API i webhooki i wybierasz zdarzenia:

order.creatednowe zamówienie
order.openedklient otworzył zamówienie na telefonie
order.readygotowe do odbioru
order.collectedodebrane
order.cancelledanulowane
order.reopenedcofnięte do „czeka”
{
  "id": "evt_3mQ1v7Hn0cYk2Zr8aPq",
  "type": "order.ready",
  "created": "2026-11-02T12:41:17.204Z",
  "data": {
    "order": { "id": 4821, "number": 17, "status": "ready", "...": "..." }
  }
}

Nagłówki: Gotowe-Event (typ), Gotowe-Delivery (id zdarzenia – takie samo przy ponownych próbach, użyj go, żeby nie przetworzyć zdarzenia dwa razy) i Gotowe-Signature: t=…,v1=….

Sprawdzanie podpisu

v1 to HMAC-SHA256 (hex) tekstu <t>.<surowa treść> z sekretem webhooka (whsec_…, pokazywany raz przy dodaniu). Odrzucaj zapytania z błędnym podpisem albo starsze niż 5 minut.

Node.js

const crypto = require('crypto');

// rawBody = the request body exactly as received (a string or Buffer, before JSON.parse)
function verifyGotowe(rawBody, header, secret, toleranceSec = 300) {
  const parts = Object.fromEntries(header.split(',').map((p) => p.split('=')));
  const expected = crypto.createHmac('sha256', secret).update(`${parts.t}.${rawBody}`).digest('hex');
  const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) < toleranceSec;
  return fresh && parts.v1 && crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1));
}

PHP

<?php
$raw    = file_get_contents('php://input');
$header = $_SERVER['HTTP_GOTOWE_SIGNATURE'] ?? '';
parse_str(str_replace(',', '&', $header), $p);
$expected = hash_hmac('sha256', $p['t'] . '.' . $raw, getenv('GOTOWE_WEBHOOK_SECRET'));
if (!hash_equals($expected, $p['v1'] ?? '') || abs(time() - (int)$p['t']) > 300) {
    http_response_code(400); exit;
}
$event = json_decode($raw, true);
http_response_code(200);

Odpowiedź i ponowne próby

Odpowiedz kodem 2xx w ciągu 10 sekund (najlepiej od razu, a pracę wykonaj w tle). W razie błędu ponawiamy po 1 minucie, 10 minutach i 1 godzinie. Po 20 zdarzeniach z rzędu, których nie udało się dostarczyć, wyłączamy webhook – włączysz go ponownie jednym kliknięciem. Przycisk Test wysyła zdarzenie ping. Nie podążamy za przekierowaniami i wysyłamy tylko na publiczne adresy https://.

Pytania

Chętnie pomożemy przy integracji – napisz na pomoc@gotowe.app.

API for companies

Connect your POS, self-service kiosk or ordering app to Gotowe.app. Your system creates the order and marks it ready – the tablet at the counter, the customer's phone and the customer screen all see the change at once, and you get a notification (webhook) for every change.

The API is part of the Business plan (company accounts). You create keys and webhooks on the "Locations" page, logged in with the company account.

Quick start

  1. Log in with the company account, open Locations → API & webhooks and click Create key. Copy the key – it is shown only once.
  2. List your locations to get their id:
    curl https://gotowe.app/api/v1/locations \
      -H "Authorization: Bearer gt_live_YOUR_KEY"
  3. Create an order. The response has the number to print on the receipt and the link (or QR code) for the customer:
    curl -X POST https://gotowe.app/api/v1/orders \
      -H "Authorization: Bearer gt_live_..." \
      -H "Content-Type: application/json" \
      -d '{"location": 12, "label": "No onions"}'
  4. When the kitchen is done, mark it ready – the customer's phone plays a sound and flashes:
    curl -X POST https://gotowe.app/api/v1/orders/4821/ready \
      -H "Authorization: Bearer gt_live_..."

Authentication

Base URL: https://gotowe.app/api/v1. Send the key with every request in Authorization: Bearer gt_live_… (or X-Api-Key). Request and response bodies are JSON (Content-Type: application/json), times are UTC (ISO 8601).

A key works for all of the company's locations. Keep it on your server only – never in a phone app or website code. If it leaks, revoke it and create a new one.

Endpoints

PathWhat it does
GET/locationsThe company's locations: id, name, whether active, counter QR link.
POST/ordersNew order. Body: location (location id; may be left out when the company has one location), optional label (up to 40 characters, e.g. "No onions", shown to the customer and cashier). We assign the number – the next one that day, following the numbering set on the company account. If you choose Number from your POS in Locations → API & webhooks → Order number from the API, you send it yourself in number (a whole number 1–99999, e.g. the receipt number; "0453" is saved as 453). number is then required.
GET/ordersA day's orders. Parameters: location, status (waiting, ready, collected, cancelled), day (YYYY-MM-DD, default today). Up to 500, newest first.
GET/orders/{id}One order.
GET/orders/{id}/qr.svgThe customer QR code (SVG) – to show on a kiosk screen or print.
POST/orders/{id}/readyReady for pickup: alerts the customer.
POST/orders/{id}/collectedCollected: closes the order.
POST/orders/{id}/cancelCancelled.
POST/orders/{id}/reopenUndo: the order goes back to "waiting" (like "Undo" on the tablet).

Allowed status changes: waiting → ready → collected, also waiting/ready → cancelled and undo back to waiting. Anything else returns 409 invalid_transition with the current status.

Order object

{
  "order": {
    "id": 4821,
    "number": 17,
    "status": "waiting",
    "label": "No onions",
    "location": { "id": 12, "name": "Burger Bar Mokotów" },
    "customerUrl": "https://gotowe.app/o/Xk2v9QpL0aZt",
    "qrUrl": "https://gotowe.app/api/v1/orders/4821/qr.svg",
    "createdAt": "2026-11-02T12:30:05Z",
    "openedAt": null,
    "readyAt": null,
    "closedAt": null
  }
}

Errors & limits

Errors have an HTTP status and the body {"error": "code", "message": "description"}:

401unauthorizedmissing or invalid key
402subscription_requiredthe company's plan isn't paid
400location_requiredpass location
404location_not_found / not_foundno such location or order in this company
409invalid_transitionthis status change isn't allowed
400number_required / invalid_numbernumbers from your POS are on: pass number from 1 to 99999
400pos_numbers_offnumber was sent but Gotowe.app gives the numbers (change the setting or leave the field out)
409number_in_usean order with this number at this location is still waiting or ready; the number frees up once it's collected or cancelled
429rate_limitedtoo many requests – retry in a minute

Limit: 300 requests a minute per key. Up to 10 keys and 5 webhooks per company.

Webhooks

A webhook is an address on your server that we POST JSON to on every order change – whether it came from the API, the tablet or the customer's phone. Add it under Locations → API & webhooks and pick the events:

order.creatednew order
order.openedthe customer opened the order on their phone
order.readyready for pickup
order.collectedcollected
order.cancelledcancelled
order.reopenedundone back to "waiting"
{
  "id": "evt_3mQ1v7Hn0cYk2Zr8aPq",
  "type": "order.ready",
  "created": "2026-11-02T12:41:17.204Z",
  "data": {
    "order": { "id": 4821, "number": 17, "status": "ready", "...": "..." }
  }
}

Headers: Gotowe-Event (type), Gotowe-Delivery (event id – the same on retries, use it so you never process an event twice) and Gotowe-Signature: t=…,v1=….

Checking the signature

v1 is the HMAC-SHA256 (hex) of <t>.<raw body> with the webhook's secret (whsec_…, shown once when you add it). Reject requests with a wrong signature or older than 5 minutes.

Node.js

const crypto = require('crypto');

// rawBody = the request body exactly as received (a string or Buffer, before JSON.parse)
function verifyGotowe(rawBody, header, secret, toleranceSec = 300) {
  const parts = Object.fromEntries(header.split(',').map((p) => p.split('=')));
  const expected = crypto.createHmac('sha256', secret).update(`${parts.t}.${rawBody}`).digest('hex');
  const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) < toleranceSec;
  return fresh && parts.v1 && crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1));
}

PHP

<?php
$raw    = file_get_contents('php://input');
$header = $_SERVER['HTTP_GOTOWE_SIGNATURE'] ?? '';
parse_str(str_replace(',', '&', $header), $p);
$expected = hash_hmac('sha256', $p['t'] . '.' . $raw, getenv('GOTOWE_WEBHOOK_SECRET'));
if (!hash_equals($expected, $p['v1'] ?? '') || abs(time() - (int)$p['t']) > 300) {
    http_response_code(400); exit;
}
$event = json_decode($raw, true);
http_response_code(200);

Responses and retries

Answer with a 2xx status within 10 seconds (ideally at once, doing the work in the background). On failure we retry after 1 minute, 10 minutes and 1 hour. After 20 events in a row that couldn't be delivered we switch the webhook off – turn it back on with one click. The Test button sends a ping event. We don't follow redirects and only call public https:// addresses.

Questions

We're happy to help with your integration – write to pomoc@gotowe.app.