Skip to content
New

Shopify launched Agentic Storefronts. We make AI agents recommend you - not just list you.

See the Shopify integration
Tru Commerce

← Insights

Building AI commerce agents: checkout and recovery

Build AI commerce agents around approved offers, authoritative order states and reliable recovery. Review UCP completion, retries, idempotency and tests.

Tru Commerce Team · November 26, 2026 · ChatGPT Apps & MCP

Building an AI commerce agent means connecting a shopper's request to a controlled commercial operation. The hard boundary is the transition from discussing an offer to placing an order. A useful implementation preserves the approved offer, checks authoritative state after uncertainty and gives the customer an accurate result.

Reviewed 26 November 2026. Tru Commerce builds commerce integrations. This guide combines current protocol documentation with proposed engineering acceptance tests; it does not report a benchmark or customer conversion lift.

Start with the order the merchant can verify

Define success before selecting a model or framework. A product recommendation, a cart, a payment authorization and an accepted merchant order are different records. Decide which system establishes each state and how the integration refers to it.

For example, a shopper may approve a particular size and delivered total. The system should be able to identify that offer later, including the variant, quantity, currency, delivery choice and conditions. A general conversation summary is not a reliable replacement for the commercial record.

The action layer should expose a narrow task and retain the service's own validation. Avoid giving a model a broad administrative endpoint simply because that endpoint already exists. The MCP pilot acceptance checklist provides the wider release framework; this guide focuses on checkout and recovery.

Separate the tool contract from the checkout state

MCP describes tools through names, descriptions and input schemas, with optional output schemas. The server must return structured results conforming to an output schema when it provides one. It distinguishes protocol errors from tool-execution errors, allowing a tool to explain an invalid input or business failure without pretending the request completed successfully. MCP tools specification

That contract describes how a caller interacts with a tool. It does not decide which offer the merchant will honor, who owns an order or whether a payment has completed. Those decisions belong to the underlying commerce system and the supported checkout protocol.

Keep search, offer preparation, approval and commitment recognizable in the tool surface. A tool called “buy” that merely creates a checkout link makes both the model and the operator's job harder. Name and return the actual state rather than the intended eventual outcome.

Use the current protocol's states

UCP defines the states below; accepted asynchronous processing is not a completed order. UCP checkout lifecycle

UCP stateMeaning to retain in the integrationCustomer-facing implication
incompleteRequired information or an issue remainsExplain the missing step
requires_escalationBuyer input or review requires handoffUse the supported continuation route
ready_for_completeThe session can proceed to completionDo not report an order yet
complete_in_progressCompletion accepted, processing outstandingReport processing rather than confirmation
completedOrder placed, order information presentShow the confirmed order reference
canceledSession invalid or expiredRe-establish the offer if continuing

These are UCP names, not a universal vocabulary for every provider. Map other integrations from their own documented states. Do not infer equivalence from a similar-looking status label, and record the API version used in the acceptance test.

Preserve the approval boundary when the offer changes

A stock change or new delivery choice can alter the item or total after the first recommendation. The integration should distinguish updating the proposal from committing it. The customer needs to review the offer that will actually be executed under the applicable client and checkout requirements.

Store an offer reference or version with the approval record. If the service changes the material terms, do not silently reuse an approval for the previous offer. Make the changed terms visible and follow the integration's required review path.

This is especially important when the conversation spans multiple requests. A request for “the cheaper one” may help choose a candidate, but it should resolve to an explicit item and offer before execution. Our agentic checkout overview separates these commercial responsibilities from discovery.

A timeout is an uncertain result

Consider a controlled test in which the merchant accepts an order but the connection closes before the agent receives the response. The client knows that its request timed out. It does not yet know whether the order exists.

The recovery path should identify the original logical operation and ask the authoritative service for its current state. It should not create a second checkout simply to get a fresh response. Nor should it tell the customer that the purchase failed before establishing the result.

