Prerequisites
- A District Pass account
- A Prism Project Identify Token from the Prism Console
- An ACP-compatible commerce server exposing
/.well-known/acp.json,/checkout_sessions,/product_feed, and order endpoints
Step 1: Host Discovery
ACP agents discover your store by fetchingGET /.well-known/acp.json. This is a static file declaring your capabilities:
Step 2: Build the Handler for Checkout Sessions
When an agent creates a checkout session (POST /checkout_sessions), you build the Prism handler from two Prism calls: the handler declaration and the payment requirements.
Fetch the Handler Declaration
config:
Get Payment Requirements
Include in Session Response
Build the handler yourself: copy the cached declaration and setconfig to the x402 object above ({ ...declaration, config }). Do not change any other field. Add the result to capabilities.payment.handlers[] in your checkout session response:
amount as a fiat major-unit decimal string ("19.99" — max decimals must match the currency’s exponent). Prism returns the accepts[].amount values in token base units. The tokens that appear in accepts depend on what you have enabled in your Prism Console:
Step 3: Handle Session Updates
Sessions change as the agent provides information. When the agent updates the session (PUT /checkout_sessions/{id}) with buyer info or a shipping address, recalculate your totals and call Prism payment requirements again with the updated amount.
Return the updated session with:
- New
totals(including tax, shipping) - Updated
configin the payment handler (with amounts reflecting the new total) status: "ready_for_payment"when all required fields are present
Step 4: Settle via Prism
When the agent completes checkout (POST /checkout_sessions/{id}/complete), extract paymentPayload and paymentRequirements from payment_data.instrument.credential (ignore the type fields) and forward them to Prism:
status: "completed". Use the transaction hash as payment proof:
Why Prism is Simpler
Prism Console
Configure your chains, tokens, and settlement address
End-to-End Flow
See a complete request/response trace for the full purchase cycle