Locktrip
Voltar para AI Agents

Documentação da API

Referência completa para a API MCP de Reservas de Hotéis LockTrip. 15 ferramentas cobrindo busca, reserva, pagamento e gerenciamento.

Integrating a backend service? The same product is available as a native GraphQL API with credit line billing for B2B partners. See the GraphQL B2B docs →

Autenticação

A API usa tokens JWT Bearer. Ferramentas de busca e navegação não requerem autenticação. Ferramentas de reserva e gerenciamento requerem um token válido.

Obtendo um Token

Use guest_login (apenas e-mail, instantâneo) ou login (e-mail + senha) para obter um token JWT.

Usando o Token

Authorization: Bearer eyJhbGciOiJIUzUxMiJ9...

OAuth 2.1 (clientes MCP)

Os clientes MCP (por exemplo Claude, ChatGPT) autenticam-se automaticamente via OAuth 2.1 com PKCE — você não precisa configurar nada. Em um 401, o cliente descobre o servidor em https://locktrip.com/.well-known/oauth-authorization-server, registra-se dinamicamente (POST /register) e então executa o fluxo de authorization code: /authorize (consentimento do usuário, protegido pelo Cloudflare Turnstile) → /token. Scopes: "mcp" (mais "offline_access" para um refresh token). Para integração direta via REST/curl, use um Bearer token manual (veja acima).

Per-call auth: sessionToken

Para chamadas REST ou JSON-RPC diretas, as ferramentas autenticadas também aceitam um argumento sessionToken como alternativa ao cabeçalho Authorization. Um token de guest_login (apenas e-mail — sem senha, instantâneo) cria uma sessão de CONVIDADO, e uma sessão de CONVIDADO funciona APENAS com prepare_booking e create_checkout. get_payment_url, list_bookings, get_booking_details, cancel_booking e confirm_booking exigem todas uma conta registrada: obtenha esse token com login (e-mail + senha). Um parceiro B2B com linha de crédito deve autenticar-se com login, nunca com guest_login: uma sessão de convidado não tem linha de crédito, então confirm_booking a rejeita. Se uma chamada retornar AUTH_INSUFFICIENT_ROLE (HTTP 403), o token é válido e o que está errado é o papel — mude para login em vez de solicitar outro token de guest_login.

Classificação das Ferramentas

Pública (sem autenticação)Autenticada (token Bearer)
search_location, hotel_search,
get_search_results, get_hotel_rooms,
get_hotel_details,
check_cancellation_policy,
login, guest_login
prepare_booking, confirm_booking,
create_checkout, get_payment_url,
list_bookings, get_booking_details,
cancel_booking

URL Base e Transportes

Todos os endpoints são servidos a partir de https://locktrip.com/mcp/. Três modos de transporte são suportados:

TransporteMétodoEndpoint
RESTPOSThttps://locktrip.com/mcp/tools/{tool_name}
MCP Streamable HTTPPOSThttps://locktrip.com/mcp/rpc
MCP Streamable HTTP (alias)POSThttps://locktrip.com/mcp/sse

Endpoints de Descoberta

URLDescrição
GET /mcp/openapi.jsonEspecificação OpenAPI 3.1
GET /mcp/toolsListar todas as ferramentas com schemas
GET /mcp/discoveryDocumento de descoberta MCP

Content-Type: application/json para todas as requisições POST.

Tratamento de Erros

Erros REST

StatusSignificado
200Sucesso
400Erro de validação (entrada inválida)
401Token Bearer ausente ou inválido
403Autenticado, mas esta sessão não tem o papel necessário: use login, não guest_login
404Nome de ferramenta desconhecido
429Limite de taxa excedido

The error envelope — read recoverable, not the message

Every classified error carries the same envelope. mcpCode is the stable machine-readable class — branch on it, never on the message text. recoverable is behavioural guidance and the field an autonomous agent should act on: true means the caller can fix the request and retry (bad input, expired search session, rate limit); false means retrying the same call is futile — change something first. A recoverable: false with AUTH_INSUFFICIENT_ROLE specifically means your token is valid but its role is wrong: switch to login, and do NOT fetch another guest_login token.

// REST — the HTTP status carries the class, and the body repeats it
HTTP 403
{
  "error": {
    "code": -32009,
    "message": "This tool requires a registered account. ...",
    "data": { "mcpCode": "AUTH_INSUFFICIENT_ROLE", "recoverable": false, "details": { ... } }
  }
}

