Agentic AI

Agentic Commerce Explained: How AI Agents Shop and Pay (AP2, ACP, UCP and UPI)

Short answer

Agentic commerce is AI agents shopping and paying on a person's behalf, within limits that person sets. Several open protocols handle different layers: UCP (Google and retailers) and ACP (OpenAI and Stripe) cover shopping and checkout, AP2 (Google, now at the FIDO Alliance) proves what the user authorised with signed mandates, and cards, UPI or x402 move the money. The golden rule: the AI proposes, but signatures and plain code approve the payment. In India, agent UPI payments exist in pilots, and NPCI is still examining a framework.

"Order my usual groceries, keep it under Rs 1,500, and pay with UPI." A person can say that to an assistant in five seconds. For an AI agent to actually do it, a lot has to be true. The agent must find the products, build a cart, check out with a shop it has never seen and pay. And everyone involved, from the shop to the bank to the payment network, needs proof that you agreed to it.

That is agentic commerce, and in the last year it has gained its own alphabet: ACP from OpenAI and Stripe, AP2 from Google (now at the FIDO Alliance), UCP from Google and large retailers, and x402 for machine payments. In India there is a parallel story about AI agents paying through UPI.

In this guide I explain what agentic commerce is, how these protocols fit together, how AP2's mandates prove what a user authorised, and where India stands. You also get a tested Python example with real output. It shows a signed spending mandate stopping a hijacked agent, a changed amount, a look-alike shop and an expired authorisation. If you are new to agent protocols, read MCP Explained first. This post builds on it.


What is agentic commerce?

Agentic commerce is shopping where an AI agent does the work on a person's or business's behalf: it searches for products, compares options, builds a cart, checks out and pays, within limits the person has set. The human gives the goal and the boundaries. The agent carries out the steps.

It is different from what most shopping chatbots do today. A chatbot recommends a product and hands you a link, and you still click "buy". In agentic commerce the agent completes the purchase itself. Sometimes you confirm the final step ("human present"). Sometimes you pre-approve a rule and are not there at all ("human not present"), for example "buy concert tickets the moment they go on sale, up to Rs 6,000".

That second case breaks an assumption that every payment system is built on: a human clicked "buy" on a trusted website. When software clicks instead, three questions need new answers:

  • Authorisation: how does the bank know the user really gave the agent this authority, for this purchase?
  • Authenticity: how does the merchant know the request reflects what the user wanted, and not an AI mistake or an attack?
  • Accountability: if the agent buys the wrong thing, who pays: the user, the agent's developer, the merchant or the bank?

The new protocols exist to answer those three questions in a standard way, so every agent does not need a custom deal with every shop and bank.

What are ACP, AP2, UCP and x402?

They are open protocols for different layers of the same purchase. UCP and ACP cover shopping and checkout between an agent and a merchant. AP2 proves what the user authorised for the payment. x402 lets agents pay for things over HTTP, usually in stablecoins. They mostly complement each other rather than compete.

The agentic commerce protocol stack. At the top, a user gives an AI agent a goal and limits. The agent is built with any framework, uses MCP for tools and A2A to talk to other agents. Layer 1, shopping and checkout: UCP from Google with retailers, covering catalog, cart, checkout and orders, and ACP from OpenAI and Stripe, covering checkout in ChatGPT. Layer 2, payment authorisation: AP2, now at the FIDO Alliance, with signed checkout and payment mandates. Layer 3, payment rails: cards, UPI and bank transfers, and stablecoins through x402. India's NPCI is examining an agent protocol for UPI.
Shopping and checkout, then proof of authorisation, then the rails that move the money. Tap to enlarge.
ACPUCPAP2x402
Full nameAgentic Commerce ProtocolUniversal Commerce ProtocolAgent Payments ProtocolNamed after HTTP status 402, "Payment Required"
Started byOpenAI and Stripe, September 2025Google with Shopify, Etsy, Wayfair, Target and Walmart, January 2026Google, September 2025; donated to the FIDO Alliance in April 2026Coinbase, 2025
LayerCheckout between an AI app and a merchantThe whole shopping journey: catalog, cart, checkout, identity linking, ordersPayment authorisation and audit trailPayment over HTTP
Key ideaA standard checkout API, with payment through a shared payment tokenMerchants publish a machine-readable profile at /.well-known/ucp and stay the merchant of recordSigned mandates prove what the user agreed toA server replies "402", and the agent pays and retries
Best forSelling to shoppers inside ChatGPTSelling to agents in Google AI Mode, Gemini and other platformsAny agent payment that needs proof of consentPay-per-call APIs, data and agent-to-agent payments

