Pay and book a flight
brij_book_flightOver MCP: you pay only the purchase itself, into its escrow. Pays the ticket into the intent's escrow with x402 (USDC on Solana). Call it once without payment to get the payment requirements, sign them with your wallet, and call again with the payment in _meta["x402/payment"] or in x402_payment (the base64 PAYMENT-SIGNATURE value).
Pay the escrow and request booking.
The intent id travels in the request body; the resource URL is static. Paid x402 endpoint. The payment challenge is dynamic for the intent:
payTo is the intent escrow address, asset is the expected escrow
mint, and amount is the expected escrow amount.
After x402 settlement, the API records the passenger list (lead first), verifies exact escrow funding on-chain, and enqueues the booking worker. Airline payment and escrow capture happen asynchronously.
If booking fails after x402 settlement, retry the same /book call;
excess funds remain refundable to refund_wallet.
Booking is asynchronous: poll GET /air/intents/{intent_id} until booked or refunded.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"intent_id": "<intent_id>",
"passengers": "<passengers>"
},
"name": "brij_book_flight"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| intent_id | Yes | Id returned by POST /air/intents. | |
| passengers | Yes | Exactly as many passengers as the intent's passenger_count (= adults searched), LEAD PASSENGER FIRST. Positions map to the offer's travellers. The lead passenger receives all emails, and refund requests authenticate against the LEAD passenger's family name. Duplicate travellers (same name and birth date) are refused with 400 duplicate_passenger. All refunds are all-or-nothing: one booking = one escrow, there is no per-passenger cancellation. | |
| x402_payment | No | Optional: the base64 x402 payment payload (the PAYMENT-SIGNATURE header value), for a client that cannot set _meta["x402/payment"]. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| intent | No | ||
| booking | No |