Buy Tickets
buy_ticketsBuy tickets from a get_ticket_listings listing (event_id, uvid, quantity) on XP. Two calls: confirm=false returns a preview with the all-in total; confirm=true, once the person approves, completes the order and returns its order_uuid. Four payment rails, chosen with rail: 'stripe_link' (the default) pays by card on a Stripe-hosted checkout page, where the preview returns payment_link and checkout_session_id and confirm=true takes that checkout_session_id; 'privy' pays USDC from the person's XP wallet, signed by the server; 'x402' takes a Solana USDC payment the caller signs, passed as payment_proof; 'mpp' pays by card with a Stripe Shared Payment Token over the Machine Payments Protocol, sent in params._meta['org.paymentauth/credential'] or as payment_credential. Requires sign-in and the write:tickets scope, plus read:account for the balance check on 'privy'.
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": {
"event_id": "<event_id>",
"uvid": "<uvid>",
"quantity": "<quantity>"
},
"name": "buy_tickets"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rail | No | Payment rail. 'stripe_link' (default) to pay by card on a Stripe-hosted Checkout page: the preview returns payment_link and checkout_session_id; after the user pays, confirm with checkout_session_id. 'privy' for server-signed delegate USDC. 'x402' for agent-signed Solana x402 payment with payment_proof. 'mpp' to pay with a Stripe Shared Payment Token over the MPP binding. | stripe_link |
| uvid | Yes | Ticket group UVID from get_ticket_listings. | |
| confirm | No | Must be true to execute. False returns a preview only. | |
| event_id | Yes | Event identifier from search_events or get_event_details. | |
| quantity | Yes | Number of tickets to purchase. | |
| facilitator | No | rail='x402' only. Id from facilitators_available in the preview envelope; omit to use the deploy default. Pattern: ^[a-z][a-z0-9_]*$. | |
| payment_proof | No | Required only for rail='x402' when confirm=True. Base64-encoded x402 v2 PaymentPayload (SVM 'exact') containing a partially-signed Solana USDC TransferChecked transaction. | |
| payment_credential | No | rail='mpp' only. JSON MPP credential, as a fallback for clients that cannot send params._meta. Prefer _meta when available. | |
| checkout_session_id | No | rail='stripe_link' only, with confirm=true. The checkout_session_id returned by the preview. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||