Resvisor Agency API — Developer Guide

A REST API that lets your agency run hotel, tour and cruise search + booking from your own system. This guide walks through the integration step by step: authentication, request/response formats, real examples and error handling.

Base URL · api.woxxtravelglobal.com JSON · camelCase JWT Bearer

Introduction

The Agency API lets you do programmatically what you do by hand in the web B2B portal (search + booking). Every agency has its own API key; the key carries your agency identity, so markup, source-market rules and accounting are applied automatically.

  • Base URL: https://api.woxxtravelglobal.com
  • Content type: application/json · all fields are camelCase
  • Authentication: every request except /v1/auth/token requires Authorization: Bearer <token>
  • Interactive exploration: Swagger UI → api.woxxtravelglobal.com (pick "Acente API v1" at the top)

Quick start

  1. Get a key. Request an apiKey + secret from the Resvisor support team (support@resvisor.com). There are two environments: sandbox (testing) and live (real sales).
  2. Create a token. Exchange your key for a short-lived JWT with POST /v1/auth/token (valid for 1 hour).
  3. Make calls. Send the token in the Authorization: Bearer header and run searches/bookings.
# 1) Get a token
curl -s -X POST https://api.woxxtravelglobal.com/v1/auth/token \
  -H "Content-Type: application/json" \
  -d '{"apiKey":"pk_sb_...","secret":"sk_sb_..."}'
# → { "token":"eyJhbGci...", "expires_in":3599, "environment":"sandbox", ... }

# 2) Search hotels with the token
curl -s -X POST https://api.woxxtravelglobal.com/v1/hotels/search \
  -H "Authorization: Bearer eyJhbGci..." \
  -H "Content-Type: application/json" \
  -d '{"checkIn":"2026-08-08","checkOut":"2026-08-12","adults":2,"destinationId":1176,"currency":"EUR"}'

Authentication

POST/v1/auth/token

API key + secret → short-lived JWT. This endpoint does not require a token (anonymous).

Request

{ "apiKey": "pk_sb_...", "secret": "sk_sb_..." }

Response 200

{
  "token": "eyJhbGciOiJ...<jwt>...",
  "token_type": "Bearer",
  "expires_at": "2026-06-24T07:02:47Z",
  "expires_in": 3599,
  "environment": "sandbox",
  "scopes": "hotel,tour,cruise"
}
The token lives for 1 hour. Renew it before it expires, using expires_in (seconds) or expires_at (ISO). Store the token securely; its short lifetime limits the risk if it leaks.

You can also try it from Swagger — open the endpoint and click "Try it out":

Request basics

Authorization header

Every endpoint except the token endpoint requires this header:

Authorization: Bearer <token>
Content-Type: application/json

Response envelope

Successful responses of READ endpoints share one format — always read response.data:

{ "data": <content>, "meta": { "requestId": "...", "environment": "sandbox" } }
Enveloped/v1/me, /v1/destinations, /v1/destinations/tree, /v1/hotels/{id}, /v1/hotels/{id}/rooms, /v1/categories, /v1/chains, /v1/boards, hotels|tours|cruises/search, GET /v1/hotels and GET /v1/bookings (lists; their meta also carries page, perPage, total)
Not enveloped/v1/auth/token (token returned directly), POST /v1/bookings, GET /v1/bookings/{reference}, POST /v1/bookings/{reference}/cancel (operation results), error responses

Error format

All errors come back in a single format:

{ "error": { "code": "invalid_secret", "message": "Invalid secret." } }

Search — hotel / tour / cruise

All three return in the response envelope: { "data": <combined result>, "meta": {...} }. Inside data the relevant array is populated: hotelData[], tourPackageData[] + groupedTours[], cruiseData[].

POST/v1/hotels/search

Request

{
  "checkIn": "2026-08-08", "checkOut": "2026-08-12",
  "adults": 2, "children": 0,
  "destinationId": 1176, "currency": "EUR",
  "sourceCountryCode": "TR"
}

Source of destinationId: GET /v1/destinations. Alternatives: destinationCode, cityId, destinationZoneId, hotelIds[]. sourceCountryCode = the market you sell to (source-market filtering).

