Buy Tickets
buy_ticketsUse when the user wants tickets to an event on the XP marketplace (connected order book). Four payment rails are supported. Use 'stripe_link' (the default — omit rail to get it) unless the user asks for another: pay by CARD on a Stripe-hosted Checkout page; the preview returns payment_link and checkout_session_id — open the link for the user, then call again with confirm=true and checkout_session_id; the result includes stripe_payment_intent. Other rails, by name only: 'privy' (server-signed USDC transfer from the user's delegated Privy embedded wallet), 'x402' (agent-signed Solana USDC transfer via the x402 protocol — use only if the caller can build and sign Solana x402 'exact' payloads), and 'mpp' (pay by CARD with a Stripe Shared Payment Token over the Machine Payments Protocol binding; present the credential in params._meta['org.paymentauth/credential'], or in the payment_credential argument when your client cannot send _meta). Requires write:tickets scope (and read:account for the balance preflight when using granular scopes). Call once with confirm=false to preview the total, then call again with confirm=true after the user explicitly approves.
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 | |||