> 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/checkout-api/checkout-api/overview.md).

# Overview

The Checkout API starts the ESW hosted checkout flow.

Retailers send cart data, shopper context, and checkout configuration to ESW. Older integrations may refer to this as the **Preorder API**.

### What it does

When ESW receives a valid checkout request, it returns a unique redirect URL.

The shopper opens that URL and completes checkout in the ESW UI. They can review the order, choose delivery, and enter shipping, billing, and payment details.

After payment succeeds, ESW completes checkout and the order moves into post-checkout processing.

### Typical flows

The checkout session starts the same way in both sync and async flows. The difference is what happens after payment succeeds.

{% tabs %}
{% tab title="Synchronous" %}
{% code expandable="true" %}

```mermaid
%%{init: {
  "theme": "base",
  "themeVariables": {
    "fontFamily": "Arial, sans-serif",
    "primaryColor": "#007A4E",
    "primaryTextColor": "#1E2221",
    "primaryBorderColor": "#007A4E",
    "lineColor": "#1E2221",
    "signalColor": "#1E2221",
    "signalTextColor": "#1E2221",
    "actorBkg": "#CFF3E4",
    "actorTextColor": "#1E2221",
    "labelBoxBkgColor": "#DEEBE5",
    "labelTextColor": "#1E2221",
    "noteBkgColor": "#DEEBE5",
    "noteTextColor": "#1E2221",
    "sequenceNumberColor": "#FFD138",
    "activationBorderColor": "#007A4E",
    "activationBkgColor": "#80E8BF"
  }
}}%%
sequenceDiagram
    autonumber
    participant S as Shopper
    participant R as Retailer
    participant E as ESW
    participant UI as ESW Checkout UI

    S->>R: Click Checkout
    R->>E: Send checkout payload
    E-->>R: Return redirect URL
    R->>UI: Redirect shopper to ESW
    S->>UI: Complete checkout and pay
    E->>R: Send order confirmation webhook
    R-->>E: Return approval and retailer order number
    E-->>S: Show confirmation page
```

{% endcode %}

1. The shopper clicks **Checkout** on the retailer site.
2. The retailer sends the checkout payload to ESW.
3. ESW returns a redirect URL.
4. The shopper completes checkout in the ESW UI.
5. ESW sends the order confirmation webhook to the retailer.
6. The retailer returns approval and can send its own order number.
7. The shopper sees the confirmation page after processing completes.
   {% endtab %}

{% tab title="Asynchronous" %}
{% code expandable="true" %}

```mermaid
%%{init: {
  "theme": "base",
  "themeVariables": {
    "fontFamily": "Arial, sans-serif",
    "primaryColor": "#007A4E",
    "primaryTextColor": "#1E2221",
    "primaryBorderColor": "#007A4E",
    "lineColor": "#1E2221",
    "signalColor": "#1E2221",
    "signalTextColor": "#1E2221",
    "actorBkg": "#CFF3E4",
    "actorTextColor": "#1E2221",
    "labelBoxBkgColor": "#DEEBE5",
    "labelTextColor": "#1E2221",
    "noteBkgColor": "#DEEBE5",
    "noteTextColor": "#1E2221",
    "sequenceNumberColor": "#FFD138",
    "activationBorderColor": "#007A4E",
    "activationBkgColor": "#80E8BF"
  }
}}%%
sequenceDiagram
    autonumber
    participant S as Shopper
    participant R as Retailer
    participant E as ESW
    participant UI as ESW Checkout UI

    S->>R: Click Checkout
    R->>E: Send checkout payload
    E-->>R: Return redirect URL
    R->>UI: Redirect shopper to ESW
    S->>UI: Complete checkout and pay
    E-->>S: Show confirmation page immediately
    E->>R: Send order confirmation webhook in background
    R-->>E: Return approval and retailer order number
```

{% endcode %}

1. The shopper clicks **Checkout** on the retailer site.
2. The retailer sends the checkout payload to ESW.
3. ESW returns a redirect URL.
4. The shopper completes checkout in the ESW UI.
5. ESW redirects the shopper before confirmation processing completes.
6. ESW sends the order confirmation webhook in the background.
7. The retailer returns approval and can send its own order number.
   {% endtab %}
   {% endtabs %}

In both flows, the retailer can send its own order number during order confirmation. If no order number is returned, ESW uses the `retailerCartId`.

{% hint style="info" %}
For the post-payment confirmation step, see [API Method](/checkout-api/checkout-api/api-methods.md)
{% endhint %}

{% tabs %}
{% tab title="What you send" %}
A typical checkout request includes:

* A unique cart reference
* Line items, quantities, and product identifiers
* Pricing and currency data
* Delivery country
* Shopper language and localization data
* Product display data such as title, image, color, and size
* Retailer checkout settings and optional metadata
  {% endtab %}

{% tab title="Common capabilities" %}
The Checkout API supports several common integration patterns:

* **Registered shoppers**: prefill saved shipping and billing details
* **Delivery overrides**: pass retailer-defined delivery pricing when needed
* **Discounts and promo codes**: show cart discounts and applied promotions throughout checkout
* **Checkout UI metadata**: surface extra product or shopper-facing content in the checkout experience.
  {% endtab %}
  {% endtabs %}


---

# 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/checkout-api/checkout-api/overview.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.