Multiple rooms (rooms)

To search several rooms, send rooms: one item per room, each with adults and childAges (array of ages). Example — 2 rooms: 2 adults + 2 adults with children aged 5 and 8:

{
  "checkIn": "2026-12-10", "checkOut": "2026-12-13",
  "destinationId": 1176, "currency": "EUR", "sourceCountryCode": "TR",
  "rooms": [
    { "adults": 2, "childAges": [] },
    { "adults": 2, "childAges": [5, 8] }
  ]
}

Limits: at most 8 rooms; each room needs at least 1 and at most 6 adults and at most 4 children; child ages are 0–17. When rooms is sent, roomCount, adults, children and childAges are ignored.

Without rooms: roomCount=1 (default) searches one room. With roomCount>1 the guests are split across the rooms evenly: adults are divided equally (extra adults go to the first rooms) and the ages in childAges ("5,8") are given to the rooms in order. For a different split, send rooms.

400 invalid_request when: more than 8 rooms; a room without an adult, with more than 6 adults or with more than 4 children; a child age outside 0–17; or, without rooms, adults lower than roomCount or the number of ages in childAges different from children.

A multi-room price covers all rooms. In a multi-room search each rate shows the number of rooms (rooms) and the total guests; net/sellingRate is the total for all rooms and the rateKey carries every room. Send the same rateKey to POST /v1/hotels/quote and POST /v1/bookings: the rooms are kept as searched. In the booking, passengers[] are assigned to the rooms in order (the first room's guests first). Hotels from the Setur supplier are not returned in multi-room searches. If currency is not sent to POST /v1/hotels/quote, the price is returned in EUR.

Response 200 (contents of data — fields shortened)

{
  "count": 1,
  "hotelData": [{
    "hotelId": 2007482, "name": "Rixos Beldibi", "stars": 5, "rating": 4.6,
    "cityName": "Antalya", "countryCode": "TR", "thumbnail": "https://...",
    "rooms": [{
      "name": "CLASSIC ROOM MOUNTAIN VIEW", "roomId": 866,
      "rates": [{
        "rateKey": "2007482|866|BED_AND_BREAKFAST|ALL INCLUSIVE|1786147200|1786406400",
        "net": "24036.77", "sellingRate": "24036.77", "currencyCode": "TRY",
        "boardName": "ALL INCLUSIVE", "allotment": 10,
        "adults": 2, "children": 0,
        "cancellationPolicies": [{ "amount": 453.4, "from": "2026-08-05T00:00:00Z" }]
      }]
    }]
  }],
  "tourPackageData": [], "cruiseData": []
}

Board basis (boardCodeStd)

Every rate carries boardCodeStd: one of six standard codes (RO BB HB FB AI UAI) or null when the board cannot be classified. boardCode and boardName stay as the supplier sends them and vary by supplier, so use boardCodeStd to classify boards. The code list with names is GET /v1/boards.

{
  "rateKey": "902007501|811|BED_AND_BREAKFAST|AI|1812585600|1812844800|m1",
  "net": "880.00", "sellingRate": "1012.00", "currencyCode": "EUR",
  "boardCode": "AI", "boardName": "AI", "boardCodeStd": "AI",
  "allotment": 10
}
rateKey is the anchor of the booking — it carries the chosen room/board/date combination and is used in the POST /v1/bookings snapshot. Markup is not visible in the list price (identical to the web); the agency margin is applied in hotel detail and in the booking.
POST/v1/hotels/quote

Optional step between search and booking: returns the final price, the final cancellation policy and whether the rate can be booked. Nothing is reserved.

{ "rateKey": "<rateKey from the search result>", "checkIn": "2026-12-10", "checkOut": "2026-12-13",
  "adults": 4, "children": 0, "rooms": 2, "currency": "EUR", "amount": 640.20 }
{
  "data": {
    "hotelId": "902007498", "roomName": "CLASSIC DOUBLE ROOM", "boardCodeStd": "RO",
    "checkIn": "2026-12-10", "checkOut": "2026-12-13", "rooms": 2, "adults": 4, "children": 0,
    "totalPrice": 640.20, "currency": "EUR", "priceChanged": false, "previousPrice": 640.20,
    "bookable": true, "reason": null,
    "cancellationPolicy": { "type": "REFUNDABLE", "penalties": [{ "from": "2026-12-07", "amount": 582.00, "basis": "NET", "refundable": false }], "noShow": null },
    "expiresAt": "2026-12-01T10:30:00Z",
    "remarks": [
      "2 rooms, 4 adults and 0 children in total; the price covers all rooms.",
      "Room: CLASSIC DOUBLE ROOM, Room only.",
      "Free cancellation until 2026-12-06. From 2026-12-07 the cancellation penalty is 582.00 (in the quote currency)."
    ]
  },
  "meta": { "requestId": "...", "environment": "sandbox" }
}
  • currency is optional; without it the price is returned in EUR. amount is optional; send the price you showed to compare — priceChanged tells you whether it changed.
  • expiresAt (UTC): the quote is valid for 30 minutes. If you book the same rateKey after this time, POST /v1/bookings returns 409 quote_expired; call the quote again and book before the new expiresAt. Booking without a quote is still allowed; the price is always re-checked at booking (409 price_changed).
  • remarks: notes for the guest built from the rate — room split for multi-room rates, room and board, and a readable cancellation summary. The list can be empty.
  • bookable=false with a reason means the rate cannot be booked through the API (for example hotel_closed_for_agency); it is not an error.
  • An invalid or no longer available rateKey: 400 invalid_rate_key.
POST/v1/tours/search
{ "startDate":"2026-08-08", "endDate":"2026-08-20", "adults":2, "destinationId":1176, "currency":"EUR" }

Response: tourPackageData[] (raw packages) + groupedTours[] (grouped by departure/price — use this one for listings).

Date range: startDate–endDate can span at most 62 days; a wider range returns 400 range_too_wide (run consecutive searches for longer periods).

POST/v1/cruises/search
{ "departureFrom":"2026-08-01", "departureTo":"2026-12-01", "adults":2, "currency":"EUR" }

Response: cruiseData[] — for each sailing the ship, route, dates, cabin types, price, and included/excluded services.

Content & reference

GET/v1/hotels/{id}?provider=...

The hotel's static content (not prices — for prices use hotelIds=[id] in hotels/search). countryCode, destinationCode and chainCode come filled when the hotel has them (null otherwise). The response is enveloped.

GET /v1/hotels/902007480

{
  "data": {
    "hotelId": "902007480",
    "name": "Baia Bodrum Hotel",
    "sourceReferance": "self",
    "city": "GUNDOGAN - BODRUM",
    "country": "TR",
    "cityId": 1330,
    "zoneId": 4414,
    "countryCode": "TR",
    "destinationCode": "BJV",
    "chainCode": "BAIHO",
    "shortDescription": "...",
    "longDescription": "...",
    "photos": [{ "url": "https://...", "category": "GEN", "isMain": true, "orderNo": 0 }],
    "amenities": [{ "code": "HTF-486", "name": "Toplam Oda Sayısı: 215", "category": "Genel Bilgiler", "categoryCode": "HB-10", "hasCharge": false }],
    "email": "baiabodrum@baiahotels.com",
    "website": "https://baiahotels.com/baiabodrum"
  },
  "meta": { "requestId": "...", "environment": "sandbox" }
}

The example is shortened: photos and amenities list every entry in the real response, and empty or null fields (address, latitude, rating, …) are left out. The id here is the same identifier as hotelId in the search result and id in GET /v1/hotels.

GET/v1/destinations?q=...&countryCode=...

Destination lookup for the search parameter. Without q, popular destinations are returned. The response is enveloped (data = destination array).

{
  "data": [
    { "destinationId": 830,  "code": "ABS", "name": "Abu Simbel", "countryCode": "EG" },
    { "destinationId": 3091, "code": "ID9", "name": "Bangka - Belitung", "countryCode": "ID" }
  ],
  "meta": { "requestId": "...", "environment": "sandbox" }
}
GET/v1/destinations/tree?countryCode=...&includeZones=...

The same destinations grouped as country > destination > zone. countryCode (for example TR) limits the result to one country; without it every country is returned. Zones are listed only when includeZones=true; otherwise zones is null. Each zone has zoneId, code, name and parentZoneId. Use destinationId as the search parameter, exactly as with GET /v1/destinations. The response is enveloped.

GET /v1/destinations/tree?countryCode=TR

{
  "data": [
    {
      "countryCode": "TR",
      "name": "Turkey",
      "destinations": [
        { "destinationId": 853,  "code": "ADA", "name": "Adana",   "isPopular": false, "zones": null },
        { "destinationId": 1176, "code": "AYT", "name": "Antalya", "isPopular": true,  "zones": null }
      ]
    }
  ],
  "meta": { "requestId": "...", "environment": "sandbox" }
}

The example is shortened; the real response lists every destination of the country.

GET/v1/hotels/{id}/rooms

The room list of a contracted hotel. code and name match the rooms[] entries of the search result; roomIds are the room identifiers behind each code. The response is enveloped.

{
  "data": [
    { "code": "STANDARD_ROOM",    "name": "STANDARD ROOM",    "roomIds": [811, 844, 845] },
    { "code": "STANDARD_ROOM_BB", "name": "STANDARD ROOM BB", "roomIds": [850] },
    { "code": "STANDARD_ROOM_HB", "name": "STANDARD ROOM HB", "roomIds": [849] }
  ],
  "meta": { "requestId": "...", "environment": "sandbox" }
}

For any other hotel the endpoint answers 404 rooms_unavailable; use rooms[].code/name from the search result there.

{ "error": { "code": "rooms_unavailable", "message": "A room list is available for contracted hotels only. For other hotels use rooms[].code/name in the search result." } }
GET/v1/hotels?page=...&perPage=...&countryCode=...&destinationCode=...

The list of hotels you can sell, one page at a time. page starts at 1; perPage is 1–100 (default 25). countryCode (for example TR) and destinationCode (for example BJV) narrow the list. meta.total is the number of hotels that match. The response is enveloped.

GET /v1/hotels?perPage=5

{
  "data": [
    { "id": 2007474, "name": "Rixos Beldibi", "sourceReferance": "Woxx", "countryCode": "TR",
      "destinationId": 1176, "destinationCode": "AYT", "stars": null, "categoryCode": "5EST", "chainCode": "ACCOR" },
    { "id": 902007480, "name": "Baia Bodrum Hotel", "sourceReferance": "Woxx", "countryCode": "TR",
      "destinationId": 1330, "destinationCode": "BJV", "stars": null, "categoryCode": "5EST", "chainCode": "BAIHO" },
    { "id": 902007485, "name": "Royal Asarlik Beach Hotel", "sourceReferance": "Woxx", "countryCode": "TR",
      "destinationId": 1330, "destinationCode": "BJV", "stars": null, "categoryCode": "5EST", "chainCode": null }
  ],
  "meta": { "requestId": "...", "environment": "sandbox", "page": 1, "perPage": 5, "total": 107522 }
}

The example is shortened to three of the five rows; total is the number of hotels that match at the time of the call. id is the same identifier as hotelId in the search result and the {id} of GET /v1/hotels/{id}. categoryCode comes from GET /v1/categories, chainCode from GET /v1/chains; both are null when unknown.

A perPage outside 1–100 (or page below 1) is rejected:

{ "error": { "code": "invalid_request", "message": "page must be >= 1 and perPage must be between 1 and 100." } }
GET/v1/categories

Hotel category codes with their names — the values of categoryCode in GET /v1/hotels. The whole list comes in one response (65 entries); some entries have an empty name. The response is enveloped.

{
  "data": [
    { "code": "3EST", "name": "3 STARS" },
    { "code": "4EST", "name": "4 STARS" },
    { "code": "5EST", "name": "5 STARS" },
    { "code": "BOU",  "name": "BOUTIQUE" }
  ],
  "meta": { "requestId": "...", "environment": "sandbox" }
}
GET/v1/chains

Hotel chain codes with their names — the values of chainCode in GET /v1/hotels and GET /v1/hotels/{id}. The whole list comes in one response (3153 entries). The response is enveloped.

{
  "data": [
    { "code": "ACCOR", "name": "ACCOR HOTELS" },
    { "code": "ACE",   "name": "ACE HOTELS" }
  ],
  "meta": { "requestId": "...", "environment": "sandbox" }
}
GET/v1/boards

The six standard board codes with their names — the value set of boardCodeStd in the search result. The response is enveloped.

{
  "data": [
    { "code": "RO",  "name": "Room Only" },
    { "code": "BB",  "name": "Bed & Breakfast" },
    { "code": "HB",  "name": "Half Board" },
    { "code": "FB",  "name": "Full Board" },
    { "code": "AI",  "name": "All Inclusive" },
    { "code": "UAI", "name": "Ultra All Inclusive" }
  ],
  "meta": { "requestId": "...", "environment": "sandbox" }
}

boardCode and boardName in a rate are the supplier's own values and differ between suppliers; classify boards with boardCodeStd.

Bookings

POST/v1/bookings

Hotel / tour / cruise booking. The Idempotency-Key header is REQUIRED (prevents double bookings — same key → same response). The agency identity is taken from the token (server-authoritative).

Request headers

Authorization: Bearer <token>
Idempotency-Key: <unique-value-you-generate>
Content-Type: application/json

Required fields (all products)

FieldRequiredNote
Header Authorization: Bearer <token>yesfrom /v1/auth/token
Header Idempotency-Keyyesmissing → 400 idempotency_key_required; the same key returns the same response (kept 14 days)
typeyeshotel | tour | cruise (defaults to hotel)
datayesthe product body (below)
amounthotel and tour: yes (> 0); cruise: nothe selling price from the search result (sellingRate)
currencynoTRY EUR USD GBP. If omitted, the search currency (TRY) is used. Send the same currency you searched in.
clientReferencenoyour own reference

Body — hotel

Required: data.rateKey (or data.rate.rateKey — both accepted), data.checkIn, data.checkOut (yyyy-MM-dd), top-level amount. Optional: adults (default 2), children, childAges ("5,8"), rooms, sourceCountryCode, email, phone, holder {name, surname} (or {firstName, lastName}; if missing it is derived from the passenger list or "Guest 1"), passengers[] (name/firstName, surname/lastName, type AD/CHD, age, birthDate, gender, nationalId).

{
  "type": "hotel",
  "amount": 320.10,
  "currency": "EUR",
  "clientReference": "agency-001",
  "data": {
    "rateKey": "<rateKey from the search result>",
    "checkIn": "2026-12-17",
    "checkOut": "2026-12-20",
    "adults": 2,
    "children": 1,
    "childAges": "5",
    "rooms": 1,
    "holder": { "name": "Ahmet", "surname": "Yilmaz" },
    "passengers": [
      { "name": "Ahmet", "surname": "Yilmaz", "type": "AD" },
      { "name": "Ayse", "surname": "Yilmaz", "type": "AD" },
      { "name": "Can", "surname": "Yilmaz", "type": "CHD", "age": 5 }
    ]
  }
}

Equivalent form: "rate": { "rateKey": "…" } and "holder": { "firstName": "Ahmet", "lastName": "Yilmaz" } give the same result.

Validation order and errors (sandbox and live):

SituationResponse
rateKey missing / cannot be resolved / hotel not found400 invalid_rate_key
checkIn/checkOut missing or malformed400 invalid_request
check-in before today400 date_in_past
check-out on or before check-in400 invalid_dates
unsupported currency400 currency_unsupported
amount differs from the searched price (tolerance: 0.05 or 0.5%, whichever is larger)409 price_changed — the expected amount comes back in the body: error.expectedAmount, error.currency
the same Idempotency-Key is still processing409 in_progress

The price check is made for own-contract hotels (same re-search as the search). For supplier hotels (sourceReferance is not Woxx) booking may be disabled in live (403 external_hotel_booking_unavailable); there sourceReferance, net and currency (or rate.net, rate.currencyCode) are also required.

Body — tour

Required: top-level amount; data.passengers[] (at least 1: firstName, lastName; recommended birthDate, gender, paxType Adult/Child, nationalId or passportNumber, phone, email). For an own-contract tour: data.tourPeriodId (from the result of GET /v1/tours/{tourCode}/periods). For a supplier tour: data.packageCode + data.periodId + data.periodStartDate (the price is calculated on the server). Optional: provider (default WTatil), holder {firstName|name, lastName|surname, email, phone}, tourPackageId, tourCode, tourName, periodStartDate, periodEndDate, pricePerPerson, currencyCode, departurePoint, notes. For a child, age or birthDate is required (otherwise 400 child_age_required).

{
  "type": "tour",
  "amount": 5517.79,
  "currency": "TRY",
  "data": {
    "provider": "WTatil",
    "tourPeriodId": 123456,
    "holder": { "firstName": "Ahmet", "lastName": "Yilmaz", "email": "ahmet@example.com", "phone": "+905320000000" },
    "passengers": [
      { "firstName": "Ahmet", "lastName": "Yilmaz", "birthDate": "1985-04-12", "gender": "M", "paxType": "Adult", "nationalId": "10000000146" }
    ]
  }
}

Supplier tour body: "data": { "packageCode": "<packageCode from the search>", "periodId": 1040851, "periodStartDate": "2026-12-18", "holder": {…}, "passengers": [ … ] }. If something is missing: 400 invalid_request. A departure in the past: 400 date_in_past.

Body — cruise (priced by the server; amount not needed)

Required: data.sailingId + data.cabinId (or data.rateKey in the form CRZ|<sailingId>|<cabinId>|<adults>|<childAges>), data.guestName. Optional: adults (default 2), childAges (number array [5,8]), email, phone.

{
  "type": "cruise",
  "data": {
    "sailingId": 1001,
    "cabinId": 2002,
    "adults": 2,
    "guestName": "Ahmet Yilmaz",
    "email": "ahmet@example.com",
    "phone": "+905320000000"
  }
}

If something is missing: 400 invalid_request. A sailing in the past: 400 date_in_past. If the price cannot be obtained, sandbox returns 400 quote_failed.

Response 200: the successful booking result. The reference for GET /v1/bookings/{reference} is taken from this response. Besides the reference it states the outcome of the booking:

FieldMeaning
statusconfirmed (booking is confirmed) | on_request (accepted, waiting for confirmation) | failed
totalPricetotal amount of the booking
currencycurrency of totalPrice
{
  "success": true,
  "sandbox": true,
  "productType": "hotel",
  "bookingRef": "SBX-F5F7BA4C004F",
  "reservationCode": "SBX-F5F7BA4C004F",
  "authCode": "SANDBOX",
  "isUat": true,
  "note": "Sandbox booking: not a real reservation. Query it with GET /v1/bookings/{ref} and cancel it with POST /v1/bookings/{ref}/cancel (kept for the idempotency retention period).",
  "status": "confirmed",
  "totalPrice": 1012.0,
  "currency": "EUR"
}
GET/v1/bookings?createdFrom=...&createdTo=...&checkInFrom=...&checkInTo=...&page=1&perPage=25

The list of your agency's bookings, newest first. All filters are optional: createdFrom/createdTo filter by creation date, checkInFrom/checkInTo by check-in date. Paging: page starts at 1 (default 1); perPage is between 1 and 100 (default 25). Values outside these limits return 400 invalid_request. The response is enveloped; meta adds page, perPage and total.

GET /v1/bookings?perPage=2

{
  "data": [
    {
      "reference": "SBX-F5F7BA4C004F",
      "productType": "hotel",
      "bookingStatus": "Cancelled",
      "totalPrice": 1012.0,
      "currency": "EUR",
      "created": "2026-11-19T19:19:58.562Z",
      "checkIn": null,
      "checkOut": null,
      "cancelledAt": "2026-11-19T19:19:59.353Z",
      "cancellationPenalty": 0.0
    },
    {
      "reference": "SBX-70293982EBCC",
      "productType": "hotel",
      "bookingStatus": "Confirmed",
      "totalPrice": 291.0,
      "currency": "EUR",
      "created": "2026-11-17T11:15:49.943Z",
      "checkIn": null,
      "checkOut": null,
      "cancelledAt": null,
      "cancellationPenalty": null
    }
  ],
  "meta": { "requestId": "...", "environment": "sandbox", "page": 1, "perPage": 2, "total": 6 }
}
GET /v1/bookings?perPage=500

400
{ "error": { "code": "invalid_request", "message": "page must be >= 1 and perPage must be between 1 and 100." } }

cancelledAt and cancellationPenalty are filled only for cancelled bookings; otherwise they are null.

GET/v1/bookings/{reference}

Booking status. You only see your own bookings (someone else's → 404). For a cancelled booking the response also carries cancelledAt and cancellationPenalty (the penalty amount, 0.0 when the cancellation was free).

{
  "reference": "...", "clientReference": "PARTNER-REF-123", "bookingStatus": "...",
  "reservationId": 12345, "guestName": "Ahmet Yılmaz",
  "checkinDate": "2026-08-08", "checkoutDate": "2026-08-12",
  "totalPrice": 24036.77, "currency": "TRY"
}
POST/v1/bookings/{reference}/cancel

Cancels a booking. The status field of the response tells which way it went:

statusMeaning
cancelledCancelled immediately (contracted hotel, tour, cruise). The response states the penalty charged, the refund and the currency.
cancellation_requestedA cancellation request was opened (hotels from external suppliers). Cancellation and refund are processed by Resvisor; follow the outcome with GET /v1/bookings/{reference} or through webhooks.
// request
{ "reason": "customer request", "description": "..." }
// response 200 (sandbox booking, cancelled immediately)
{
  "reference": "SBX-F5F7BA4C004F",
  "status": "cancelled",
  "sandbox": true,
  "alreadyCancelled": false,
  "penalty": 0.0,
  "refund": 1012.0,
  "currency": "EUR",
  "note": "Sandbox booking cancelled. No real reservation or ledger entry was affected."
}

Identity — /v1/me

GET/v1/me

Returns who the token belongs to (a handy "whoami" for verifying your integration).

{
  "data": { "agencyId": "5", "environment": "sandbox", "apiKeyId": "1", "role": "ACENTE_CALISANI" },
  "meta": { "requestId": "0HN...:00000001", "environment": "sandbox" }
}

Sandbox & Live environments

TopicSandbox activeLive approval required
PurposeIntegration testingReal sales
SearchReturns real resultsReturns real results
BookingMock — no real record is created, an SBX-... reference is returnedReal booking (with the current-account/credit balance)
Daily quota200 (default)5000 (default)
Sandbox bookings create no real record. A sandbox key (pk_sb_…) makes no real reservation, no current-account movement and no provider call; the response carries an SBX-... reference. You can test it with GET /v1/bookings/{ref} and POST /v1/bookings/{ref}/cancel — both are supported. The sandbox also validates the request the same way live does: invalid_rate_key, date_in_past, invalid_dates, currency_unsupported and price_changed are returned identically, so you can test your error handling there. The same body with a live key (pk_live_…) makes a real booking.
Live keys require approval. A live key is activated by Resvisor after your sandbox integration has been checked. Live bookings are not paid by card: the amount is debited to the agency's current-account/credit balance (sale within limit → debit to the account). A booking attempt with a key for which live booking is not enabled returns 403 live_booking_unavailable. Search works in both environments.

Idempotency

The Idempotency-Key header is required on bookings. Behavior:

  • The same key is sent again + the first request completed → the first response is returned unchanged (a new booking is not created).
  • The first request is still processing (<15 min) → 409 in_progress.
  • The first attempt failed → you can safely retry with the same key.
Generate a unique key for every new booking (e.g. your own order number). After a network error, retry with the same key — there is no double charge.

Rate limit & quota

  • Per-minute burst: 60 requests/min (default). When exceeded: 429 rate_limited + Retry-After header.
  • Daily quota: sandbox 200 / live 5000 (default). When exceeded: 403 quota_exceeded.
  • Token creation: 20 attempts/min per key (brute-force protection).

Limits can be tuned per key — contact support@resvisor.com if you need that.

IP allow-list (optional hardening)

For security, your key can be restricted to specific IPs. If a list is defined, a request from any other IP gets 403 ip_not_allowed. If the list is empty, there is no restriction.

If you have a static IP, tell support@resvisor.com and support registers it on your key. If you connect over IPv6, a /64 block is recommended instead of a single address (IPv6 address bits can change).

Webhooks

You can learn about booking status changes (especially asynchronous cancellation/refund) through a signed push notification instead of polling. You register an endpoint URL; when an event occurs, Resvisor sends a signed POST to it.

  • Signature: every delivery carries X-Travapi-Signature (HMAC-SHA256) — verify the body with the shared secret.
  • Retry: failed deliveries are retried automatically (idempotent — the same event may arrive more than once, deduplicate by event id).

Delivery format

Each delivery is a POST; the headers are X-Travapi-Signature: t=<unix>,v1=<hex>, X-Travapi-Event (event type) and X-Travapi-Delivery (delivery number). The body is a common envelope:

{
  "id": "evt_…",                 // event id — use it for deduplication
  "type": "booking.cancelled",
  "createdAt": "2026-10-19T08:40:12Z",
  "environment": "live",          // or "sandbox"
  "agencyId": 16,
  "data": { … }                   // fields below, depending on the event
}

Event types

When registering an endpoint you choose the events to subscribe to (* = all).

EventWhendata fields
booking.cancelledA booking cancelled instantly (contracted hotel, tour, cruise) — from the panel or the APIbookingReference · penalty · refund · currency · occurredAt
booking.cancellation_requestedA cancellation request that needs approval was openedbookingReference · cancellationReference · status · reason · refundReference · occurredAt
booking.cancellation_approvedThe cancellation request was approved
booking.cancellation_rejectedThe cancellation request was rejected
booking.refund_completedThe refund was completed
booking.option_expiring48 and 24 hours before the payment deadline of an option bookingbookingReference · hoursLeft (48 / 24) · optionDeadline · occurredAt
booking.option_expiredThe option lapsed because payment did not arrive, the booking was cancelled automaticallybookingReference · optionDeadline · occurredAt
announcement.createdA new announcement addressed to you was publishedannouncementId · title · publishedAt · occurredAt

Dates are in UTC and ISO 8601 format. The same events also appear in the notification bell in your panel.

Contact support@resvisor.com for webhook access.

Error codes

HTTPcodeMeaning
400invalid_request · unsupported_type · idempotency_key_required · invalid_rate_key · invalid_dates · date_in_past · currency_unsupportedMalformed / missing request
401invalid_key · invalid_secret · key_revoked · key_suspended · invalid_token · no_agencyIdentity
403forbidden_scope · live_booking_unavailable · quota_exceeded · ip_not_allowedPermission / quota / IP
404not_found · snapshot_not_found · sandbox_ephemeralNot found / out of scope
409in_progress · cancellation_already_requested · price_changed · quote_expiredIdempotency / concurrency / the price changed (the expected amount is in error.expectedAmount) / the hotel quote expired (call POST /v1/hotels/quote again)
429rate_limited (+Retry-After)Per-minute burst / token brute-force
502gateway_error · booking_error · content_errorUpstream system unreachable

Tips & best practices

  • Reuse the token (don't get a new token for every request); renew it before expires_in runs out.
  • Always read response.data (READ endpoints) — the outer envelope is stable even if the inner schema changes.
  • Don't call products outside your scopes → 403 forbidden_scope.
  • Test end to end in sandbox first; a live key is only issued for an approved integration.
  • Carry the rateKey unchanged — the booking snapshot relies on this anchor.
  • If you get a 429, respect the Retry-After header and back off (exponential backoff).