Code samples
The calls you will make most, in four languages. Official packages are not published yet; generate a client from the OpenAPI document if you prefer one.
Check your key
GET /me
curl "https://api.opentourbase.com/api/supplier/v1/me" \
-H "Authorization: Bearer $API_KEY"List products
GET /products
curl "https://api.opentourbase.com/api/supplier/v1/products?limit=25" \
-H "Authorization: Bearer $API_KEY"Read one product
GET /products/{uuid}
curl "https://api.opentourbase.com/api/supplier/v1/products/{uuid}" \
-H "Authorization: Bearer $API_KEY"Read availability
GET /options/{optionUuid}/availability
curl "https://api.opentourbase.com/api/supplier/v1/options/{optionUuid}/availability?local_date=2026-12-05" \
-H "Authorization: Bearer $API_KEY"Hold a booking
POST /bookings
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"}'Confirm a booking
POST /bookings/{uuid}/confirm
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"}}'Read events
GET /events
curl "https://api.opentourbase.com/api/supplier/v1/events?after=evt_01JD3XB0V7M2A8K4R6T9W1Y3Z5" \
-H "Authorization: Bearer $API_KEY"Add a webhook endpoint
POST /webhook-endpoints
curl -X POST "https://api.opentourbase.com/api/supplier/v1/webhook-endpoints" \
-H "Authorization: Bearer $API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com/webhooks","events":["booking.confirmed","booking.cancelled"]}'Verify a webhook signature
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));
});
}