Implement the Agentic Commerce Protocol checkout session cancel endpoint (POST /checkout_sessions/{checkout_session_id}/cancel) so a merchant releases reserved inventory when an agent abandons a purchase mid-flow
domain: developers.openai.com · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Implement POST /checkout_sessions/{checkout_session_id}/cancel per the ACP checkout specification, requiring HTTPS and a JSON response
Allow cancellation for any checkout session whose status is not already completed or canceled
Return HTTP 405 if the agent attempts to cancel a session that is already completed or canceled
On successful cancellation, release any reserved inventory holds and update the session's status field to canceled
Trigger any downstream cleanup (e.g. voiding a not-yet-captured Shared Payment Token allowance) tied to that checkout session
Emit an ACP order/session lifecycle event so the calling agent surface (e.g. ChatGPT) reflects the canceled state rather than leaving the user looking at a stale in-progress cart
Known gotchas
Cancellation must be idempotent-safe -- a retried cancel call against an already-canceled session should return the 405 cleanly rather than erroring unpredictably
Releasing inventory reservations needs to be atomic with the status update, or you risk a race where a second buyer and the original agent both believe they hold the item
The ACP spec is still evolving (April 2026 update expanded Cart/Feed/Orders/MCP capabilities) -- pin to a spec version and monitor the GitHub repository for cancel-endpoint changes
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?