---
updatedAt: 2026-10-23T15:27:12.000Z
agentTools:
  siteIndex: https://docs.affirm.com/llms.txt
  projectIndex: https://docs.affirm.com/developers/llms.txt
---

# Express Checkout API

Overview of the Affirm Express Checkout Shipping & Totals endpoint, including how it returns shipping options, taxes, and final order amounts during the hosted checkout flow.

<HTMLBlock>{`
<style>
  .dropdown-menu {
    font-family: Arial, sans-serif;
    max-width: 250px;
    margin-left: auto; /* Align to the right */
  	margin-right: 0; /* Ensure it's flush to the right */
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    background: #4A4AF4;
    overflow: hidden; /* Ensure the container grows with content */
  }

  .dropdown-item {
    margin-bottom: 10px;
  }

  .dropdown-toggle {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
  }

  .dropdown-toggle:hover {
    background: #f0f0f0;
  }

  .dropdown-content {
    display: none;
    margin-top: 5px;
    padding: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
  }

  .dropdown-item.open .dropdown-content {
    display: block;
  }

  .flag-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
  }

  .product-item {
    margin-bottom: 5px;
  }

  .product-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
  }
  
  .country-title {
    font-family: Arial, sans-serif;
    font-size:20px;
    text-align: center;
    font-weight: bold;
    color: #ffffff;
  } 

</style>
  <div class="dropdown-menu">
    <p class="country-title" alt="Countries where this product is available">Country Availability</p>

    <div class="dropdown-item">
      <button class="dropdown-toggle" onclick="toggleDropdown(event)" alt="Drop down menu displaying the available countries for this product">
        <b>Country List</b> ⬇️
      </button>
      <div class="dropdown-content">
        <div class="product-item">
          <img src="https://files.readme.io/a4c8b3d6596d943e2b93c82cb1d432a2edaf6998667835c2e97ef4a31d460c7e-us-circle-01.png" alt="USA" class="flag-icon">
          USA
        </div>
      </div>
    </div>

  </div>
`}</HTMLBlock>

<Callout icon="❗️" theme="error">

  **Interested in offering Affirm Express Checkout?**<br />Reach out to your Affirm Account Manager to confirm availability and for next steps on building your APIs.
</Callout>

## Overview

Affirm Express Checkout relies on one merchant-hosted API endpoint to dynamically complete checkout within the Affirm experience: **Shipping & Totals Endpoint**. This endpoint enables Affirm to collect customer shipping details, present valid shipping methods, calculate taxes and totals, and return finalized order details to the merchant after loan confirmation.

By offloading address collection and checkout calculation into Affirm’s hosted flow, merchants can reduce front-end checkout complexity while retaining full control over shipping logic, pricing, and tax calculations on the backend.

## Shipping & Totals endpoint types

The Shipping & Totals endpoint calculates and returns available shipping options and final order totals based on the customer’s shipping address during checkout.

### Request

#### Headers

| Header               | Type     | Required | Description                                                                                                                                                         |
| :------------------- | :------- | :------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `X-Affirm-Signature` | `string` | **Yes**  | Used to verify that the request is legitimately from Affirm. It contains a timestamp and an HMAC-SHA512 hash of the request body, signed with your Private API Key. |
| `Content-Type`       | `string` | **Yes**  | Must be set to `application/json` as the endpoint accepts and returns JSON payloads.                                                                                |

#### Body

| Field      | Type                      | Required | Description                                                                                      |
| :--------- | :------------------------ | :------- | :----------------------------------------------------------------------------------------------- |
| `order_id` | `string`                  | **Yes**  | Merchant identifier to reference the current checkout session.                                   |
| `currency` | `string`                  | **Yes**  | Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in uppercase. |
| `shipping` | `ShippingBilling.Address` | **Yes**  | Shipping Address.                                                                                |

##### `ShippingBilling.Address`

| Field     | Type     | Required | Description                                                 |
| :-------- | :------- | :------- | :---------------------------------------------------------- |
| `line1`   | `string` | **Yes**  | Address line 1 (e.g., street, PO Box, or company name).     |
| `line2`   | `string` | **No**   | Address line 2 (e.g., apartment, suite, unit, or building). |
| `city`    | `string` | **Yes**  | City, district, suburb, town, or village.                   |
| `state`   | `string` | **Yes**  | State, county, province, or region.                         |
| `zipcode` | `string` | **Yes**  | ZIP or postal code.                                         |
| `country` | `string` | **Yes**  | Three-letter country code (ISO 3166-1 alpha-3).             |

### HTTP 200 Response

#### Body

