> For the complete documentation index, see [llms.txt](https://developer.esw.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.esw.com/agentic-commerce/esw-agentic-checkout/checkout-testing-and-errors.md).

# Checkout, Testing, and Errors

Understand payment handling, validation, and shopper error recovery.

### Payment handling

ESW handles payments through a secure token-based flow. ESW maps the token to the shopper conversation, authorizes payment, and returns the checkout outcome and processes the order.

### Validation and testing

ESW validates the checkout services against the manifest. Testing confirms UCP actions perform efficiently and product data synchronizes correctly to merchant centers.

### ESW Checkout Services Errors

Protect conversion by helping shoppers recover from fixable errors inside the agent experience. ESW separates shopper-correctable issues, such as invalid personal details or unsupported delivery countries, from ESW-managed issues such as catalog, authentication, capacity, or infrastructure failures.

These scenarios are not exposed to the AI agent as raw errors. They show what could interrupt a shopper's journey and how the AI agent addresses each issue by guiding the shopper to correct details, retrying where appropriate, or resolving the issue behind the scenes. Use this view to understand how ESW protects a smooth, reassuring checkout experience when something does not go to plan.

| Scenario                                         | Who handles it                                            | Shopper experience                                                                                                 |
| ------------------------------------------------ | --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| Invalid personal details provided by shopper     | Shopper (prompted by AI agent)                            | Prompt to correct and resubmit                                                                                     |
| Unsupported delivery country selected            | Shopper (prompted by AI agent)                            | Prompt to choose a supported country                                                                               |
| Product catalog or pricing data issue            | ESW                                                       | Hidden from shopper; ESW resolves                                                                                  |
| Authentication or permissions failure            | ESW                                                       | Handled by ESW adapter; no action required                                                                         |
| Rate limiting or temporary capacity issue        | ESW                                                       | Automatic retry after short delay                                                                                  |
| Infrastructure or integration failure            | ESW                                                       | Graceful message shown; ESW resolves                                                                               |
| Minor data formatting issues (e.g., postal code) | ESW                                                       | Silently auto-corrected; flow continues                                                                            |
| Payment declined                                 | ESW                                                       | Graceful message shown based on the failure reason                                                                 |
| 3DS or fraud challenge required                  | Shopper (guided by AI agent); ESW validates the result    | Prompt the shopper to complete the challenge, then resume checkout from the same session                           |
| Payment method not supported for the market      | Shopper (prompted by AI agent)                            | Show supported options for that market and ask the shopper to choose another payment method                        |
| Item becomes out of stock at checkout            | Shopper (prompted by AI agent); ESW confirms availability | Tell the shopper which item changed, remove it or suggest an available alternative, then refresh the order total   |
| Address validation failure                       | Shopper (prompted by AI agent)                            | Ask for the exact field to fix, such as postal code, state, or house number, and validate before retrying checkout |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developer.esw.com/agentic-commerce/esw-agentic-checkout/checkout-testing-and-errors.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
