1. Discovery
The agent checks if the merchant supports ACP. Agent → Merchantapi_base_url, and proceeds.
2. Product Feed
The agent fetches the merchant’s product feed and finds the item. Agent → Merchantvar_socks_blk_m and proceeds to checkout.
3. Create Checkout Session
The agent sends the item. The merchant calls Prism to get x402 payment requirements, builds the handler from its cached declaration (GET /api/v2/merchant/acp/handlers, needs the API key), and returns it in the session.
Agent → Merchant
config on the cached handler declaration and returns the composed handler.
Agent receives:
status: "collecting_information" and required_fields. Buyer info and a shipping address are needed.
4. Session Update
The agent provides buyer info and the shipping address. The merchant recalculates totals and calls Prism payment requirements again with updated amounts. Agent → Merchantconfig on the cached handler declaration and returns the composed handler.
Agent receives:
ready_for_payment. Total: $20.02. The config.accepts amount has been updated to "20020000" (20.02 USDC).
5. Payment Authorization
The agent extractsconfig from the handler and passes it to the wallet. No HTTP request goes out; everything happens locally in the wallet.
paymentPayload.accepted: the option the wallet chose (USDC on Base Sepolia)paymentPayload.payload.signature: EIP-712 signature over the authorizationpaymentPayload.payload.authorization: EIP-3009 params (exact value, exact recipient, time-limited)paymentRequirements: echo of the chosenaccepts[]item
6. Complete Checkout
The agent submits the signed wallet output as the credential, addingtype: "default" discriminators.
Agent → Merchant
paymentPayload and paymentRequirements from the credential (stripping the ACP type fields) and forwards them to Prism:
transferWithAuthorization on Base Sepolia, verifies the transfer, and returns:
Testing
Use the Prism gateway with your own account and small amounts to validate the full flow end-to-end against real on-chain settlement.Merchant Guide
Step-by-step implementation for the merchant server
Agent Guide
Step-by-step implementation for the agent