Scenario 3
A shopper buys running shoes in Gemini
A shopper asks Gemini for running shoes. UCP handles discovery, checkout, the Google Pay handler and signed order webhooks; an AP2 checkout mandate with the human present is shown as the specification describes it, with live use unverified. Google Pay on Google surfaces uses only PAN_ONLY.
The situation
A shopper asks Gemini for a pair of trail running shoes in size 10 under a set price, picks one, and pays with the card saved in Google Pay. The shopper is present for the whole purchase. The merchant, not Google, is the and keeps the financial liability and the order.Source [1, 2]
Two layers are involved, and they are not equally live. UCP-powered checkout began rolling out to US shoppers in AI Mode in Search and the Gemini app on 2026-02-11, starting with Etsy and Wayfair items.Source [3] The layer is specified inside UCP as an optional .Source [2, 4] Google said on 2026-05-19 that it would begin bringing AP2 to its products in the coming months, starting with Gemini Spark.Source [5] Production use of AP2 mandates is unverified anywhere, including inside UCP, as of 2026-10-11.Source [6, 7]? unverified Read the AP2 steps below as “per spec; live use unverified”.
Actors
- Shopper, present and approving.
- Gemini, the UCP platform and, in AP2 terms, the .
- Trusted checkout UI, the AP2 , which must be non-agentic.Source [8]
- Google Pay, the , whose handler
com.google.payis a specification authored by the provider.Source [9] - Merchant, the UCP business, which publishes its profile at
/.well-known/ucp.Source [9] - Merchant PSP, the AP2 , plus the card network and issuer.Source [8]
Step by step
- Ask (no protocol). The shopper describes what they want.
- Discover (UCP). Gemini reads the merchant profile; it requires a
ucpobject withversion,servicesandpayment_handlers, and signing keys sit in a top-levelkeysarray.Source [9, 10] A merchant that AP2 listsdev.ucp.common.payment.ap2_mandatethere.Source [11] - Create checkout (UCP). Gemini calls
POST /checkout-sessionswith its profile URI inUCP-Agent.Source [9, 12] Google says requests from its surfaces carryUCP-Agentand a User-Agent beginning withGoogle/UCP.Source [2] If AP2 is in the , the is locked and neither side may fall back to an unprotected checkout.Source [4] - Signed checkout (UCP AP2 ). The merchant must include
ap2.merchant_authorizationin every checkout response, a JWS with detached content over the checkout without theap2field.Source [4, 13] - Verify and hand off (AP2). Gemini must verify the merchant signature before showing the checkout.Source [4]
- Approve (AP2). In the human-present flow the user approves the closed Checkout and Payment on a .Source [8, 14]
- Get the (UCP handler). The defines the handler, the merchant configures it, and the platform executes it to obtain a token.Source [9] On Google AI surfaces UCP checkout supports only
PAN_ONLYfor Google Payallowed_auth_methods.Source [2] - Create the closed mandates (AP2, per spec). The requires
vct,checkout_jwtandcheckout_hash.Source [15] The requiresvct,transaction_id,payee,payment_amountandpayment_instrument, andtransaction_idis the hash ofcheckout_jwt, which binds payment to one checkout.Source [16] - Complete (UCP). The checkout mandate goes in
ap2.checkout_mandate, an with , and the payment mandate inpayment.instruments[*].credential.token.Source [4, 13] UCP signs requests with and binds bodies with anContent-Digest.Source [17] - Merchant verifies (AP2). The merchant checks that the hash of the checkout JWT it sent matches
checkout_hash.Source [8] - Processor verifies (AP2). The checks that the credential is scoped to this checkout, for example by finding the inside it.Source [8]
- Authorize (card rails). The merchant’s PSP must be able to process Google’s tokens; the merchant does not need Google Pay on its own site.Source [2]
- Order and receipts (UCP, AP2). Complete returns
completedwith an order.Source [18] Per AP2 the processor returns a signed and the merchant a signed Checkout Receipt.Source [8, 14] - Order webhooks (UCP). The merchant posts full order snapshots to the platform’s
config.webhook_urlwithWebhook-IdandWebhook-Timestamp.Source [12, 19, 20] Webhooks must be signed with RFC 9421, and the platform must reject events whose signer does not match the order’s business.Source [20]
Which protocol does what
| Steps | Protocol | Object or message | Spec version |
|---|---|---|---|
| 2 to 4 | UCP | profile, POST /checkout-sessions, ap2.merchant_authorization | v2026-08-25 |
| 5 to 6, 8 | AP2 | , mandate.checkout.1, mandate.payment.1 | v0.2 (per spec) |
| 7 | UCP handler | com.google.pay, PAN_ONLY | Google handler |
| 9 | UCP | complete, ap2.checkout_mandate, credential.token | v2026-08-25 |
| 10 to 11, 13 | AP2 | verification, Checkout and Payment Receipts | v0.2 (per spec) |
| 12 | Card rails | authorization | outside both protocols |
| 14 | UCP | , | v2026-08-25 |
AP2 v0.2 was released on 2026-04-28.Source [21, 22] The UCP release that renamed the AP2 to dev.ucp.common.payment.ap2_mandate is v2026-08-25.Source [13, 23, 24]
Where controls apply
- Before authorization. The platform allowlists businesses and namespaces and checks the advertised handlers before it creates a checkout.Source [9] UCP has no field; caps belong to AP2 or the .Source [4, 25]
- At signing. Consent binds to one merchant-signed checkout. The checkout mandate contains the full checkout including
ap2.merchant_authorization, so the platform’s signature covers the merchant’s.Source [4] Without AP2, the must hand the checkout to a trusted, deterministic UI for the user to review and place the order.Source [18] - At the edge. With API keys, OAuth or mTLS, the merchant must confirm that the caller may act for the profile in
UCP-Agent.Source [9] rests on a signedIdempotency-Key.Source [17] - At settlement. PSP fraud screening applies, and stays with the business, handler and PSP rather than in UCP messages.Source [26] AP2 v0.2 specifies no step-up; a failed check falls back through
unresolved_constraint.Source [14, 27] - After the fact. AP2 dispute verification recomputes the
checkout_jwthash and checks both receipt references against the closed mandates.Source [8] Order can record disputes, but handling them stays with the merchant and its PSP.Source [19]
What is observable from outside
Business profiles are public and cacheable, so anyone can see the , transports, payment handlers and keys a domain advertises, including whether it AP2.Source [9] The rest is private. Checkout sessions, payment credentials, and webhooks flow point to point.Source [9] AP2 defines no public registry, explorer or event stream.Source [8, 28] Google keeps the order data shown on the shopper’s My orders page until the shopper asks for deletion.Source [2]
What can go wrong
- Unsigned or altered checkout. A missing or invalid merchant signature yields
merchant_authorization_missingormerchant_authorization_invalid.Source [13] No order is placed and nobody pays. - problems. A missing mandate yields
mandate_required; an expired, mis-scoped or badly signed one yieldsmandate_expired,mandate_scope_mismatchormandate_invalid_signature.Source [13] - Lost complete response. During
complete_in_progressthe platform must not start another update or complete.Source [18] - . With
requires_escalationthe business must providecontinue_url, and the platform must send the shopper there.Source [18] - Wrong item or price. The merchant is and carries the order; the shopper accepted the merchant’s terms during checkout.Source [2] AP2 leaves liability to the payment networks.Source [6, 29]
- Forged webhook. The platform must reject events whose signer is not the order’s business.Source [20]
Costs: Google publishes no fee schedule; because the merchant uses its own PSP, its normal processing fees presumably apply, which is an inference, not a statement from Google.Source [2]? unverified Google told The Register it does not plan to take a cut of sales.Source [30]
Variants
- A instead of a card on file. UCP defines a
network_tokenwithnumberandcryptogram.Source [31] On Google surfaces, though, a network-token path through the Google Pay handler is not documented, because onlyPAN_ONLYis supported there.Source [2] Which network’s , if any, could flow inside a Google Pay handler is not published.Source [2]? unverified - Without AP2, as documented today. Drop steps 5, 8, 10 and 11: the checkout goes to a trusted UI for review, and UCP’s own signatures and idempotency carry the integrity.Source [18] Google also offers approved merchants an embedded checkout as an alternative to native checkout.Source [32]
Flow player: A shopper buys running shoes in Gemini: UCP checkout, an AP2 checkout mandate (per spec), Google Pay, signed order webhooks
A shopper asks Gemini for running shoes. Gemini, acting as a UCP platform, reads the merchant's /.well-known/ucp profile, creates a checkout, and completes it with a Google Pay credential obtained through the com.google.pay handler, which on Google AI surfaces uses only PAN_ONLY. The AP2 mandate steps follow the UCP AP2 extension and AP2 v0.2 as specified; their live use on Google surfaces is unverified. The merchant authorizes through its own PSP and sends RFC 9421 signed order webhooks.
Spec version: UCP v2026-08-25; AP2 v0.2 (2026-08-25).
Use the left and right arrow keys to step, space to play or pause, Home and End to jump.
Step 1 of 14Shopper to Gemini (UCP platform, shopping agent)
Ask for running shoes
The shopper asks Gemini for a pair of running shoes in a size and price range and stays in the conversation. This is a human-present purchase.
Control point: Before authorization: the platform decides which merchants and capability namespaces it will transact with.
Step 1 of 14: Shopper to Gemini (UCP platform, shopping agent). Ask for running shoes.
Which protocol owns each step
- UCP
- AP2
| Step | From and to | Protocol | Control point | Observable from outside |
|---|---|---|---|---|
| 1. Ask for running shoes | Shopper to Gemini (UCP platform, shopping agent) | Not protocol-specific | Before authorization: the platform decides which merchants and capability namespaces it will transact with. | Private |
| 2. GET /.well-known/ucp (business profile) (crosses a trust boundary) | Gemini (UCP platform, shopping agent) to Merchant (business, merchant of record) | UCP | None | Public: the profile at /.well-known/ucp is cacheable and shows capabilities, transports, payment handlers and keys. |
| 3. POST /checkout-sessions with UCP-Agent (crosses a trust boundary) | Gemini (UCP platform, shopping agent) to Merchant (business, merchant of record) | UCP | At the edge: the merchant verifies the platform's identity (signature, API key, OAuth or mTLS) and that it may act for the profile named in UCP-Agent; rate limits and SSRF guards on profile fetches. | Private to the two parties; the merchant can recognize Google traffic by UCP-Agent and the Google/UCP User-Agent. |
| 4. Checkout with ap2.merchant_authorization (crosses a trust boundary) | Merchant (business, merchant of record) to Gemini (UCP platform, shopping agent) | UCP | None | Private |
| 5. Verify the merchant signature, hand off to the trusted UI (crosses a trust boundary) | Gemini (UCP platform, shopping agent) to Trusted checkout UI (Trusted Surface) | AP2 | At signing: show the latest merchant-signed checkout in a deterministic UI immediately before consent; refuse if the totals or merchant differ from what the shopper asked for. | Private |
| 6. Review and approve; choose Google Pay | Shopper to Trusted checkout UI (Trusted Surface) | AP2 | At signing: explicit human approval of one closed checkout; the Trusted Surface can collect risk_data for the Payment Mandate. | Private |
| 7. Run the com.google.pay handler (PAN_ONLY) (crosses a trust boundary) | Trusted checkout UI (Trusted Surface) to Google Pay (credential provider) | UCP | None | Private: the Google Pay token travels platform to merchant to PSP and is never published. |
| 8. Create the closed mandates (per spec; live use unverified) | Trusted checkout UI (Trusted Surface) to Trusted checkout UI (Trusted Surface) | AP2 | At signing: the mandate binds consent to one checkout hash, so a changed cart cannot reuse it. | Private: mandates are exchanged only among agent, credential provider, merchant, processor and network. |
| 9. POST /checkout-sessions/{id}/complete (signed, with ap2.checkout_mandate) (crosses a trust boundary) | Gemini (UCP platform, shopping agent) to Merchant (business, merchant of record) | UCP | None | Private |
| 10. Verify the checkout mandate against the current checkout | Merchant (business, merchant of record) to Merchant (business, merchant of record) | AP2 | At the edge: deterministic mandate verification by the merchant before any charge. | Private |
| 11. Authorize the Google Pay token; processor checks the payment mandate (crosses a trust boundary) | Merchant (business, merchant of record) to Merchant PSP (Merchant Payment Processor) | AP2 | At settlement: PSP fraud screening and, if the merchant uses it, 3DS2 through the UCP authentication extension. | Private |
| 12. Card authorization (crosses a trust boundary) | Merchant PSP (Merchant Payment Processor) to Card network and issuer | Not protocol-specific | At settlement: issuer risk decision on the card authorization. | Private |
| 13. completed with order; receipts (crosses a trust boundary) | Merchant (business, merchant of record) to Gemini (UCP platform, shopping agent) | UCP | After the fact: keep the merchant-signed checkout, the mandates and both receipts together as dispute evidence. | Private: the order and receipts go only to the platform; Google shows the order on the shopper's My orders page. |
| 14. Order webhook, RFC 9421 signed (crosses a trust boundary) | Merchant (business, merchant of record) to Gemini (UCP platform, shopping agent) | UCP | After the fact: verify webhook signatures, reconcile with GET /orders/{id}, and watch adjustments such as refund, return and dispute. | Private: webhooks go only to the platform's webhook_url. |
Sequence diagram: A shopper buys running shoes in Gemini: UCP checkout, an AP2 checkout mandate (per spec), Google Pay, signed order webhooks
Scroll to see the whole diagram
Diagram loads when it scrolls into view.
Generated from the flow definition (spec version UCP v2026-08-25; AP2 v0.2, 2026-08-25). The player above uses the same data.
Text alternative
Sequence diagram: A shopper buys running shoes in Gemini: UCP checkout, an AP2 checkout mandate (per spec), Google Pay, signed order webhooks. 7 participants: Shopper, Gemini (UCP platform, shopping agent), Trusted checkout UI (Trusted Surface), Google Pay (credential provider), Merchant (business, merchant of record), Merchant PSP (Merchant Payment Processor), and Card network and issuer. 14 steps, 10 crossing a trust boundary, 9 failure branches. Based on several protocols UCP v2026-08-25; AP2 v0.2 (2026-08-25). Step 1: Shopper to Gemini (UCP platform, shopping agent): Ask for running shoes. Step 2: Gemini (UCP platform, shopping agent) to Merchant (business, merchant of record): GET /.well-known/ucp (business profile). This step crosses a trust boundary. If The two profiles share no compatible capability: capabilities_incompatible (returned with HTTP 200 inside a UCP response). Step 3: Gemini (UCP platform, shopping agent) to Merchant (business, merchant of record): POST /checkout-sessions with UCP-Agent. This step crosses a trust boundary. Step 4: Merchant (business, merchant of record) to Gemini (UCP platform, shopping agent): Checkout with ap2.merchant_authorization. This step crosses a trust boundary. If The signature is missing or does not verify against the merchant's keys: merchant_authorization_missing or merchant_authorization_invalid; the platform must not show the checkout. If The merchant needs buyer input it cannot get through the API: status requires_escalation with continue_url; the shopper finishes on the merchant's site. Step 5: Gemini (UCP platform, shopping agent) to Trusted checkout UI (Trusted Surface): Verify the merchant signature, hand off to the trusted UI. This step crosses a trust boundary. Step 6: Shopper to Trusted checkout UI (Trusted Surface): Review and approve; choose Google Pay. Step 7: Trusted checkout UI (Trusted Surface) to Google Pay (credential provider): Run the com.google.pay handler (PAN_ONLY). This step crosses a trust boundary. If The merchant's PSP cannot process Google's tokens: The merchant cannot accept this handler; Google's FAQ makes PSP support a precondition. Step 8: Trusted checkout UI (Trusted Surface) to Trusted checkout UI (Trusted Surface): Create the closed mandates (per spec; live use unverified). Step 9: Gemini (UCP platform, shopping agent) to Merchant (business, merchant of record): POST /checkout-sessions/{id}/complete (signed, with ap2.checkout_mandate). This step crosses a trust boundary. If AP2 was negotiated but ap2.checkout_mandate is missing: mandate_required; the merchant must reject the complete. If The response to complete is lost: Retry with the same Idempotency-Key; during complete_in_progress the platform must not start a new update or complete. Step 10: Merchant (business, merchant of record) to Merchant (business, merchant of record): Verify the checkout mandate against the current checkout. If The mandate is for another checkout, expired or badly signed: mandate_scope_mismatch, mandate_expired or mandate_invalid_signature. Step 11: Merchant (business, merchant of record) to Merchant PSP (Merchant Payment Processor): Authorize the Google Pay token; processor checks the payment mandate. This step crosses a trust boundary. Step 12: Merchant PSP (Merchant Payment Processor) to Card network and issuer: Card authorization. This step crosses a trust boundary. If The issuer declines: The merchant returns a payment failure in the checkout; no order is created. Step 13: Merchant (business, merchant of record) to Gemini (UCP platform, shopping agent): completed with order; receipts. This step crosses a trust boundary. Step 14: Merchant (business, merchant of record) to Gemini (UCP platform, shopping agent): Order webhook, RFC 9421 signed. This step crosses a trust boundary. If The webhook signer is not the order's business: The platform must reject the event.
- Step 1: Shopper to Gemini (UCP platform, shopping agent): Ask for running shoes.
- Step 2: Gemini (UCP platform, shopping agent) to Merchant (business, merchant of record): GET /.well-known/ucp (business profile). This step crosses a trust boundary. If The two profiles share no compatible capability: capabilities_incompatible (returned with HTTP 200 inside a UCP response).
- Step 3: Gemini (UCP platform, shopping agent) to Merchant (business, merchant of record): POST /checkout-sessions with UCP-Agent. This step crosses a trust boundary.
- Step 4: Merchant (business, merchant of record) to Gemini (UCP platform, shopping agent): Checkout with ap2.merchant_authorization. This step crosses a trust boundary. If The signature is missing or does not verify against the merchant's keys: merchant_authorization_missing or merchant_authorization_invalid; the platform must not show the checkout. If The merchant needs buyer input it cannot get through the API: status requires_escalation with continue_url; the shopper finishes on the merchant's site.
- Step 5: Gemini (UCP platform, shopping agent) to Trusted checkout UI (Trusted Surface): Verify the merchant signature, hand off to the trusted UI. This step crosses a trust boundary.
- Step 6: Shopper to Trusted checkout UI (Trusted Surface): Review and approve; choose Google Pay.
- Step 7: Trusted checkout UI (Trusted Surface) to Google Pay (credential provider): Run the com.google.pay handler (PAN_ONLY). This step crosses a trust boundary. If The merchant's PSP cannot process Google's tokens: The merchant cannot accept this handler; Google's FAQ makes PSP support a precondition.
- Step 8: Trusted checkout UI (Trusted Surface) to Trusted checkout UI (Trusted Surface): Create the closed mandates (per spec; live use unverified).
- Step 9: Gemini (UCP platform, shopping agent) to Merchant (business, merchant of record): POST /checkout-sessions/{id}/complete (signed, with ap2.checkout_mandate). This step crosses a trust boundary. If AP2 was negotiated but ap2.checkout_mandate is missing: mandate_required; the merchant must reject the complete. If The response to complete is lost: Retry with the same Idempotency-Key; during complete_in_progress the platform must not start a new update or complete.
- Step 10: Merchant (business, merchant of record) to Merchant (business, merchant of record): Verify the checkout mandate against the current checkout. If The mandate is for another checkout, expired or badly signed: mandate_scope_mismatch, mandate_expired or mandate_invalid_signature.
- Step 11: Merchant (business, merchant of record) to Merchant PSP (Merchant Payment Processor): Authorize the Google Pay token; processor checks the payment mandate. This step crosses a trust boundary.
- Step 12: Merchant PSP (Merchant Payment Processor) to Card network and issuer: Card authorization. This step crosses a trust boundary. If The issuer declines: The merchant returns a payment failure in the checkout; no order is created.
- Step 13: Merchant (business, merchant of record) to Gemini (UCP platform, shopping agent): completed with order; receipts. This step crosses a trust boundary.
- Step 14: Merchant (business, merchant of record) to Gemini (UCP platform, shopping agent): Order webhook, RFC 9421 signed. This step crosses a trust boundary. If The webhook signer is not the order's business: The platform must reject the event.
Source of truth: Discovery and negotiation (external link) Generated from src/content/flows/multi-shopper-in-gemini.json.
Actors and protocol boundaries
A shopper in Gemini: actors and protocol boundaries
Scroll to see the whole diagram
Diagram loads when it scrolls into view.
UCP carries discovery, checkout, payment handler execution and signed order webhooks between Gemini and the merchant. AP2 adds the merchant signature on the checkout and the user-approved closed mandates, carried inside UCP by the AP2 extension; that part is specified, and its live use on Google surfaces is unverified. Google Pay on Google AI surfaces uses only PAN_ONLY, so no network token is shown. The merchant is merchant of record and authorizes through its own PSP.
Text alternative
Flowchart. The shopper chats with the Gemini agent, which acts as a UCP platform, and later approves the checkout in a trusted checkout UI that plays the AP2 Trusted Surface role. Gemini reads the merchant's /.well-known/ucp profile and keys, creates a checkout on the merchant's UCP endpoint, and receives the checkout with an ap2.merchant_authorization signature. Gemini hands the checkout to the trusted UI, which runs the Google Pay handler com.google.pay; on Google surfaces this handler uses only PAN_ONLY. The trusted UI produces the closed AP2 mandates, a dashed line marked per spec and live use unverified. Gemini completes the checkout with the token and ap2.checkout_mandate in an RFC 9421 signed request. The merchant authorizes the token with its PSP, which plays the AP2 Merchant Payment Processor role and runs a card authorization with the network and issuer. The merchant then sends RFC 9421 signed order webhooks back to Gemini.
Source of truth: UCP AP2 Mandates Extension (v2026-08-25), with the Google UCP FAQ (external link) Generated from src/content/diagrams/multi-shopper-in-gemini-context.mmd.
Sources
- UCP glossary (v2026-08-25) (external link)
- Frequently Asked Questions, Google UCP Guide (external link)
- What to expect in digital advertising and commerce in 2026 (external link)
- AP2 Mandates Extension (v2026-08-25) (external link)
- Google Shopping introduces Universal Cart (external link)
- AP2 FAQ (external link)
- Beyond the Mandate: A Systematic Security Analysis of the Agent Payments Protocol (AP2) (external link)
- Agentic Payment Protocol (v0.2) specification (external link)
- UCP Official Specification overview (v2026-08-25) (external link)
- profile.json and ucp.json schemas (v2026-08-25) (external link)
- UCP AP2 Mandates Extension (external link)
- UCP Shopping Service REST OpenAPI 3.1 (v2026-08-25) (external link)
- payment_ap2_mandate.json (v2026-08-25) (external link)
- AP2 Flow Examples (external link)
- AP2 JSON Schema: Checkout Mandate (external link)
- AP2 JSON Schema: Payment Mandate (external link)
- UCP Message Signatures (v2026-08-25) (external link)
- Checkout Capability (v2026-08-25) (external link)
- order.json, fulfillment_event.json, adjustment.json schemas (v2026-08-25) (external link)
- Order Capability (v2026-08-25) (external link)
- AP2 GitHub releases v0.1.0 and v0.2.0 (external link)
- AP2 CHANGELOG.md (external link)
- Release v2026-08-25 (external link)
- UCP pull requests (merge dates via GitHub API) (external link)
- checkout.json schema (v2026-08-25) (external link)
- Payment Authentication extension (v2026-08-25) (external link)
- AP2 Agent Authorization (external link)
- AP2 repository (README, METADATA, LICENSE) at e1ea56d (external link)
- AP2 specification at tag v0.1.0 (external link)
- Google Gemini agentic shopping protocol (The Register) (external link)
- Network token credential schema (v2026-08-25) (external link)
- Google Universal Commerce Protocol (UCP) Guide (external link)
- AP2 Checkout Mandate (external link)
- AP2 Payment Mandate (external link)