> 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/adobe-commerce-magento/additional-features/inventory-check-override.md).

# Inventory Check Override

Inventory Check Override ensures shoppers only proceed to payment when every item in the cart is in stock. This prevents payment for unavailable items and reduces failed checkout experiences.

### Inventory Check Override configuration

This feature depends on inventory validation endpoints configured in ESW Checkout.

The preorder flow uses these settings:

#### Inventory Check Endpoint

`InventoryCheckUrl` is the endpoint used to validate inventory availability before payment. ESW provides this URL through direct configuration.

When an inventory check is triggered, Adobe Commerce calls this endpoint and waits for an availability response.

#### Inventory Check Failure Page

`BacktoCartUrl` is used for redirection when the inventory check fails.

`InventoryCheckFailurePageUrl` defines the destination page when the inventory response indicates that one or more items are out of stock.

{% hint style="info" %}
Both URLs must be configured correctly in ESW Checkout before the inventory check flow can work as expected.
{% endhint %}

### How the feature works

The inventory check happens before payment is completed.

1. ESW initiates an inventory check during checkout.
2. Adobe Commerce validates stock by calling the configured inventory endpoint.
3. The endpoint returns a boolean result that indicates whether inventory is available.
4. Checkout behavior changes based on the response.

### Successful inventory check

If all items in the cart are available:

* the checkout flow continues
* the shopper can complete payment
* the shopper sees the order confirmation page after a successful order

### Failed inventory check

If any item in the cart is out of stock:

* the order does not proceed
* the shopper is redirected to the cart or configured failure page
* an inventory error message is shown so the shopper can review the order

<div data-with-frame="true"><figure><img src="/files/v2CBgFDtdFqdBayP9Qev" alt=""><figcaption></figcaption></figure></div>

### Expected result

After setup is complete:

* payment is blocked for carts with unavailable items
* shoppers are redirected before payment if stock validation fails
* the checkout flow stays aligned with live inventory availability


---

# 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/adobe-commerce-magento/additional-features/inventory-check-override.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.