Two details matter when you read older articles:

  • ACP changed course in March 2026. OpenAI said the first version of Instant Checkout inside ChatGPT did not give merchants enough flexibility. Checkout moved towards merchants' own checkouts and apps, and ChatGPT focused on discovery through product feeds. The ACP specification itself remains an open standard.
  • AP2 renamed its mandates in v0.2. Early explainers talk about "intent" and "cart" mandates. Version 0.2 (April 2026) uses a checkout mandate and a payment mandate, each with an open and a closed form. I use the current names below.

The pattern is the same as in agent tooling, where MCP connects agents to tools and A2A connects agents to each other. UCP explicitly lists AP2, A2A and MCP support, and AP2 is available as an extension for A2A and UCP.

How do AP2 mandates work?

A mandate is a tamper-evident, cryptographically signed record of what was authorised. AP2 chains them together: the user's limits, the exact cart the merchant agreed to sell and the exact payment. Anyone in the chain can check that each step stayed inside the one before it.

AP2 v0.2 defines two kinds of mandate, each in two stages:

MandateOpen (before the cart exists)Closed (for one specific purchase)Shared with
Checkout mandateThe user's goals and constraints, such as "groceries from these shops"Authorisation for one finalised checkoutThe merchant
Payment mandateLimits on payment, such as a budget and allowed instrumentsAuthorisation for one amount, bound to that checkoutThe credential provider, the network and the merchant's payment processor

The mandates are carried as verifiable digital credentials: signed objects that cannot be changed without breaking the signature. Here is the flow when the human is not present:

How AP2-style mandates work. Step 1: the user signs an open mandate once, with allowed merchants, categories, a per-order limit, the payment instrument and an expiry. Step 2: the agent shops and the merchant signs the cart at its price. Step 3: the agent creates a closed mandate bound to that exact cart and amount. Step 4: the payment processor checks every signature and every limit in code and approves or blocks. Step 5: the signed chain becomes the audit trail for disputes. The language model never holds payment credentials and never makes the final approval.
The agent proposes; signed records and deterministic checks decide. Tap to enlarge.
  1. The user signs an open mandate once, on their own device: allowed merchants, categories, a per-order limit, the payment instrument and an expiry date.
  2. The agent shops. The merchant signs the cart it is willing to sell, at its price.
  3. The agent closes the mandate for that exact cart and amount.
  4. The payment side checks the chain: every signature, and that the closed mandate stays inside the open one. If anything fails, there is no payment.
  5. The signed chain becomes the audit trail. If there is a dispute, everyone can see what was authorised, by whom and when.

The most important design choice is what is not in this list: the language model never holds the payment credentials and never makes the final approval. It can be tricked, so it only proposes. Signatures and plain code decide.

How do you build a mandate check in Python?

To make this concrete, I built a small version of the flow above. A user signs an open mandate for weekly groceries: one allowed shop, the groceries category, a Rs 1,500 per-order limit, UPI as the instrument and a 7-day expiry. A merchant signs carts. An agent closes mandates. A payment processor checks all of it in plain code, with no LLM involved.

It uses only the Python standard library. HMAC keys stand in for the public-key signatures AP2 uses with verifiable credentials. That keeps the example short, and the checks are the same idea. No real money moves.

"""Agent payments with mandates, AP2-style: the user signs limits once, every purchase is checked against them.

Run:  python3 mandates_demo.py   (standard library only, no API key, no real money)
HMAC keys stand in for the verifiable credentials (public-key signatures) that AP2 uses. The checks are the point.
"""
import hashlib, hmac, json
from datetime import datetime, timedelta

NOW = datetime(2026, 11, 26, 10, 0)
KEYS = {"user": b"user-device-key", "agent": b"shopping-agent-key", "merchant:freshbasket": b"freshbasket-key"}

