Ap2 checkout mandate

From OrcaQubits/agentic-commerce-skills-plugins · View interactive version

Ap2 checkout mandate is an AI agent skill from the GitHub repository OrcaQubits/agentic-commerce-skills-plugins. Implement the AP2 Checkout Mandate — the credential authorizing completion of a checkout, in its open (constrained) and closed (merchant-verified) forms, with merchant-signed checkout payloads, checkout hashes, and user confirmation on a trusted surface. Formerly called the Cart Mandate. Use when bu

How to use this skill

Skill file

AP2 Checkout Mandate

Renamed. This credential was called the Cart Mandate in earlier AP2 releases. If you are reading older samples, blog posts, or tutorials that say "Cart Mandate", they are describing this object — but the structure changed along with the name, so do not port field names across. Fetch the live schema.

Before writing code

Fetch live docs:

  1. Fetch https://ap2-protocol.org/ap2/checkout_mandate/ for the current Checkout Mandate schema — open and closed forms.
  2. Fetch https://ap2-protocol.org/ap2/agent_authorization/ for the open/closed mandate model this sits inside. Read that first if you have not; the mandate makes little sense without it.
  3. Fetch https://ap2-protocol.org/glossary/ to catch any further renames.
  4. Web-search site:github.com google-agentic-commerce AP2 code sdk mandate checkout for the current type definitions under code/.

Conceptual Architecture

What it authorizes

The Checkout Mandate authorizes completing a checkout transaction. It is the credential that says "this user agreed to buy this."

It exists in two forms, matching the open/closed model from the Agent Authorization Framework:

| Form | Bound to a transaction | Used for |

|------|------------------------|----------|

| Open | No — carries constraints | Human-not-present: the user authorizes a shape of purchase in advance |

| Closed | Yes — merchant-verified | Human-present, or the resolution of an open mandate |

Open mandate constraints

An open Checkout Mandate bounds what a valid closed mandate may contain:

These constraints are the security boundary for autonomous purchasing. The verifier must enforce them; do not rely on the agent to police itself.

Closed mandate shape

The closed form carries the merchant's commitment:

Read the live schema for the exact vct value and the full field list; both have changed between releases.

Who creates and signs what

So there are two distinct commitments in play, and conflating them is the classic mistake:

  1. Merchant signature — an entity-level guarantee that the products are available, the prices are accurate, and the merchant will fulfill at those terms. Signed by the merchant organization, not by its AI agent.
  2. User approval — captured on the trusted surface, providing non-repudiation for dispute resolution.

Signing and canonicalization

The merchant's signature covers a canonicalized form of the checkout payload so that serialization differences cannot change what was signed. Verify against the live spec:

Do not implement any of the above from memory or from an older sample. Signature verification that is "close enough" is a security defect.

Flow (human-present)

  1. Shopping Agent assembles the intended purchase.
  2. Merchant produces and signs the Checkout object.
  3. Checkout Mandate content is presented to the user on the trusted surface.
  4. User reviews and confirms.
  5. Closed mandate is bound to the transaction and presented to the verifier.
  6. Verifier validates and returns a signed receipt.

For the human-not-present path, the user signs an open mandate at step 3 and the agent later produces the closed mandate — see ap2-human-not-present-flow.

Best Practices

Related

ap2-agent-authorization (the framework), ap2-payment-mandate (authorizes the payment itself), ap2-vdc-framework (credential formats), ap2-human-present-flow, ap2-human-not-present-flow.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.