Ap2 human present flow

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

Ap2 human present flow is an AI agent skill from the GitHub repository OrcaQubits/agentic-commerce-skills-plugins. Implement the AP2 human-present transaction flow — the checkout process where the user is actively present to confirm cart details and payment method selection. The primary VDC in this flow is the Checkout Mandate. Use when building interactive agentic checkout with user in the loop.

How to use this skill

Skill file

AP2 Human-Present Transaction Flow

Before writing code

Fetch live docs:

  1. Fetch https://ap2-protocol.org/ap2/specification/ for the human-present flow specification
  2. Web-search site:github.com google-agentic-commerce AP2 samples human-present for reference implementations
  3. Fetch https://github.com/google-agentic-commerce/AP2/tree/main/code/samples for the card payment sample
  4. Fetch https://ap2-protocol.org/overview/ for flow overview

Conceptual Architecture

What Human-Present Means

In a human-present flow, the user is actively engaged throughout the transaction. They review products, select items, choose a payment method, and confirm the purchase — all while interacting with the Shopping Agent.

The Human-Present Transaction Flow

The official AP2 specification describes approximately 11 high-level steps for the human-present flow. The primary VDC in this flow is the Checkout Mandate.

Phase 1: Shopping Intent
  1. User → Shopping Agent:    Provides shopping prompt ("I want to buy a coffee maker")
  2. SA → User:                Confirms intent and collects CP preference + shipping address

Phase 2: Product Discovery
  3. SA → CP:                  Queries Credentials Provider for available payment methods
  4. SA → Merchant:            Presents shopping intent
  5. Merchant → SA:            Creates and signs Checkout Mandate(s) with product offers

Phase 3: User Confirmation
  6. SA → User:                Displays final cart + payment options
  7. User → SA:                Reviews cart, selects payment method, confirms on trusted device surface

Phase 4: Payment Processing
  8. SA → Merchant:            Sends confirmed Checkout Mandate + user attestation
  9. Merchant → MPP:           Submits payment for processing
  10. MPP:                     Constructs Payment Mandate and requests credentials from CP

Phase 5: Completion
  11. MPP → Merchant → SA → User: Payment processed, receipt delivered

Agent Interactions (A2A Messages)

Each step involves A2A protocol communication:

User Touchpoints

The user is involved at these critical points:

Trusted Device Surface

Step 7 is a load-bearing security step:

Challenge Handling

During the flow, any participant may trigger a challenge:

Implementation Considerations

Best Practices

Fetch the specification and sample implementations for exact message formats, mandate structures at each step, and agent communication patterns before implementing.

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.