How to Test Agentic Checkout Before Launch
Short answer
Test agentic checkout as an API, not a web page. Before launch, prove that the merchant computes price and tax, that stock is rechecked at completion, that declines and payment timeouts never produce an order, that retries with the same idempotency key create exactly one order and charge, and that every session, order, and payment reconciles. Pin the UCP or ACP version you test against.
Key takeaways
- Agentic checkout is driven by API calls from a platform, so test it with scripted requests, fault injection, and record counts.
- Idempotency is the test most teams skip and the one that causes duplicate orders: retries are normal agent behavior.
- Stock and price must be rechecked at completion, not trusted from the feed or the session's creation time.
- Each protocol names statuses and errors differently, so the matrix must be pinned to one spec version.
- A passing test run shows your checkout works as designed; it does not show a platform will approve or route traffic to it.
What makes agentic checkout testing different from normal checkout QA?
In agentic checkout, a platform's agent calls your checkout API directly, so there is no page for a tester to click through. Testing means sending the requests the platform will send, injecting the failures it will meet, and checking the records left behind in your order system and payment provider.
- Agentic checkout
- A purchase completed by an AI platform calling the merchant's checkout through a protocol, with the buyer confirming in the AI interface or through a handoff.
- UCP
- Google's Universal Commerce Protocol, an open standard whose checkout capability defines create, get, update, complete, and cancel operations on a checkout session (ucp.dev).
- ACP
- The Agentic Commerce Protocol, an open specification for checkout sessions and delegated payment between buyers, their agents, and sellers (agenticcommerce.dev).
- Idempotency key
- A client-chosen identifier sent with a request so a retry of the same request returns the stored result instead of repeating the side effect.
Three things change compared with web checkout QA. First, the agent retries on timeouts, so duplicate requests are expected traffic, not an edge case. Second, the buyer sees what your API returns, so error messages are part of the user interface. Third, the platform handles part of the flow (consent, payment credential collection), so you can only test your half against the contract. For what the protocols themselves cover, read the UCP merchant guide and the ACP guide.
Which protocol version should the test plan target?
Target exactly one version per endpoint and write it into the test plan. Both protocols use date-based versions, and status names and fields have changed between releases.
| Protocol | What the documentation shows | Test-plan implication |
|---|---|---|
| UCP (ucp.dev) | Date-based YYYY-MM-DD versions; the specification overview examples use 2026-08-25. | Record the version your business profile declares and check status names against that version's checkout page. |
| UCP on Google surfaces | Google's latest-updates page lists 2026-01-23 and 2026-04-08 as launched versions for its guides. Google's FAQ recommends running a new spec version on a separate endpoint. | Keep one test run per endpoint/version pair. Re-run all blockers when you add a version. |
| ACP | Changelog lists 2025-09-29 (initial), 2025-12-12, and 2026-01-30. The 2026-01-30 release replaced payment method identifiers with structured payment handlers, a breaking change. | Send the API-Version header in every test request and fail the test if the response shape does not match that version. |
What should an agentic checkout test matrix include?
The matrix below is the core of the plan: eight areas, each with the scenarios that most often fail, the pass condition, and the evidence to keep. The full 59-row version, with preconditions and protocol applicability on every row, is the downloadable agentic checkout test plan.
| Area | Scenario | Pass condition | Evidence | Severity |
|---|---|---|---|---|
| Tax | Taxable US destination | Tax line equals the tax engine quote for the same cart | Session response next to the tax adapter log | Blocker |
| Tax | Address changes state | Tax recalculated; old value not carried over | Two responses side by side | High |
| Tax | Tax engine timeout | Session not completable; clear message; never zero tax by default | Adapter error log, session status | Blocker |
| Tax | Exempt B2B buyer | Exemption applied only with a linked identity that carries it | Identity link record | Medium |
| Shipping | Valid address | At least one priced option; selection reflected in totals | Response | Blocker |
| Shipping | Undeliverable address | address_undeliverable (UCP) or equivalent; no completable state | Response | High |
| Shipping | Ground-only item with express | Option withheld or rejected with the policy reason | Response, policy ID | High |
| Shipping | Per-item fulfillment | Each line keeps its own option where the version supports it (ACP 2025-12-12 added selected_fulfillment_options[]) | Order record | Medium |
| Variants | Checkout by variant ID | Exact SKU and its price; parent ID alone rejected where a variant is required | Response, catalog mapping | Blocker |
| Variants | Feed ID round trip | 20 random feed variant IDs all resolve at checkout | Script output | High |
| Variants | Deleted variant | Item-level message, not a 5xx | Response | High |
| Variants | Quantity limits | Over-max or wrong increment is rejected or revised with a message | Response messages | Medium |
| Declines | Card declined | payment_declined / payment_failed message; no order | PSP sandbox decline ID | Blocker |
| Declines | 3DS / authentication required | Escalation or authentication_required state; no order until resolved | PSP log | High |
| Declines | Token over its amount limit | Charge refused; no partial order | PSP error | High |
| Declines | PSP timeout | Never reported completed without confirmed payment | Retrieve response, PSP record | Blocker |
| Idempotency | Same key, same body, twice | One order, one charge, identical responses | Order and charge counts | Blocker |
| Idempotency | Same key, different body | Conflict (UCP: 409; ACP: request_not_idempotent) | Response, order count | Blocker |
| Idempotency | Parallel duplicates | Exactly one order | Lock/idempotency store log | Blocker |
| Idempotency | Timeout after commit, then retry | Retry returns the original order | Order count | Blocker |
| Confirmation | Synchronous complete | completed with an order ID; session immutable afterwards | Response | Blocker |
| Confirmation | Asynchronous complete | complete_in_progress, then completed on retrieve | Timed response sequence | High |
| Confirmation | Order webhook | Signed, delivered once per event, retried on failure, acknowledged | Delivery log | High |
| Confirmation | Buyer email | Sent once; matches order totals | Captured email | High |
| Cancellation | Cancel open session | canceled; later updates refused | Responses | High |
| Cancellation | Cancel completed session | Refused; order untouched | Response, order status | High |
| Cancellation | Merchant cancels order | Order event with canceled state; refund per policy | Webhook payload, refund record | High |
| Cancellation | Reservation release | Reserved stock returned on cancel or expiry | Inventory before/after | Medium |
| Reconciliation | Session ↔ order ↔ payment join | Zero orphans in any direction | Reconciliation report | Blocker |
| Reconciliation | Totals to the cent | Session, order, and captured amounts agree | Difference report | High |
| Reconciliation | Channel attribution | Agentic orders distinguishable by source and platform | Order query | Medium |
How do we test out-of-stock and payment failures?
Test both by making them happen at the worst moment: after the session was created and before completion. Out-of-stock at creation is easy; out-of-stock at completion, after another channel sold the last unit, is the case that creates oversells.
- 1
Set stock to 1 on a synthetic variant
Create a checkout session for it and bring it to the ready state (UCP
ready_for_complete, ACPready_for_payment). - 2
Sell the unit elsewhere
Place an order for the same variant through the website or the OMS directly.
- 3
Complete the agentic session
Expect an
out_of_stockmessage and no order. Check the PSP sandbox: there must be no capture, and any authorization must be voided. - 4
Repeat for payment
Use the PSP's decline test instruments, a 3DS-required instrument, an expired delegated token, and an injected PSP timeout. For each, the session must not report
completed, and the order count must not change. - 5
Check the message the buyer would see
The protocol message is what the agent relays. It should say what happened and what the buyer can do, without exposing internal error text.
Stock correctness depends on how fresh your inventory data is before checkout even starts. If your channel copy of stock lags the source of truth, fix that first: see inventory sync with webhooks, retries, and reconciliation.
How do we prevent duplicate orders from retries?
Store the idempotency key with a hash of the request body and the response, inside the same transaction that creates the order, and return the stored response for any repeat of that key. Then test it with sequential repeats, parallel repeats, and a timeout injected after the order is written.
The protocols set the rules you test against. UCP's checkout capability says that when a platform cannot establish whether a completion was processed, it retries with the same idempotency key and must not use a new key for that retry. It also says platforms should check state with Get Checkout using bounded backoff instead of calling Complete again. UCP's specification lists a 409 error for an idempotency key reused with a different payload. ACP defines an optional Idempotency-Key header and a request_not_idempotent error type.
async function completeCheckout(req: Req, db: Db): Promise<Res> {
const key = req.headers['idempotency-key'];
if (!key) return error(400, 'missing_idempotency_key'); // your policy; the header is optional in ACP
const bodyHash = sha256(canonicalJson(req.body));
return db.transaction(async (tx) => {
// Unique index on (merchant_id, idem_key). Second writer blocks here.
const prior = await tx.one(
'SELECT body_hash, response FROM idem WHERE idem_key = $1 FOR UPDATE', [key]);
if (prior) {
if (prior.body_hash !== bodyHash) return error(409, 'idempotency_key_reused');
return prior.response; // replay the stored result, do not re-charge
}
const session = await loadSession(tx, req.params.id);
await revalidateStockAndPrice(tx, session); // fail with out_of_stock if needed
const payment = await psp.authorize(session, { idempotencyKey: key });
const order = await createOrder(tx, session, payment);
const response = { status: 'completed', order: { id: order.id } };
await tx.none('INSERT INTO idem (idem_key, body_hash, response) VALUES ($1,$2,$3)',
[key, bodyHash, response]);
return response;
});
}Two details matter in the sketch. The key is passed through to the payment provider, so a retry that reaches the PSP is deduplicated there too. And the idempotency row is written in the same transaction as the order, so there is no window where the order exists but the key does not. In a real system the PSP call usually sits outside the database transaction; then you need a pending state and a reconciliation job to settle it, which is why reconciliation is a separate test area.
How do we build a test harness for agentic checkout?
Build a small script-driven harness that plays the platform role: it sends protocol requests to staging, injects faults through adapter flags, and asserts on responses and database counts. You do not need a language model in the loop to test the checkout contract.
test('CT-080 same key twice creates one order', async () => {
const s = await platform.createCheckout({ line_items: [{ id: 'SYN-TEE-BLU-M', quantity: 1 }] });
await platform.updateCheckout(s.id, { buyer: SYN_BUYER, fulfillment: SYN_ADDRESS });
const key = crypto.randomUUID();
const body = { payment: SANDBOX_INSTRUMENT };
const [a, b] = await Promise.all([
platform.complete(s.id, body, { idempotencyKey: key }),
platform.complete(s.id, body, { idempotencyKey: key }),
]);
expect(a.order.id).toBe(b.order.id);
expect(await db.count('orders', { checkout_id: s.id })).toBe(1);
expect(await pspSandbox.countCharges({ metadata: { checkout_id: s.id } })).toBe(1);
});- Fixtures: synthetic products for each variant shape, stock levels of 0, 1, and plenty, addresses inside and outside your service area, and the PSP's documented sandbox instruments.
- Fault flags: per-adapter switches for timeout, 5xx, and slow responses on tax, shipping, inventory, and payment.
- Assertions on records: order count, charge count, inventory deltas, and webhook deliveries, not just the HTTP status.
- Edge path: run at least the access rows through your real CDN and WAF. Google's UCP network guide warns that allowlists in a network firewall often do not exempt requests from downstream rate limiters or bot management; see why AI agents get blocked by your firewall.
How do we test order confirmation and cancellation?
Test confirmation as a sequence: the completion response, the order webhook to the platform, and the buyer email must all describe the same order once. Test cancellation from both sides: the platform canceling an open session, and the merchant canceling an order after completion.
- UCP's checkout capability says a completed checkout carries the
orderand is then treated as immutable, and that the platform must not treat a checkout as canceled unless the business reportsstatus: canceled. Test that a cancel on a completed session returns an error and leaves the order intact. - Google's UCP latest-updates page notes that order lifecycle webhooks for its
2026-04-08guides require aWebhook-Idheader and define acknowledgment and retry rules. Test that your receiver and sender both handle a first-attempt failure and a duplicate delivery. - Post-completion changes (merchant cancel, refund, partial shipment) must produce order events the platform can show the buyer. Check amounts against the PSP refund record.
How do we reconcile agentic orders after testing?
Run a reconciliation query after every test cycle that joins checkout sessions, orders, and payment records, and fail the run on any orphan. Reconciliation catches the failures that individual tests miss, such as a charge created by a timed-out request that no order references.
-- Charges with no order
SELECT p.psp_payment_id FROM payments p
LEFT JOIN orders o ON o.payment_id = p.psp_payment_id
WHERE o.id IS NULL AND p.status IN ('authorized','captured');
-- Sessions reported completed with no order
SELECT s.id FROM checkout_sessions s
LEFT JOIN orders o ON o.checkout_id = s.id
WHERE s.status = 'completed' AND o.id IS NULL;
-- Amount mismatches
SELECT o.id, s.total_minor, o.total_minor, p.amount_minor FROM orders o
JOIN checkout_sessions s ON s.id = o.checkout_id
JOIN payments p ON p.psp_payment_id = o.payment_id
WHERE NOT (s.total_minor = o.total_minor AND o.total_minor = p.amount_minor);Which tests must pass before an agentic checkout launch?
All blockers, twice: once in staging with fault injection and once against production configuration with sandbox or minimal real transactions as the platform allows. In the downloadable plan, 21 of 59 rows are blockers.
| Gate | Must be true | Who signs off |
|---|---|---|
| Contract | Every request and response validates against the pinned spec version | Developer |
| Money | Zero duplicate orders or charges; zero charges without orders; totals reconcile to the cent | Developer and finance |
| Stock and price | Completion rechecks both; no oversell in the stock-race test | Developer and ecommerce operations |
| Edge | Platform traffic passes CDN/WAF without challenges; unauthenticated calls refused | Developer and security |
| Operations | Order events, cancellations, and refunds reach the platform; runbook for rollback tested | Ecommerce operations |
If you want this built and tested as one scoped project, our agentic checkout integration service starts with an eligibility check, because many merchants are better served by the native checkout their platform already supports. Teams on custom stacks can also see the headless commerce platform page.
Frequently asked questions
Can we test agentic checkout without access to the AI platform?
Yes, for your side of the contract. A harness that sends protocol requests to your staging endpoints covers sessions, pricing, tax, payments, idempotency, and reconciliation. The platform's own consent screens, payment credential flow, and onboarding checks can only be tested through the platform's sandbox or onboarding process.
What is the most common agentic checkout bug?
We do not have measured data across merchants, so we will not claim a frequency. In design reviews, the gaps we look for first are missing idempotency on completion and stock that is not rechecked at completion, because both cost money and are invisible in happy-path testing.
Do we need idempotency if the Idempotency-Key header is optional?
ACP lists the header as optional, but your system still has to survive retries. Use the key when it is sent, and protect completion with your own deduplication, for example on checkout session ID plus state, when it is not.
How do we test 3DS and strong customer authentication?
Use your PSP's sandbox instruments that require authentication. The session should move to the protocol's escalation or authentication state, and no order should exist until the authentication completes.
Should tests run against production?
Run the full suite in staging with synthetic data. Against production, run only the access and configuration checks and whatever test transactions the platform and PSP permit, then reconcile and refund them.
How often should we re-run the checkout tests?
Run the automated blockers on every deploy. Re-run the full plan when you change the protocol version, payment provider, tax engine, shipping rules, or catalog adapter.
Is the test plan a certification?
No. It is a planning template. Platforms run their own onboarding and review, and nobody can certify an integration against our file.
Plan your checkout build and test cycle
Tell us your platform, PSP, tax engine, and which AI surfaces you are eligible for. We check eligibility first, then scope the build and its tests.
Related
- Agentic Checkout Test Plan (CSV)The 59-row matrix behind this guide.
- Agentic Checkout & Payment IntegrationScoped checkout builds with eligibility checks.
- Agentic Payments: AP2, ACP & UCPHow payment authorization fits into checkout.
- UCP Integration ChecklistWhat to build before you test.
- Inventory Sync: Webhooks, Retries & ReconciliationKeep stock correct before checkout starts.
Sources
- UCP specification: checkout capability
- UCP specification overview
- Agentic Commerce Protocol: Checkout API reference
- Agentic Commerce Protocol: changelog
- Google: UCP FAQ
- Google: UCP latest updates
- Google: UCP network and WAF configuration
Platform capabilities, eligibility, and specifications change. Sources were checked on 2026-11-29; confirm the current primary documentation before scoping an implementation. See our editorial policy and methodology.