def sign(party, payload):
    body = json.dumps(payload, sort_keys=True).encode()
    return {"payload": payload, "signer": party, "sig": hmac.new(KEYS[party], body, hashlib.sha256).hexdigest()}

def verify(doc):
    key = KEYS.get(doc["signer"])
    body = json.dumps(doc["payload"], sort_keys=True).encode()
    return key is not None and hmac.compare_digest(doc["sig"], hmac.new(key, body, hashlib.sha256).hexdigest())

def digest(doc):
    return hashlib.sha256(json.dumps(doc, sort_keys=True).encode()).hexdigest()[:16]

# ---------- 1. The user signs an OPEN mandate once: what the agent may buy, where, up to how much ----------
open_mandate = sign("user", {
    "type": "open_payment_mandate",
    "goal": "Weekly groceries",
    "merchants": ["freshbasket"],                     # allowlist
    "categories": ["groceries"],
    "max_per_order_inr": 1500,
    "instrument": "UPI",
    "expires": (NOW + timedelta(days=7)).isoformat(),
})

# ---------- 2. The merchant signs the cart it is willing to sell, at its price ----------
def merchant_cart(merchant, items):
    total = sum(qty * price for _, qty, price, _ in items)
    return sign(f"merchant:{merchant}", {"merchant": merchant, "total_inr": total,
                "items": [{"name": n, "qty": q, "price": p, "category": c} for n, q, p, c in items]})

# ---------- 3. The agent turns the open mandate into a CLOSED one for this exact cart ----------
def close_mandate(open_m, cart):
    return sign("agent", {"type": "closed_payment_mandate", "open_mandate": digest(open_m),
                          "cart": digest(cart), "merchant": cart["payload"]["merchant"],
                          "amount_inr": cart["payload"]["total_inr"], "instrument": "UPI"})

# ---------- 4. The payment processor checks the whole chain in code. No LLM involved. ----------
def authorise(open_m, cart, closed, now=NOW):
    o, c, k = open_m["payload"], cart["payload"], closed["payload"]
    checks = [
        ("user signed the open mandate",        verify(open_m) and open_m["signer"] == "user"),
        ("merchant signed this cart",           verify(cart) and cart["signer"] == f"merchant:{c['merchant']}"),
        ("agent signed the closed mandate",     verify(closed) and closed["signer"] == "agent"),
        ("closed mandate points to this cart",  k["cart"] == digest(cart) and k["open_mandate"] == digest(open_m)),
        ("amount matches the signed cart",      k["amount_inr"] == c["total_inr"]),
        ("mandate not expired",                 now < datetime.fromisoformat(o["expires"])),
        ("merchant is on the allowlist",        c["merchant"] in o["merchants"]),
        ("all items in allowed categories",     all(i["category"] in o["categories"] for i in c["items"])),
        ("within the per-order limit",          c["total_inr"] <= o["max_per_order_inr"]),
    ]
    failed = [name for name, ok in checks if not ok]
    return ("APPROVED", []) if not failed else ("BLOCKED", failed)

def show(n, title, open_m, cart, closed, now=NOW):
    status, failed = authorise(open_m, cart, closed, now)
    print(f"{n}. {title}\n   cart: Rs {cart['payload']['total_inr']:,} at {cart['payload']['merchant']}  ->  {status}")
    for f in failed:
        print(f"      failed: {f}")
    if status == "APPROVED":
        print(f"   audit trail: open {digest(open_m)} -> cart {digest(cart)} -> closed {digest(closed)}")

