Skip to content

Quickstart

From a test key to a held booking and a received webhook in five steps.

On this page

1. Create a test key

In the panel open Developers, switch to Test and create a key with read-only access. Copy the key when it is shown: it is shown once. Keep it in an environment variable called API_KEY.

2. Check the key

GET /me answers with your account, the key's mode and its scopes. If this works, everything else will.

bash
curl "https://api.opentourbase.com/api/supplier/v1/me" \
  -H "Authorization: Bearer $API_KEY"
json
{
  "data": {
    "key": {
      "id": "ush_test_Ab12Cd34Ef56Gh78Ij90Kl12",
      "label": "Website back-end",
      "mode": "test",
      "scopes": [
        "products:read",
        "events:read"
      ]
    },
    "supplier": {
      "id": "0b0f6a0e-5a57-4a10-9f6c-2f7f7a5d3c11",
      "name": "Aurora Tours",
      "currency": "GEL",
      "currencyPrecision": 2,
      "timeZone": "Asia/Tbilisi"
    }
  }
}

3. List your products

Test keys read your real catalogue, availability and prices, so what you see is what you will sell.

bash
curl "https://api.opentourbase.com/api/supplier/v1/products?limit=25" \
  -H "Authorization: Bearer $API_KEY"

4. Hold and confirm a test booking

Find a departure, hold places on it, then confirm. A test key needs the bookings:write scope for this, so give your key full access or add the scope. Test bookings take no money and reach no guest.

bash
curl "https://api.opentourbase.com/api/supplier/v1/options/{optionUuid}/availability?local_date=2026-12-05" \
  -H "Authorization: Bearer $API_KEY"
bash
curl -X POST "https://api.opentourbase.com/api/supplier/v1/bookings" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"optionId":"{optionId}","availabilityId":"{availabilityId}","units":[{"unitId":"{unitId}","quantity":2}],"reference":"ORDER-1042"}'
bash
curl -X POST "https://api.opentourbase.com/api/supplier/v1/bookings/{uuid}/confirm" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"contact":{"fullName":"Ana Beridze","email":"ana@example.com"},"payment":{"mode":"offline"}}'

5. Receive a webhook

Add an endpoint under Developers › Webhooks and press Send test event. Your server gets a signed request within a second. Check the signature before you trust it.

javascript
import crypto from "node:crypto";

export function verify(rawBody, headers, secret, toleranceSec = 300) {
  const id = headers["webhook-id"], ts = headers["webhook-timestamp"], sig = headers["webhook-signature"];
  if (!id || !ts || !sig || Math.abs(Date.now() / 1000 - Number(ts)) > toleranceSec) return false;
  const key = Buffer.from(secret.replace(/^whsec_/, ""), "base64");
  const expected = crypto.createHmac("sha256", key).update(`${id}.${ts}.${rawBody}`).digest("base64");
  return sig.split(" ").some((p) => {
    const [v, s] = p.split(",");
    return v === "v1" && s && s.length === expected.length && crypto.timingSafeEqual(Buffer.from(s), Buffer.from(expected));
  });
}
NextAuthentication
PricingStart free