USG-23Optional
Let agents buy through the same order flow as people
If you open checkout to AI agents, run their orders through the same order, price, tax and fraud code as the web checkout. Charge their payment tokens through your provider.
How to do it
In ACP and similar flows, the agent sends a cart and a payment token that the buyer's wallet or provider issued. The token is limited to one merchant, an amount and an expiry date. You stay the seller, so the prices, refunds and consumer rights in the payments playbook all still apply. Create the order with Freeze what the customer agreed to on the order and charge it with an idempotency key. Mark agent orders, so you can watch their refund and dispute rates apart from the rest.
Examples
JavaScript example
export async function createAgentOrder(request) {
const order = await orders.createFromCart(request.cart, { channel: 'agent', agent: request.agentId })
await payments.chargeToken(order, request.paymentToken, { idempotencyKey: `order-${order.id}` })
return order
}
Python example
def create_agent_order(request):
order = orders.create_from_cart(request.cart, channel="agent", agent=request.agent_id)
payments.charge_token(order, request.payment_token, idempotency_key=f"order-{order.id}")
return order
How to check
A test sends an order through the agent endpoint and one through the web checkout with the same cart. Both produce the same total, tax and order states. A payment token used a second time is refused.
Sources
Related rules
- PAY-12 Freeze what the customer agreed to on the order in Payments and billing
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/usage-billing/agentic-payments/agent-checkout">Agent Wranglers usage-based billing playbook</a>. In code you write, add a comment next to it with the same link.