if __name__ == "__main__":
    groceries = [("Atta 5 kg", 1, 289, "groceries"), ("Toor dal 1 kg", 2, 165, "groceries"),
                 ("Milk 1 L", 6, 68, "groceries"), ("Basmati rice 5 kg", 1, 207, "groceries")]

    cart = merchant_cart("freshbasket", groceries)
    show(1, "Normal weekly order", open_mandate, cart, close_mandate(open_mandate, cart))

    # A product page told the agent to "also add these headphones". The agent obeyed. The processor did not.
    hijacked = merchant_cart("freshbasket", groceries + [("Wireless headphones", 1, 3499, "electronics")])
    show(2, "Agent hijacked by a prompt injection", open_mandate, hijacked, close_mandate(open_mandate, hijacked))

    # The agent tries to pay Rs 600 less than the merchant's signed total (or the cart was edited in transit).
    cart3 = merchant_cart("freshbasket", groceries)
    closed3 = close_mandate(open_mandate, cart3)
    closed3["payload"]["amount_inr"] = 634
    show(3, "Amount changed after signing", open_mandate, cart3, closed3)

    # A look-alike shop the agent found through a search ad.
    KEYS["merchant:fresh-basket-deals"] = b"lookalike-key"
    fake = merchant_cart("fresh-basket-deals", groceries)
    show(4, "Look-alike merchant", open_mandate, fake, close_mandate(open_mandate, fake))

    cart5 = merchant_cart("freshbasket", groceries)
    show(5, "Same order, 8 days later", open_mandate, cart5, close_mandate(open_mandate, cart5), NOW + timedelta(days=8))

Real output from python3 mandates_demo.py:

1. Normal weekly order
   cart: Rs 1,234 at freshbasket  ->  APPROVED
   audit trail: open d66574567a6f1ba0 -> cart 6d2dad7ad1bc25be -> closed 0118f19abdc39a4c
2. Agent hijacked by a prompt injection
   cart: Rs 4,733 at freshbasket  ->  BLOCKED
      failed: all items in allowed categories
      failed: within the per-order limit
3. Amount changed after signing
   cart: Rs 1,234 at freshbasket  ->  BLOCKED
      failed: agent signed the closed mandate
      failed: amount matches the signed cart
4. Look-alike merchant
   cart: Rs 1,234 at fresh-basket-deals  ->  BLOCKED
      failed: merchant is on the allowlist
5. Same order, 8 days later
   cart: Rs 1,234 at freshbasket  ->  BLOCKED
      failed: mandate not expired

What the output shows

  • The normal order goes through. Rs 1,234 of groceries from the allowed shop, inside the limit. The three hashes form the audit trail that links the open mandate, the signed cart and the closed mandate.
  • A hijacked agent is stopped by the rules, not by the model. In test 2 the agent "obeyed" a product page telling it to add Rs 3,499 headphones. The processor blocked it twice: wrong category and over the limit. This is the same lesson as in prompt injection defence: assume the model can be fooled and enforce limits outside it.
  • Nothing can be changed after signing. In test 3 the payment amount was edited to Rs 634 after the agent signed. The signature no longer matched, and the amount no longer matched the merchant's signed cart.
  • Look-alike shops fail the allowlist. A "fresh-basket-deals" store found through an ad has a valid signature of its own, but it is not a merchant the user approved.
  • Authority expires. The same valid order eight days later is blocked, because the user approved seven days.

What changes in production

Real AP2 uses public-key signatures, so the processor can verify without holding anyone's secret. The user's mandate is signed on their device, often with a passkey or biometric. Credential providers hold the payment details, so neither the agent nor the merchant sees the raw card or account. The structure, though, is the one above. If you build agents, take three rules from it into your own agent harness: keep payment credentials out of the model's reach, make the payment step deterministic code, and log a signed record of what was approved.

Can AI agents make UPI payments in India?

In pilots and with one-time approvals, yes. As a general, standing permission for any agent, not yet. NPCI has said it is examining protocols to identify and authorise agents on UPI, but as of November 2026 there is no published framework.

Here is what is public, separated into what is live and what is announced:

DevelopmentWhat it isStatus
UPI payments inside ChatGPTA pilot by NPCI, Razorpay and OpenAI, with the user approving each paymentPilot announced in October 2025
Pine Labs P3PA protocol for agent UPI payments after one upfront authorisationAnnounced by Pine Labs in 2026
Amazon Pay Smart WalletA consent-based wallet for agent UPI paymentsLaunched at Global Fintech Fest 2026; whether third-party agents can use it was not stated
NPCI agent protocol ("Unified Agent Protocol" in reports)A way to register, identify and authorise AI agents on UPIReported in July 2026; described by NPCI's chairman in September 2026; no public specification or date
UPI in AP2Support for "push" payments such as UPI and PIXOn AP2's roadmap; the current version focuses on cards and x402