UCP specifically directs clients to retrieve checkout state with bounded backoff after a missing completion response. Polling must stop at expires_at; Complete Checkout is not a polling operation. Only if state retrieval still cannot establish the original outcome may the identical original completion request be retried with the same key. A genuinely new completion after returning to ready_for_complete requires a fresh key. UCP completion operations

The implementation needs a time budget and an escalation route. When that budget is exhausted, preserve the unresolved operation for follow-up and communicate uncertainty. A truthful pending result is preferable to inventing confirmation or launching a duplicate purchase.

Idempotency belongs to a logical operation

Idempotency lets a service recognize a repeat of the same request. It should not be treated as a random string added independently to every network attempt. A retry must retain the identity of the original operation under the provider's documented rules.

Stripe's current documentation distinguishes API v1 and API v2 behavior. API v1 returns the saved first result after execution begins, including a saved server error; API v2 describes different recovery semantics for failed or partially failed work. The documentation also states provider-specific key retention and parameter checks. Stripe idempotent requests

For your integration, record the provider, API version, logical operation reference and applicable key policy. A universal “retry all server errors” rule loses those distinctions. Changing the payload or using a new key can turn an attempted recovery into a new operation.

Do not put personal information into keys or general diagnostic logs. Use an internal correlation reference that authorized operators can resolve to the operational record when needed.

Webhooks update state; they do not remove reconciliation

An asynchronous event can arrive after the shopper leaves the conversation. The integration should process it against the original order or payment record and retain a reproducible transition history.

Stripe documents duplicate deliveries and does not guarantee event ordering. Its guidance includes recording processed event IDs and retrieving relevant objects when necessary. Treat these as documented behavior of that service, and verify the corresponding contract for other providers. Stripe webhook delivery behavior

Test duplicate delivery and out-of-order arrival separately. The first should not trigger duplicate fulfillment or duplicate customer communication. The second should not move a confirmed record backward merely because an older event arrived later.

A payment event and a fulfillment decision may belong to different systems. Record what each event establishes rather than allowing a convenient label to stand for the whole purchase journey. The attribution tools comparison explains why reporting also needs authoritative order reconciliation.

Run a failure exercise before calling the agent ready

Controlled scenarioEvidence to collectAcceptance question
Offer changes before commitmentOriginal and revised offer referencesWas the actual offer reviewed?
Order accepted but response lostOriginal operation and merchant stateDid recovery avoid a second order?
Completion remains in progressState history and bounded pollingDid the assistant avoid false confirmation?
Duplicate event deliveryEvent IDs and side-effect recordDid fulfillment and messaging remain single?
Connection revokedService authorization resultWas access denied without exposing records?
Recovery budget exhaustedEscalation record and customer responseCan an operator resolve the uncertainty?

These are proposed tests, not results from a Tru deployment. Run them in an authorized test environment with representative configurations. Keep test transactions separate from adoption and revenue reporting.

Use the commerce observability comparison to decide what trace evidence operators need, and the OAuth provider guide for the access boundary. Neither tooling choice substitutes for a verified recovery procedure.

Make the release decision about reproducibility

A successful demonstration shows that one route worked once. A release review should also show how the system behaves when the offer changes, permission expires or the outcome becomes uncertain. Record the configuration, known limits and responsible operator alongside each result.

The Provogue case is a separate implementation example; it is not a performance benchmark for this design. Book an integration-readiness discussion to map your checkout provider, approved offer and recovery path before committing to a wider rollout.

Apply recovery rules to the selected implementation route

Use the ACP merchant implementation guide for seller-side checkout and capability negotiation, or the UCP implementation guide for discovery, handoff and completion recovery. The pilot cost worksheet separates delivery effort, metered infrastructure and operational support for that bounded scope.

FAQ

Sources

  1. 1.MCP tools specification - modelcontextprotocol.io
  2. 2.UCP completion operations - ucp.dev
  3. 3.Stripe idempotent requests - docs.stripe.com
  4. 4.Stripe webhook delivery behavior - docs.stripe.com

Put this into practice

Walk through your shopper journey, integration requirements and the results you want to measure with Tru Commerce.

Choose a time after the form · 30 minutes · no card

Continue reading