# Availability and Promising

The customer journey in the web shop typically involves various steps, from searching for an item on an overview page to completing an order on the checkout page. Each step requires a different level of detail on the Available to Promise (ATP) information. In general, the responses to the ATP calls become increasingly specific as the user progresses through the checkout journey.

This page gives an overview of the different requests that are recommended for each step in the (checkout) journey.

## Endpoints per shop page

### Product Listing Page (PLP)

<figure><img src="https://4170739437-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLrrr5jgTsDuR38gNJIrm%2Fuploads%2FEEsUIpwbfB7djC8nYFTS%2FEarliest%20product%20delivery%20date%20(7).png?alt=media&#x26;token=0df05cae-6dfe-4862-acd7-ff32cd5eb650" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="521.23828125">Use case</th><th>API</th></tr></thead><tbody><tr><td>Are (a list of) articles currently available in the network? How much of it?</td><td><a href="#stock-summary">Stock summaries</a></td></tr><tr><td>What's the earliest possible delivery date for an article?</td><td><a href="#delivery-earliest">Delivery earliest</a></td></tr><tr><td>What's the earliest possible pick-up date for an article?</td><td><a href="#collect-earliest">Collect earliest</a></td></tr><tr><td>How much stock is available for a list of articles and facilities on a specific delivery date?</td><td><a href="#delivery-time-point">Delivery time point</a></td></tr></tbody></table>

### Product Detail Page (PDP)

#### PDP with pick-up options and delivery date

<figure><img src="https://4170739437-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLrrr5jgTsDuR38gNJIrm%2Fuploads%2FNjIArsxvsDjVNLinaAjr%2FSpecific%20product%20delivery%20date-2.png?alt=media&#x26;token=7ca6b590-484e-44c2-af12-79e8e5f7be65" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="521.23828125">Use case</th><th>API</th></tr></thead><tbody><tr><td>Is the article currently available at the (pick-up) location? How much of it?</td><td><a href="#stock-distribution">Stock distribution</a></td></tr><tr><td>What is the earliest possible delivery date for an article?</td><td><a href="#delivery-earliest">Delivery earliest</a></td></tr><tr><td>What is the earliest possible pick-up date for an article?</td><td><a href="#collect-earliest">Collect earliest</a></td></tr></tbody></table>

#### PDP with calendar functionality

<figure><img src="https://4170739437-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLrrr5jgTsDuR38gNJIrm%2Fuploads%2FgyzfVW7zzgL6MT4utsTe%2FSpecific%20product%20delivery%20date%20(11).png?alt=media&#x26;token=85a2cf9d-6bbc-41bd-ac3b-dedc038aec2c" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="521.23828125">Use case</th><th>API</th></tr></thead><tbody><tr><td>What are possible delivery dates for an article in a specific time period (calendar functionality)?</td><td><a href="#delivery-time-period">Delivery time period</a></td></tr></tbody></table>

### Shopping cart

<figure><img src="https://4170739437-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLrrr5jgTsDuR38gNJIrm%2Fuploads%2F7TEMdZOwk0CFJjJgsf8q%2FSpecific%20product%20delivery%20date-3.png?alt=media&#x26;token=a086017d-c9d3-4b3e-8b49-603478199b03" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="521.015625">Use case</th><th>API</th></tr></thead><tbody><tr><td>What carriers and carrier products are available for that article?</td><td><a href="#delivery-earliest">Delivery earliest</a></td></tr><tr><td>What carriers are available for that basket?</td><td><a href="#checkout-options">Checkout options</a></td></tr><tr><td>What are the delivery costs for that basket?</td><td><a href="#checkout-options">Checkout options</a></td></tr><tr><td>Are all articles in the basket available for shipping/pick-up?</td><td><a href="#checkout-options">Checkout options</a></td></tr><tr><td>Is an order split necessary to fulfill the order?</td><td><a href="#checkout-options">Checkout options</a></td></tr></tbody></table>

### Checkout

<figure><img src="https://4170739437-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLrrr5jgTsDuR38gNJIrm%2Fuploads%2F73MIPIAbNBLQSy4seJbI%2FSpecific%20product%20delivery%20date-4.png?alt=media&#x26;token=e1472d28-4296-4f8d-ad78-ec5112f6d9a9" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="521.4765625">Use case</th><th>API</th></tr></thead><tbody><tr><td>How and where would the order be fulfilled if placed now (pre-reservation can already be made)?</td><td><a href="#delivery-promise">Delivery promise</a></td></tr><tr><td>What is the estimated delivery time, and what's the latest possible acceptance time for the order?</td><td><a href="#delivery-promise">Delivery promise</a></td></tr></tbody></table>

## Shop REST APIs

### Stock summary

| Request                                                                                         | Response                                                                                                                                                                                                                                                                                                                          |
| ----------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <ul><li>List of article IDs</li><li>Facility filters (facility ID, status, and so on)</li></ul> | <ul><li><code>availableForPicking</code> = amount currently available for shipping</li><li><code>includedFacilityRefs</code> = facilities in which the article is in stock (does not imply availability)</li></ul><p>No facilities (i.e. their stock) are filtered out by <a href="advanced-order-routing/fences">fences</a>.</p> |