Transports differ, deliberately. On /mcp/tools/* (REST) a failure returns a real HTTP status — 400, 401, 403, 404, 409, 429, 500, 502. On /mcp/rpc and /mcp/sse a failure returns HTTP 200 with the error inside the JSON-RPC body, as the JSON-RPC spec requires. If you put a circuit breaker or retry policy on HTTP status alone, it will see the RPC transport as permanently healthy — branch on data.mcpCode and data.recoverable instead.

Erros JSON-RPC

{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": -32001,
    "message": "Authentication required for this tool.",
    "data": {
      "loginUrl": "https://users.locktrip.com/api/auth/login",
      "signupTool": "guest_login"
    }
  }
}
CódigoSignificado
-32700JSON malformado — não foi possível analisar o corpo da requisição
-32600Requisição JSON-RPC inválida
-32601Ferramenta desconhecida / método não encontrado
-32001Autenticação necessária ou token inválido
-32009Autenticado, mas esta sessão não tem o papel necessário: use login, não guest_login
-32007Limite de taxa excedido
-32603Erro interno do servidor

Limites de Taxa

Limites de taxa por janela deslizante por IP (anônimo) ou por ID de usuário (autenticado). Exceder os limites retorna HTTP 429 ou código de erro JSON-RPC -32007.

FerramentaAnônimoAutenticado
hotel_search5/ minuto20/ minuto
Todas as outras ferramentas30/ minuto120/ minuto

Referência de Ferramentas

15 ferramentas listadas na ordem de fluxo de trabalho recomendada.

search_location

Pública

Busque localizações (cidades, regiões, hotéis) para obter seus IDs para busca de hotéis. Retorna localizações correspondentes com tipo e nome completo.

Requisição

CampoTipoObrig.Descrição
querystringYesSearch query (city name, region, or hotel name)
languagestringNoLanguage code (default: "en")

Resposta

CampoTipoDescrição
locationsLocation[]Array of matching locations
locations[].idstringLocation ID (use as regionId in hotel_search)
locations[].namestringLocation name
locations[].typestringLocation type (e.g., "CITY")
locations[].fullNamestringFull location name with country
locations[].countrystringCountry name
totalCountnumberTotal number of matches returned

Exemplo

curl -X POST https://locktrip.com/mcp/tools/search_location \
  -H "Content-Type: application/json" \
  -d '{"query": "Paris"}'

# Response (200 OK):
{
  "locations": [
    {
      "id": "5f078e431fd614748f9037f9",
      "name": "Paris, France",
      "country": "",
      "type": "CITY",
      "fullName": "Paris, France"
    },
    {
      "id": "5f080b92b8f3040a9045c3e8",
      "name": "Disneyland Paris, Boulevard de Parc, Coupvray, France",
      "country": "",
      "type": "CITY",
      "fullName": "Disneyland Paris, Boulevard de Parc, Coupvray, France"
    }
  ],
  "totalCount": 10
}

get_search_results

Pública

Obtenha resultados paginados de busca de hotéis. Consulte até que searchStatus seja "COMPLETED". Suporta filtragem por preço, estrelas, comodidades e tipos de refeição. Ordenação por preço, avaliação ou distância.

Inteligência de Preços

Cada resultado de hotel inclui discountScore — a pontuação proprietária de machine learning da LockTrip que calcula quanto mais barata é a oferta em comparação com outros sites de viagem. O modelo ML V8 analisa dados de preços em tempo real de múltiplos fornecedores de hotéis para prever economias. Use minPrice (preço da LockTrip) e originalPrice (último melhor preço em sites concorrentes) junto com discountScore para destacar as melhores ofertas aos usuários.

Requisição

CampoTipoObrig.Descrição
searchKeystringYesSearch key from hotel_search
pagenumberNoPage number, 0-indexed (default: 0)
sizenumberNoResults per page (default: 100, max: 5000)
currencystringNoCurrency code from hotel_search
sortBystringNoPRICE_ASC, PRICE_DESC, RATING_DESC, or DISTANCE
filtersobjectNoOptional filters (see below)
filters.minPricenumberNoMinimum price
filters.maxPricenumberNoMaximum price
filters.starRatingsnumber[]NoStar ratings to include (1-5)
filters.amenitiesstring[]NoRequired amenities
filters.mealTypesstring[]NoRequired meal types
filters.hotelNamestringNoHotel name search

Resposta

CampoTipoDescrição
hotelsHotel[]Array of matching hotels
hotels[].hotelIdstringHotel ID (use in get_hotel_rooms, get_hotel_details)
hotels[].namestringHotel name
hotels[].starRatingnumberStar rating (1-5)
hotels[].addressstringStreet address
hotels[].latitudenumberLatitude coordinate
hotels[].longitudenumberLongitude coordinate
hotels[].imagesstring[]Hotel image URLs
hotels[].amenitiesstring[]Available amenities
hotels[].minPricenumberLockTrip's price for this hotel (lowest available rate)
hotels[].originalPricenumberLast best price found on competing travel websites (e.g. Booking.com, Expedia). When equal to minPrice, no discount was detected.
hotels[].currencystringPrice currency code
hotels[].discountScorenumberLockTrip's proprietary machine learning score indicating how much cheaper this offer is compared to other travel websites. Powered by a V8 ML model that analyzes real-time pricing data from multiple hotel suppliers. Higher = bigger savings. 0 means no significant discount was detected. RELATIVE, WITH NO FIXED UPPER BOUND — the model output is not clamped. Across millions of live results we observed a range of roughly 0 to 60, with about one result in ten above 10. Rank and compare results against each other; do NOT normalise against a constant maximum.
hotels[].qualitynumberInternal ranking scalar (the default sort key) derived from discountScore, distance and review score. RELATIVE, WITH NO FIXED UPPER BOUND and no absolute meaning — over the same data we observed roughly 0 to 23, with under a third above 1. 0 means the hotel has no discount score or no qualifying reviews. Use it to order results; do not display it as a rating or normalise it against a constant.
hotels[].reviewScorenumberGuest review score (0-10). This is the one to show a user.
hotels[].reviewCountnumber|nullNumber of guest reviews
hotels[].hasFreeCancellationbooleanWhether any room has free cancellation
hotels[].isRefundablebooleanWhether any room is refundable
hotels[].refundableUntilstring|nullISO date until which free cancellation is available
hotels[].paymentstringPayment type (e.g., "Cash")
hotels[].distancenumberDistance from search center (km)
hotels[].boardTypestring|nullDefault board type
hotels[].availableMealTypesstring[]Available meal types
totalCountnumberTotal hotels matching search
pagenumberCurrent page number, 0-indexed — the SAME indexing as the request. Request page 0 and this echoes 0. To walk pages, request page + 1.
pageSizenumberResults per page
hasMorebooleanWhether more pages are available
searchStatusstring"IN_PROGRESS" or "COMPLETED"

Exemplo

curl -X POST https://locktrip.com/mcp/tools/get_search_results \
  -H "Content-Type: application/json" \
  -d '{
    "searchKey": "47de06e3262ea3822bdc384a04470783",
    "page": 0,
    "size": 2
  }'

# Response (200 OK):
{
  "hotels": [
    {
      "hotelId": "4703420",
      "name": "Premiere Classe Boissy Saint Leger",
      "starRating": 1,
      "address": "P.A De La Haie Griselle 4 Rue Pompadour, Boissy-Saint-Leger",
      "latitude": 48.759967,
      "longitude": 2.501443,
      "images": [
        "https://imagecontent.net/images/full/5a0d94a0-5f7e-4e4e-b457-5e0673a96a95.jpeg"
      ],
      "amenities": ["Family rooms", "Free Wifi", "Parking", "Air conditioning"],
      "minPrice": 71.51,
      "originalPrice": 71.51,
      "currency": "EUR",
      "discountScore": 0,
      "quality": 0.19,
      "reviewScore": 2.5,
      "reviewCount": null,
      "hasFreeCancellation": false,
      "isRefundable": false,
      "refundableUntil": null,
      "payment": "Cash",
      "distance": 15.32,
      "boardType": null,
      "availableMealTypes": []
    }
  ],
  "totalCount": 2403,
  "page": 0,
  "pageSize": 2,
  "hasMore": true,
  "searchStatus": "COMPLETED"
}

get_hotel_rooms

Pública

Obtenha pacotes de quartos disponíveis para um hotel específico. Retorna quoteIds necessários para reserva. Cada pacote inclui preço, tipo de refeição, comodidades e informações de cancelamento.

Requisição

CampoTipoObrig.Descrição
hotelIdstringYesHotel ID from search results
searchKeystringYesSearch key from hotel_search
startDatestringYesCheck-in date (YYYY-MM-DD). MUST be in the future — a past date is rejected with "Check-in date cannot be in the past". The dates in the examples are illustrative; substitute your own future window.
endDatestringYesCheck-out date (YYYY-MM-DD)
roomsRoom[]YesRoom occupancy (same as hotel_search)
nationalitystringYes2-letter country code
regionIdstringYesRegion ID from search_location
currencystringNoCurrency code (default: "USD")

Resposta

CampoTipoDescrição
hotelIdstringHotel ID
hotelNamestringHotel name
checkInstringCheck-in date (YYYY-MM-DD)
checkOutstringCheck-out date (YYYY-MM-DD)
packagesPackage[]Available room packages
packages[].quoteIdstringQuote ID (use in prepare_booking)
packages[].packageIdstringPackage identifier
packages[].roomNamestringRoom type name (e.g., "Standard, 3 Beds")
packages[].roomDescriptionstringHTML description of room features
packages[].mealTypestring"Room Only", "Breakfast Included", etc.
packages[].mealDescriptionstringMeal plan description
packages[].maxOccupancynumberMaximum guests per room
packages[].amenitiesstring[]Room amenities list
packages[].pricenumberTotal price for all nights
packages[].currencystringPrice currency
packages[].pricePerNightnumberPrice per night
packages[].totalNightsnumberNumber of nights
packages[].isRefundablebooleanWhether room is refundable

Exemplo

curl -X POST https://locktrip.com/mcp/tools/get_hotel_rooms \
  -H "Content-Type: application/json" \
  -d '{"hotelId":"4384127","searchKey":"47de06e3262ea3822bdc384a04470783","startDate":"2027-04-15","endDate":"2027-04-17","rooms":[{"adults":2}],"nationality":"US","regionId":"5f078e431fd614748f9037f9","currency":"EUR"}'

# Response (200 OK):
{
  "hotelId": "4384127",
  "hotelName": "",
  "checkIn": "2027-04-15",
  "checkOut": "2027-04-17",
  "packages": [
    {
      "quoteId": "3e242771-1c15-4356-9a3b-1cd4bfc6d9fc_4384127",
      "packageId": "3e242771-1c15-4356-9a3b-1cd4bfc6d9fc_4384127",
      "roomName": "Standard, 3 Beds",
      "mealType": "Room Only",
      "price": 71.34,
      "currency": "EUR",
      "pricePerNight": 35.67,
      "totalNights": 2,
      "isRefundable": false
    }
  ]
}

get_hotel_details

Pública

Obtenha informações detalhadas do hotel, incluindo descrição, comodidades, avaliações, fotos e localização. Use após a busca para obter informações completas do hotel antes de reservar.

Requisição

CampoTipoObrig.Descrição
hotelIdnumberYesHotel ID (numeric, from search results)
languagestringNoLanguage code (default: "en")
includeImagesbooleanNoFetch additional images (default: false)
imageLimitnumberNoMax additional images (default: 20, max: 100)

Resposta

CampoTipoDescrição
hotelobjectHotel details object
hotel.idnumberHotel ID
hotel.namestringHotel name
hotel.countrystringCountry
hotel.citystringCity
hotel.starnumberStar rating (1-5)
hotel.addressstringStreet address
hotel.latitudenumberLatitude
hotel.longitudenumberLongitude
hotel.descriptionstringHTML description with sections
hotel.phonestring|nullPhone number
hotel.hotelPhotosPhoto[]Photo URLs (relative paths)
hotel.reviewsobjectReview summary with score, count, keywords
hotel.hotelAmenitiesCategory[]Amenities grouped by category
additionalImagesPhoto[]Extra images (if includeImages=true)

Exemplo

curl -X POST https://locktrip.com/mcp/tools/get_hotel_details \
  -H "Content-Type: application/json" \
  -d '{"hotelId": 4384127}'

# Response (200 OK):
{
  "hotel": {
    "id": 4384127,
    "name": "Premiere Classe Plaisir",
    "country": "France",
    "city": "Plaisir",
    "star": 1,
    "address": "Za De Sainte Apolline Rue Des Poiriers",
    "description": "<h2>Hotel Details</h2><p>Property Location...</p>",
    "hotelPhotos": [{"url": "/gmx/full/d174a039-ebf9-4e42-8b42-5e31a6950b0e.jpeg"}],
    "reviews": {"scoreSummary": 0, "reviewsCount": 0, "keyWords": []},
    "hotelAmenities": [{"categoryName": "Hotel Facilities & Services", "features": [{"name": "Free Wifi"}]}]
  }
}

check_cancellation_policy

Pública

Obtenha a política de cancelamento detalhada para pacotes de quartos. Mostra prazo de cancelamento gratuito e taxas de penalidade por faixa de datas.

Requisição

CampoTipoObrig.Descrição
searchKeystringYesSearch key from hotel_search
hotelIdstringYesHotel ID
packageIdsstring[]YesPackage UUIDs, WITHOUT the _hotelId suffix — take the quoteId from get_hotel_rooms and truncate it: quoteId.split('_')[0]. Passing the full quoteId here fails with a misleading SESSION_EXPIRED even on a live session, because the policy lookup matches the bare UUID.

Resposta

CampoTipoDescrição
hotelIdstringHotel ID
policiesPolicy[]Cancellation policy per package
policies[].packageIdstringPackage identifier
policies[].isRefundablebooleanWhether package is refundable
policies[].freeCancellationUntilstring|nullLast date for free cancellation (YYYY-MM-DD)
policies[].feesFee[]Cancellation penalty fees
policies[].fees[].fromDatestringPenalty period start (YYYY-MM-DD)
policies[].fees[].toDatestring|nullPenalty period end
policies[].fees[].amountnumberPenalty amount
policies[].fees[].currencystring|absentThe supplier's own currency for this penalty. OMITTED, never guessed, when the supplier states none — treat an absent currency as unpriced rather than assuming your search currency. (Before 2026-08 this field was hardcoded to USD and was wrong for every non-USD search.)
policies[].fees[].percentagenumber|nullPercentage of booking price
policies[].remarksstring[]|nullAdditional policy notes

Exemplo

curl -X POST https://locktrip.com/mcp/tools/check_cancellation_policy \
  -H "Content-Type: application/json" \
  -d '{"searchKey":"47de06e3262ea3822bdc384a04470783","hotelId":"4384127","packageIds":["e3fca710-0a05-4b96-a472-a93c941a58fc"]}'

# NOTE the packageId has NO _4384127 suffix. Passing the full quoteId here returns
# 409 SESSION_EXPIRED even on a live session.

# Response (200 OK):
{
  "hotelId": "4384127",
  "policies": [{
    "packageId": "e3fca710-0a05-4b96-a472-a93c941a58fc_4384127",
    "isRefundable": true,
    "freeCancellationUntil": "2027-04-13",
    "fees": [{"fromDate":"2027-04-13","toDate":"2027-04-15","amount":77.53,"currency":"EUR","percentage":100}],
    "remarks": ["Room: Standard, 3 Beds", "Board: Room Only"]
  }]
}

guest_login

Pública

Registre-se ou faça login como convidado apenas com um endereço de e-mail. Retorna um token Bearer para ferramentas autenticadas. TODA chamada envia um e-mail de verificação para esse endereço, inclusive para uma conta que já existe: solicite o token uma vez e reutilize-o. O resultado é uma sessão de CONVIDADO.

Requisição

CampoTipoObrig.Descrição
emailstringYesUser email address

Resposta

CampoTipoDescrição
tokenstringJWT Bearer token for authenticated API calls
userIdnumberNumeric user ID
emailstringUser email address
isNewUserbooleanWhether a new account was created

Exemplo

curl -X POST https://locktrip.com/mcp/tools/guest_login \
  -H "Content-Type: application/json" \
  -d '{"email": "[email protected]"}'

# Response (200 OK):
{"token":"eyJhbGciOiJIUzUxMiJ9...","userId":413900,"email":"[email protected]","isNewUser":true}

login

Pública

Faça login com e-mail e senha para obter um token Bearer. Para usuários registrados com contas confirmadas.

Requisição

CampoTipoObrig.Descrição
emailstringYesUser email address
passwordstringYesUser password

Resposta

CampoTipoDescrição
tokenstringJWT Bearer token for authenticated API calls
userIdnumberNumeric user ID
emailstringUser email address

Exemplo

curl -X POST https://locktrip.com/mcp/tools/login \
  -H "Content-Type: application/json" \
  -d '{"email":"[email protected]","password":"yourpassword"}'

# Response (200 OK):
{"token":"eyJhbGciOiJIUzUxMiJ9...","userId":12345,"email":"[email protected]"}

prepare_booking

Autenticação Obrigatória

Crie uma reserva com dados do hóspede. Retorna um preparedBookingId para confirmação. Uma reserva preparada não tem prazo fixo de expiração; o que expira é a sessão de busca ligada ao seu quoteId. O número de hóspedes por quarto deve corresponder ao número de adultos da busca.

Requisição

CampoTipoObrig.Descrição
quoteIdstringYesQuote ID from get_hotel_rooms
searchKeystringYesSearch key from hotel_search — the SAME one used for get_hotel_rooms. REQUIRED: omitting it returns 400 VALIDATION_ERROR naming searchKey as the failing path. It warms the cancellation-policy cache the backend needs in order to book.
roomsRoom[]YesGuest assignments per room
rooms[].roomIndexnumberYesRoom index (0-based)
rooms[].guestsGuest[]YesAdult guests in this room
rooms[].guests[].firstNamestringYesFirst name
rooms[].guests[].lastNamestringYesLast name
rooms[].guests[].titlestringNo"Mr", "Mrs", or "Ms" (default: "Mr")
rooms[].guests[].emailstringNoEmail address
rooms[].guests[].phonestringNoPhone number
rooms[].guests[].isLeadGuestbooleanNoWhether this is the lead guest
rooms[].childrenChild[]NoChildren in this room
rooms[].children[].firstNamestringYesFirst name
rooms[].children[].lastNamestringYesLast name
rooms[].children[].agenumberYesChild age (0-17)
contactPersonobjectYesContact person details
contactPerson.firstNamestringYesFirst name
contactPerson.lastNamestringYesLast name
contactPerson.emailstringYesEmail address
contactPerson.phonestringYesPhone number (min 5 chars)
contactPerson.titlestringNo"Mr", "Mrs", or "Ms"
contactPerson.countryCodestringNo2-letter country code
specialRequestsstringNoSpecial requests for the hotel

Resposta

CampoTipoDescrição
preparedBookingIdstringBooking ID for confirm_booking
bookingInternalIdstringInternal booking identifier
pricenumberTotal price
currencystringPrice currency
paymentstringPayment type (e.g., "Cash")
discountobjectDiscount details (amount, currency)
taxesTax[]Itemized taxes and fees
essentialInformationstring[]Check-in instructions, mandatory fees, policies

Exemplo

curl -X POST https://locktrip.com/mcp/tools/prepare_booking \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eyJhbGciOiJIUzUxMiJ9..." \
  -d '{"quoteId":"3e242771-1c15-4356-9a3b-1cd4bfc6d9fc_4384127","searchKey":"47de06e3262ea3822bdc384a04470783","rooms":[{"roomIndex":0,"guests":[{"firstName":"John","lastName":"Smith","title":"Mr","email":"[email protected]","phone":"+1234567890","isLeadGuest":true}]}],"contactPerson":{"firstName":"John","lastName":"Smith","email":"[email protected]","phone":"+1234567890"}}'

# Response (200 OK):
{"preparedBookingId":"69a2b7540a93415a4b4dbf13","price":71.34,"currency":"EUR","payment":"Cash","discount":{"amount":0,"currency":"EUR"},"taxes":[{"feeTitle":"Taxes and Fees","value":"1.59","currency":"EUR","isIncludedInPrice":true}],"essentialInformation":["CheckIn instructions: ..."]}

confirm_booking

Autenticação Obrigatória

Confirme e pague uma reserva preparada usando linha de crédito B2B. Retorna confirmação da reserva com URL do voucher. Para pagamentos de consumidores, use create_checkout ou get_payment_url.

Requisição

CampoTipoObrig.Descrição
bookingInternalIdstringYesBooking ID from prepare_booking (preparedBookingId)
quoteIdstringYesQuote ID used in prepare_booking
paymentMethodstringNoPayment method (default: "CREDIT_LINE" for B2B)

Resposta

CampoTipoDescrição
acceptedbooleanWhether booking confirmation was accepted
messagestring|nullConfirmation status message
voucherUrlstring|nullURL to booking voucher (if accepted)
serviceUnavailableboolean|absentPresent, and always true, ONLY when our credit service did not answer. Otherwise the key is OMITTED - test for PRESENCE, never for false (=== false never matches). Its absence is meaningful: the service answered, so accepted:false is a real refusal. See the warning below.

Exemplo

curl -X POST https://locktrip.com/mcp/tools/confirm_booking \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eyJhbGciOiJIUzUxMiJ9..." \
  -d '{"bookingInternalId":"69a2b7540a93415a4b4dbf13","quoteId":"3e242771-1c15-4356-9a3b-1cd4bfc6d9fc_4384127"}'

# Response (200 OK):
{"accepted":true,"message":"Booking confirmed successfully","voucherUrl":"https://locktrip.com/booking/hotel/voucher/69a2b7540a93415a4b4dbf13"}

A credit-line refusal is not an error. If your line has insufficient balance, this tool returns HTTP 200 with accepted: false and the reason in message — it does not raise an error code. Branch on accepted, not on the HTTP status.

Treat serviceUnavailable: true differently from a refusal. It means our credit service did not answer, so we cannot tell you whether the reservation was applied. It may already be held against your line. Do not blindly retry — the reserve call is not idempotent and a retry can reserve the amount twice. Re-check the booking with get_booking_details before any second attempt.

create_checkout

Autenticação Obrigatória

Crie um URL de checkout Revolut para uma reserva preparada. Retorna um link de checkout hospedado para o usuário clicar e pagar. Após a conclusão do pagamento, a reserva é confirmada automaticamente via webhook. Use para consumidores B2C.

Requisição

CampoTipoObrig.Descrição
bookingIdstringYesBooking ID from prepare_booking (preparedBookingId)
currencystringYes3-letter currency code (e.g., USD, EUR, GBP)
backUrlstringNoCancel/back redirect URL (defaults to locktrip.com)
successUrlstringNoSuccess redirect URL

Resposta

CampoTipoDescrição
checkoutUrlstringRevolut hosted checkout URL for payment
checkoutTokenstringPayment token for tracking
expiresInMinutesnumberToken expiration time (20 minutes)
messagestringUser instruction message

Exemplo

curl -X POST https://locktrip.com/mcp/tools/create_checkout \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eyJhbGciOiJIUzUxMiJ9..." \
  -d '{"bookingId":"69a2b7540a93415a4b4dbf13","currency":"EUR"}'

# Response (200 OK):
{"checkoutUrl":"https://checkout.revolut.com/pay/abc123...","checkoutToken":"rev_tok_abc123...","expiresInMinutes":20,"message":"Payment checkout link created. Share this URL with the user to complete payment."}

get_payment_url

Autenticação Obrigatória

Obtenha um URL de checkout Stripe para pagar uma reserva preparada. Retorna um URL para redirecionar o cliente para concluir o pagamento com cartão de crédito.

Requisição

CampoTipoObrig.Descrição
bookingIdstringYesBooking ID from prepare_booking (preparedBookingId)
currencystringYesPayment currency code (e.g., USD, EUR)
backUrlstringYesURL to redirect on cancel/back
successUrlstringNoCustom URL to redirect on success

Resposta

CampoTipoDescrição
urlstringStripe checkout URL to redirect customer to
sessionIdstringStripe session ID for tracking

Exemplo

curl -X POST https://locktrip.com/mcp/tools/get_payment_url \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eyJhbGciOiJIUzUxMiJ9..." \
  -d '{"bookingId":"69a2b7540a93415a4b4dbf13","currency":"EUR","backUrl":"https://example.com/cancel"}'

# Response (200 OK):
{"url":"https://checkout.stripe.com/c/pay/cs_live_abc123...","sessionId":"cs_live_abc123..."}

list_bookings

Autenticação Obrigatória

Liste reservas do usuário autenticado. Filtre por status: UPCOMING, COMPLETED, CANCELLED ou PENDING.

Requisição

CampoTipoObrig.Descrição
typestringNo"UPCOMING", "COMPLETED", "CANCELLED", or "PENDING" (default: "UPCOMING")
pageignoredNoNOT SUPPORTED — accepted by the transport but silently discarded; this tool does not paginate.
sizeignoredNoNOT SUPPORTED — silently discarded. list_bookings returns the whole filtered set in one response.

Resposta

CampoTipoDescrição
bookingsBookingSummary[]Array of booking summaries
bookings[].bookingIdstringBooking identifier
bookings[].bookingReferenceIdstringProvider reference ID
bookings[].hotelNamestringHotel name
bookings[].hotelCitystringALWAYS an empty string — the upstream list record carries no city. Use get_booking_details for the hotel’s city.
bookings[].checkInstringCheck-in date (YYYY-MM-DD)
bookings[].checkOutstringCheck-out date (YYYY-MM-DD)
bookings[].statusstringBooking status (DONE, PENDING, CANCELLED)
bookings[].totalPriceabsentNOT RETURNED. The upstream booking-list record carries no price, so this field is omitted rather than filled with a placeholder. Call get_booking_details for the real amount.
bookings[].currencyabsentNOT RETURNED, for the same reason. Call get_booking_details, which returns both totalPrice and currency.
bookings[].guestNamestringALWAYS the literal "Guest" — the upstream list record carries no guest name. Use get_booking_details for the real guests.
bookings[].roomCountnumberNumber of rooms
bookings[].createdAtstringBooking creation timestamp (ISO 8601)
bookings[].hotelPhotostring|nullHotel image URL
totalCountnumberNumber of bookings in THIS response. There is no pagination, so this is the full filtered set.
pagenumberAlways 0 — this tool does not paginate.
pageSizenumberEqual to totalCount; present for shape compatibility only.

Exemplo

curl -X POST https://locktrip.com/mcp/tools/list_bookings \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eyJhbGciOiJIUzUxMiJ9..." \
  -d '{"type": "UPCOMING"}'

# Response (200 OK):
{"bookings":[{"bookingId":"69a2b7540a93415a4b4dbf13","bookingReferenceId":"LT-2026-AB12CD","hotelName":"Premiere Classe Plaisir","hotelCity":"","checkIn":"2027-04-15","checkOut":"2027-04-17","status":"DONE","guestName":"Guest","roomCount":1,"createdAt":"2026-02-28T09:35:00.000Z","hotelPhoto":"https://imagecontent.net/images/full/d174a039.jpeg"}],"totalCount":1,"page":0,"pageSize":1}

# NOTE: this endpoint is a summary index, not a detail view. totalPrice and currency are
# absent, and hotelCity / guestName are not populated by the upstream list record.
# Fetch a bookingId with get_booking_details for price, currency, guests and city.

get_booking_details

Autenticação Obrigatória

Obtenha detalhes completos de uma reserva específica, incluindo informações do hotel, hóspedes, quartos, status do pagamento e política de cancelamento.

Requisição

CampoTipoObrig.Descrição
bookingIdstringYesBooking ID to retrieve

Resposta

CampoTipoDescrição
bookingIdstringBooking identifier
bookingReferenceIdstringProvider reference ID
statusstringBooking status (DONE, PENDING, CANCELLED)
hotelobjectHotel details
hotel.namestringHotel name
hotel.addressstringStreet address
hotel.citystringCity
hotel.countrystringCountry
hotel.starRatingnumberStar rating (1-5)
checkInstringCheck-in date (YYYY-MM-DD)
checkOutstringCheck-out date (YYYY-MM-DD)
roomsRoom[]Booked rooms with guests
contactPersonobjectContact person (firstName, lastName, email, phone)
totalPricenumberTotal booking price
currencystringCurrency code
paymentStatusstringPayment status (PAID, PENDING)
cancellationPolicyobject|nullCancellation policy with fees and deadlines
createdAtstringBooking creation date
confirmedAtstring|nullConfirmation date (null if pending)

Exemplo

curl -X POST https://locktrip.com/mcp/tools/get_booking_details \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eyJhbGciOiJIUzUxMiJ9..." \
  -d '{"bookingId": "69a2b7540a93415a4b4dbf13"}'

# Response (200 OK):
{"bookingId":"69a2b7540a93415a4b4dbf13","bookingReferenceId":"LT-2026-AB12CD","status":"DONE","hotel":{"id":4384127,"name":"Premiere Classe Plaisir","city":"Plaisir","country":"France","starRating":1},"checkIn":"2027-04-15","checkOut":"2027-04-17","totalPrice":71.34,"currency":"EUR","paymentStatus":"PAID","createdAt":"2026-02-28","confirmedAt":"2026-02-28"}

cancel_booking

Autenticação Obrigatória

Solicite o cancelamento de uma reserva. Chame com confirmed=false primeiro para visualizar as taxas de cancelamento, depois com confirmed=true para executar. Retorna valor do reembolso e taxa de cancelamento.

Requisição

CampoTipoObrig.Descrição
bookingIdstringYesBooking ID to cancel
confirmedbooleanYesSet true to execute cancellation
reasonstringNoReason for cancellation

Resposta

CampoTipoDescrição
successbooleanWhether cancellation was executed
messagestringStatus message (preview or confirmation)

Exemplo

# Step 1: Preview cancellation (dry run)
curl -X POST https://locktrip.com/mcp/tools/cancel_booking \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eyJhbGciOiJIUzUxMiJ9..." \
  -d '{"bookingId":"69a2b7540a93415a4b4dbf13","confirmed":false}'

# Response (200 OK):
{"success":false,"message":"Cancellation not confirmed. Set confirmed=true to proceed."}

# Step 2: Execute cancellation
curl -X POST https://locktrip.com/mcp/tools/cancel_booking \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eyJhbGciOiJIUzUxMiJ9..." \
  -d '{"bookingId":"69a2b7540a93415a4b4dbf13","confirmed":true,"reason":"Change of plans"}'

# Response (200 OK):
{"success":true,"message":"Booking cancelled successfully"}

Especificações legíveis por máquina: OpenAPI 3.1 | Tool List | MCP Discovery | GraphQL B2B Docs

LockTrip Hotel Booking MCP API v1.0.0

API Documentation - MCP Hotel Booking Reference | LockTrip.com