The clearest statement of direction came at Global Fintech Fest in Mumbai on 10 September 2026. NPCI chairman Ajay Kumar Choudhary said decision making and execution must stay separate: AI may recommend, but authentication and final settlement must follow deterministic, auditable rules. In plain words, the agent can work out what you want; it should not be the thing that approves the payment. That is the same principle as AP2 and as the Python example above.

India also has a specific hurdle that global explainers miss. MediaNama's coverage of the keynote points out that existing e-mandate rules were built for periodic payments such as subscriptions and require a pre-debit notification in advance. That does not fit an agent buying a cab ride or a ticket in real time. Dispute rules also have no category for "the payment was authorised, but the agent mis-executed it". Expect new RBI and NPCI rules before standing agent payments on UPI become common. Treat any date you see before then as a forecast, not a fact.

Is agentic commerce safe?

It can be safer than handing an agent your card details, if the payment is bound to signed limits and checked outside the AI. It is risky when an agent can spend without limits, or when the AI itself makes the approval decision.

The main risks:

  • Prompt injection. A product page, review or email tells the agent to add items, change the delivery address or switch shops. Defence: hard limits and allowlists enforced in code, as in test 2. See Prompt Injection and AI Agent Security.
  • Look-alike merchants and fake listings. Defence: merchant allowlists, verified merchant identity (UCP profiles, signed carts) and no "pay anyone" mandates.
  • Mistakes without malice. Wrong size, wrong quantity, a hallucinated preference. Defence: human-present confirmation for anything above a small amount, and clear refund rules for agent orders.
  • Credential exposure. Never give the model card numbers, UPI PINs or bank logins. Credential providers and tokens exist so the agent never sees them.
  • Unclear liability. Rules for who absorbs a loss from an agent's mistake are still being written. Until they are, the signed mandate chain is your best evidence of what was and was not authorised.

What should merchants and D2C brands do now?

You do not need to pick a winning protocol today, but you do need to be readable by agents. The work that pays off whichever standard wins:

  • Clean, structured product data. Titles, variants, sizes, prices, stock and policies in machine-readable form. Agents cannot buy what they cannot parse.
  • Know where your platform stands. Shopify, Stripe, Adyen and others are adding UCP and ACP support. Ask your platform before building anything custom.
  • An agent-friendly checkout. Few surprise steps, clear delivery and return terms, and guest checkout where possible.
  • Policies for agent orders. Returns, cancellations and disputes when the buyer was an agent acting for a customer.
  • Fraud rules that recognise agents. Today's bot defences may block good agents. Plan how you will tell a verified agent from a scraper.
  • Track agent traffic separately, so you can see conversion and returns from AI assistants as a channel.

What should developers building agents do?

RuleWhy
Keep payment credentials out of the model's contextAnything in the context can be leaked by a prompt injection
Make the payment step plain code with signed inputsThe model proposes; deterministic checks approve
Ask for explicit limits: amount, merchants, categories, expiryVague authority ("buy what I need") cannot be checked
Confirm with the human above a thresholdMost users want to see big purchases first
Log the signed chain for every transactionIt is your evidence in a dispute
Test with hostile inputs: injected pages, fake shops, edited cartsThese are the attacks that will actually happen

What are the most common mistakes?

  • Letting the LLM decide whether to pay. The model's job is to find and propose. Approval belongs to code and signed mandates.
  • Storing card or UPI details where the agent can read them. Use tokens and credential providers.
  • Open-ended authority. No expiry, no limit, no merchant list. Every mandate should be narrow and short-lived.
  • Treating the protocols as rivals. UCP or ACP for checkout and AP2 for authorisation are layers. Most stacks will use more than one.
  • Believing launch headlines. Several "launches" in this space were pilots or plans. Check whether something is live, piloted or only announced.
  • Skipping hostile testing. A payment agent that has only been tested on happy paths has not been tested.