{% hint style="info" %}
More information can be found in the [REST API documentation](https://fulfillmenttools.github.io/fulfillmenttools-api-reference-ui/#get-/api/stocks/summaries) for `GET /api/stocks/summaries`.
{% endhint %}

### Stock distribution

| Request                                                                               | Response                                                                                                                                                                                                            |
| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <ul><li>One article ID</li><li>Facility filters (facility ID, status, etc.)</li></ul> | <ul><li><code>availableForPicking</code> = amount currently available for shipping/pick-up</li></ul><p>No facilities (i.e. their stock) are filtered out by <a href="advanced-order-routing/fences">fences</a>.</p> |

{% hint style="info" %}
More information can be found in the [REST API documentation](https://fulfillmenttools.github.io/fulfillmenttools-api-reference-ui/#get-/api/articles/-tenantArticleId-/stockdistribution) for `GET /api/articles/{tenantArticleId}/stockdistribution`.
{% endhint %}

### Delivery earliest

| Request                                                                                                                                                                 | Response                                                                                                                                                                                                                            |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <ul><li>List of article IDs</li><li>Consumer address (country sufficient)</li><li>Custom facility filters (optional)</li><li>Desired delivery date (optional)</li></ul> | <ul><li>Available carriers</li><li>Earliest predicted delivery date</li><li>Available facility connections</li></ul><p>No facilities (i.e. their stock) are filtered out by <a href="advanced-order-routing/fences">fences</a>.</p> |

{% hint style="info" %}
More information can be found in the [REST API documentation](https://fulfillmenttools.github.io/fulfillmenttools-api-reference-ui/#post-/api/promises/checkoutoptions/delivery/earliest) for `POST /api/promises/checkoutoptions/delivery/earliest`.
{% endhint %}

### Collect earliest

| Request                                                                                                      | Response                                                                                                                                                                                   |
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <ul><li>List of article IDs</li><li>Pick-up facilities IDs</li><li>Desired collect date (optional)</li></ul> | <ul><li>Available carriers</li><li>Available facility connections</li></ul><p>No facilities (i.e. their stock) are filtered out by <a href="advanced-order-routing/fences">fences</a>.</p> |

{% hint style="info" %}
More information can be found in the [REST API documentation](https://fulfillmenttools.github.io/fulfillmenttools-api-reference-ui/#post-/api/promises/checkoutoptions/collect/earliest) for `POST /api/promises/checkoutoptions/collect/earliest`.
{% endhint %}

### Delivery time period

| Request                                                                                                                                | Response                                                                                                                                                                                                                                        |
| -------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <ul><li>Basket of article IDs</li><li>Consumer address (country sufficient)</li><li>Time period</li><li>Delivery preferences</li></ul> | <ul><li>Available carriers</li><li>Available facility connections</li><li>Basket availability per date (all/part/none)</li></ul><p>No facilities (i.e. their stock) are filtered out by <a href="advanced-order-routing/fences">fences</a>.</p> |

{% hint style="info" %}
More information can be found in the [REST API documentation](https://fulfillmenttools.github.io/fulfillmenttools-api-reference-ui/#post-/api/promises/checkoutoptions/delivery/timeperiod) for `POST /api/promises/checkoutoptions/delivery/timeperiod`.
{% endhint %}

### Delivery time point

| Request                                                                                                                         | Response                                                                                                                                                                   |
| ------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <ul><li>List of article IDs</li><li>List of facilities (and their latest picking start)</li><li>Desired delivery date</li></ul> | <ul><li>Available amount per article and facility</li></ul><p>No facilities (i.e. their stock) are filtered out by <a href="advanced-order-routing/fences">fences</a>.</p> |

{% hint style="info" %}
More information can be found in the [REST API documentation](https://fulfillmenttools.github.io/fulfillmenttools-api-reference-ui/#post-/api/promises/checkoutoptions/delivery/timepoint) for `POST /api/promises/checkoutoptions/delivery/timepoint`.
{% endhint %}

### Checkout options

| Request                                                                                                                                                                                                      | Response                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <ul><li>Basket of article IDs</li><li>Consumer address (country sufficient)</li><li>Delivery preferences</li><li>Geo fence</li><li>Target time (optional)</li><li>Desired delivery date (optional)</li></ul> | <ul><li>Available amounts for the articles in the basket per article and facility</li><li>Available carriers per facility</li><li>Available services per facility</li><li>Facility details (closing days, picking times, and so on)</li><li>Transit times</li><li>Delivery costs</li></ul><p>The response includes all information on possible facilities that have stock of at least one of the ordered items and have not been filtered out by <a href="advanced-order-routing/fences">fences</a>.</p> |

{% hint style="info" %}
More information can be found in the [REST API documentation](https://fulfillmenttools.github.io/fulfillmenttools-api-reference-ui/#post-/api/promises/checkoutoptions) for `POST /api/promises/checkoutoptions`.
{% endhint %}

### Delivery promise

| Request                                                                           | Response                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| --------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <ul><li>Basket of article IDs</li><li>Consumer address</li><li>Services</li></ul> | <ul><li>(Pre)reservation</li><li>Available amounts for the articles in the basket per article and facility</li><li>Available carriers per facility</li><li>Available services per facility</li><li>Facility details (closing days, picking times, and so on)</li><li>Total shipping costs</li><li>Packaging information</li></ul><p>When sending a promise order, a routing decision is made using the configured <a href="advanced-order-routing/routing-strategy">routing strategy</a>, and the corresponding stock is reserved.</p> |

{% hint style="info" %}
More information can be found in the [REST API documentation](https://fulfillmenttools.github.io/fulfillmenttools-api-reference-ui/#post-/api/promises/deliverypromise) for `POST /api/promises/deliverypromise`.
{% endhint %}
