Skip to main content
Agent Checkouts can use any payment method the merchant accepts. Tell the agent which method to use in the run’s task. If the agent needs a card credential, it pauses and sends a typed payment request for your application to authorize. Your agent runtime can run on a server and communicate through any user channel, including a website, native app, messaging app, or voice assistant. The user only needs a secure application surface when they must authorize or verify the card.

Prerequisites

Choose the Method in the Task

Describe the user’s preferred method when you start the run. Be specific enough that the agent does not have to infer which option to select.
The task selects the method. It does not authorize a charge. Only answer a typed payment request when the agent is ready to pay.

Authorize an Agent Card

1

Detect the payment request

The run moves to awaiting_input and exposes the request in both places you can observe a run:
  • requiredAction.request when you read the run
  • an input_request message part when you list or stream messages
Dispatch on interaction.kind === "payment". The request contains safe charge metadata, not card details, an iframe URL, or an order intent ID.An open payment message part looks like this:
  • method: "card" requests a card credential.
  • amount.value is a decimal string and amount.currency is an ISO 4217 code. kind: "exact" is the requested payable total; kind: "maximum" is the run’s cost ceiling.
  • merchant identifies where the credential will be used. Copy its url, name, and countryCode unchanged when you create the order intent.
2

Create the order intent

Create the order intent in your authenticated application with a production client-side key that has order-intents.create and order-intents.read scopes. Send the JWT for the same user who owns the saved card and the checkout run.Use the exact amount from the payment request, set a short expiration, and copy interaction.merchant into the order intent. This makes the merchant available to payment rails that need it before credential minting. If you omit it, Agent Checkouts supplies the same merchant when it requests the credential.
YOUR_PAYMENT_METHOD_ID is the ID returned when you save and register the user’s card. For the complete request and response, see Create an Agent Card.
3

Complete verification when required

Read orderIntent.rails and look for an active rail whose credentialFormats includes "card". The top-level order-intent status does not tell you whether a card credential is ready.If no card rail is active, follow Verify the Selected Rail for pending_verification, or Recollect the CVC for pending_cvc_recollection. Fetch the order intent again after that step and confirm that a card-capable rail is active. If none can become active, ask the buyer for another card.The Agent Card guide shows the verification component. Card setup and verification are separate from submitting the checkout response.
4

Submit the order intent ID

Send one input_response part that references the request’s requestId. Do not send card numbers, expiration dates, or security codes.
You can instead send action: "alternative" with text such as "Pay with Shop Pay instead", or action: "decline" to refuse the charge. See Send Agent Checkout Message for the complete schema.Answer before the request’s expiresAt. If it expires, observe the run for a new request and answer its new requestId.
Never put card details in the task, a buyer profile, form answers, or a text message. Raw card details are not accepted.
5

Continue observing the run

The accepted response resumes the run. Continue streaming messages or reading the run until it completes, asks for another input, or stops.If the merchant total changes or the authorization cannot be used, the agent sends a new payment request. Answer the new requestId; do not reuse a response from an earlier request.

Handle Authorization Problems

Submitting the ID acknowledges authorization; it does not confirm that the merchant accepted the card. Follow the run for application outcomes, another request, or the final result. Use the same production project and buyer for the run, saved card, and order intent. Your application sends identifiers instead of raw card data. Protected collection does not guarantee that values applied to merchant inputs are absent from later browser observations or recordings. For web, native, messaging, and server integrations, see Connect Your User Channel.

Next Steps

Create an Agent Card

Create the order intent and verify its selected rail

Reuse Merchant Sessions

Reuse a signed-in session on later checkouts