Checklist: are you ready for agentic commerce?

  • Product data is structured: variants, prices, stock, delivery and return policies
  • You know which agentic protocols your commerce platform supports (UCP, ACP)
  • Checkout works without surprise steps and supports guest purchases
  • Return, cancellation and dispute policies cover orders placed by agents
  • Agent traffic and conversions are tracked as their own channel
  • Agents never see raw card numbers, UPI PINs or bank logins
  • Every agent payment is bound to explicit limits: amount, merchants, categories, expiry
  • The payment decision is deterministic code, not a model output
  • Purchases above a threshold need a human confirmation
  • A signed record links what the user approved, the cart and the payment
  • Prompt injection, look-alike merchants and edited carts are in the test suite
  • Someone owns tracking NPCI, RBI and protocol updates

Sources and further reading

Key takeaways

  • Agentic commerce is AI agents shopping and paying for people within limits those people set.
  • UCP and ACP handle shopping and checkout, AP2 proves what the user authorised, and x402, cards and UPI move the money. They are layers, not rivals.
  • AP2 uses signed checkout and payment mandates, open and closed, chained into an audit trail.
  • The model proposes; signatures and deterministic code approve. Never let the LLM hold credentials or make the final payment decision.
  • In India, UPI agent payments exist in pilots and with one-time approvals. NPCI is examining an agent protocol, and rules for standing mandates and disputes are still to come.
  • Merchants should start with structured product data and clear policies for agent orders, whichever protocol wins.

Frequently asked questions

What is agentic commerce?

Agentic commerce is shopping where an AI agent acts for a person or business: it searches, compares, builds a cart, checks out and pays, within limits the person has set. Unlike a shopping chatbot that only recommends a link, the agent completes the purchase.

What is the difference between AP2 and ACP?

ACP, from OpenAI and Stripe, is a checkout protocol between an AI app and a merchant. AP2, created by Google and now at the FIDO Alliance, is a payment authorisation protocol: it uses signed mandates to prove what the user agreed to. They cover different layers and can be used together.

What is the difference between UCP and AP2?

UCP, the Universal Commerce Protocol, covers the shopping journey between agents and businesses: catalog, cart, checkout, identity linking and orders. AP2 covers the payment authorisation inside that journey. UCP lists AP2 support as built in, alongside A2A and MCP.

What is a payment mandate in AP2?

A mandate is a signed, tamper-evident record of what was authorised. AP2 v0.2 has checkout mandates and payment mandates, each in an open form (the user's limits before a cart exists) and a closed form (authorisation for one specific checkout and amount). They are chained into an audit trail.

Can AI agents make UPI payments in India?

In pilots and with per-payment or one-time approvals, yes, for example the NPCI, Razorpay and OpenAI pilot in ChatGPT. As of November 2026 there is no published NPCI framework for standing agent permissions on UPI. NPCI has said it is examining protocols to identify and authorise agents.

What did NPCI say about AI agents and UPI?

At Global Fintech Fest 2026, NPCI chairman Ajay Kumar Choudhary said decision making and execution must remain separate: AI may recommend, but authentication and final settlement must follow deterministic, auditable rules.

What is x402?

x402 is an open payment protocol started by Coinbase that uses the HTTP 402 Payment Required status code. A server replies 402 with payment details, the agent pays, usually in stablecoins, and retries the request. It suits pay-per-call APIs and agent-to-agent payments.

Is agentic commerce safe?

It can be, if payments are bound to explicit signed limits and approved by deterministic code rather than the AI. The main risks are prompt injection, look-alike merchants, agent mistakes, exposed credentials and unclear liability.

Who is liable if an AI agent buys the wrong thing?

The rules are still being written. Protocols like AP2 create a signed record of what the user authorised, the cart and the payment, which is the evidence used to settle a dispute. In India, existing dispute rules do not yet have a category for an agent that mis-executes an authorised mandate.

What should merchants do to prepare for agentic commerce?

Publish clean, structured product data, check which protocols your commerce platform supports, keep checkout simple, write return and dispute policies for agent orders, and track agent traffic as a separate channel.


Plan agentic commerce with confidence

Agentic commerce will reach most businesses through their platforms before they build anything themselves. The teams that benefit first are the ones that get their product data, policies and agent guardrails right early. If you want help working out where agents fit in your buying or selling flow, or training your team on agent protocols and payment safety, let's talk.

Next read: Prompt Injection and AI Agent Security

Book a free call →