<Table align={["left","left","left","left"]}>
  <thead>
    <tr>
      <th>
        Field
      </th>

      <th>
        Type
      </th>

      <th>
        Required
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `order_id`
      </td>

      <td>
        `string`
      </td>

      <td>
        **Yes**
      </td>

      <td>
        Merchant identifier to reference the current checkout session.
      </td>
    </tr>

    <tr>
      <td>
        `currency`
      </td>

      <td>
        `string`
      </td>

      <td>
        **Yes**
      </td>

      <td>
        Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in uppercase.
      </td>
    </tr>

    <tr>
      <td>
        `subtotal`
      </td>

      <td>
        `integer`
      </td>

      <td>
        **Yes**
      </td>

      <td>
        Total cost amount of the items in the cart, excluding any taxes or shipping fees, in the minor currency unit of the specified ISO currency code.

        Example: 100 cents to charge $1.00
      </td>
    </tr>

    <tr>
      <td>
        `shipping_options`
      </td>

      <td>
        `Array<Object> (ShippingOption)`
      </td>

      <td>
        **Yes**
      </td>

      <td>
        The available shipping options along with their associated order totals.
      </td>
    </tr>
  </tbody>
</Table>

##### `ShippingOption`

<Table align={["left","left","left","left"]}>
  <thead>
    <tr>
      <th>
        Field
      </th>

      <th>
        Type
      </th>

      <th>
        Required
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `shipping_type`
      </td>

      <td>
        `string`
      </td>

      <td>
        **Yes**
      </td>

      <td>
        A unique, merchant-generated identifier for the shipping option. This value is used to map the customer’s selection to your internal fulfillment records and must remain persistent throughout the session. Please ensure that each shipping option has its own unique `shipping_type` value.

        **Examples**:

        - “Shipping_ups_123”,
        - “Shipping_fedex_456”,
        - “instore_pickup_789”.
      </td>
    </tr>

    <tr>
      <td>
        `shipping_label`
      </td>

      <td>
        `string`
      </td>

      <td>
        **Yes**
      </td>

      <td>
        The shipping method label displayed to the user.

        **Example**: “Standard Shipping (7-10 Days)')”
      </td>
    </tr>

    <tr>
      <td>
        `shipping_amount`
      </td>

      <td>
        `integer`
      </td>

      <td>
        **Yes**
      </td>

      <td>
        The cost of shipping in the minor currency unit of the specified ISO currency code.

        **Example**: 100 cents to charge $1.00
      </td>
    </tr>

    <tr>
      <td>
        `tax_amount`
      </td>

      <td>
        `integer`
      </td>

      <td>
        **Yes**
      </td>

      <td>
        The total tax amount in the minor currency unit of the specified ISO currency code.

        **Example**: 100 cents to charge $1.00
      </td>
    </tr>

    <tr>
      <td>
        `total`
      </td>

      <td>
        `integer`
      </td>

      <td>
        **Yes**
      </td>

      <td>
        The total amount of the checkout in the minor currency unit of the specified ISO currency code.

        **Example**: 100 cents to charge $1.00
      </td>
    </tr>
  </tbody>
</Table>

### HTTP 422 Response

#### Body

| Field    | Type                    | Required | Description                                                                                                                 |
| :------- | :---------------------- | :------- | :-------------------------------------------------------------------------------------------------------------------------- |
| `errors` | `Array<Object> (Error)` | **Yes**  | An array of one or more error objects describing why the request could not be processed. Must contain at least one element. |

#### `Error`

| Field        | Type       | Required | Description                                         |
| :----------- | :--------- | :------- | :-------------------------------------------------- |
| `error_code` | `enum`     | **Yes**  | One of the predefined Affirm error codes.           |
| `message`    | `string`   | **Yes**  | A description of the error.                         |
| `fields`     | `string[]` | **No**   | The request payload property that caused the error. |

##### `error_code Enum`

| Error code                    | Description                                                                                                                       |
| :---------------------------- | :-------------------------------------------------------------------------------------------------------------------------------- |
| `UNSUPPORTED_SHIPPING_ZONE`   | Used when the address is valid but the merchant does not ship to that region (e.g., Hawaii/Alaska).                               |
| `INVALID_SHIPPING_ADDRESS`    | The provided address does not exist or is malformed.                                                                              |
| `ORDER_NOT_FOUND`             | The `order_id` passed in the request does not match an active session or cart in the merchant's system.                           |
| `CURRENCY_MISMATCH`           | The merchant's system does not support the currency specified in the request (e.g., merchant only supports CAD but receives USD). |
| `INVENTORY_UNAVAILABLE`       | Between initiating checkout and calculating totals, items in the items array have gone out of stock.                              |
| `SHIPPING_METHOD_UNAVAILABLE` | No valid shipping options can be generated for the requested address (e.g., oversized items to a remote area).                    |
| `INTERNAL_SERVER_ERROR`       | A catch-all for unexpected merchant-side backend failures or database timeouts during the calculation.                            |

# Sibling pages

* [Integration Checklist](https://docs.affirm.com/developers/docs/integration-checklist.md)