# Get Online ATP of Products

Store Associates need to access the online Available to Promise (ATP) inventory of products on their POS systems for sendsales orders. The `getProductOnlineAtp` API facilitates retrieving the online ATP of a product from all locations except the one it's being ordered from. The API does not count the Online ATP of a facility in the following scenarios:

1. Inventory for the store placing the order.
2. Inventory from stores with sell online turned off.
3. Inventory for an SKU where the inventory is turned off in specific locations.

To fetch the online ATP details, make a POST request to the `/getProductOnlineAtp` endpoint.

## Request

### End Point

`https://<host>/api/service/getProductOnlineAtp`

**Example** `https://demo-oms.hotwax.io/api/service/getProductOnlineAtp`

### Header

Content-Type: application/json

### Body

```json
{
  "idType": "<SKU>",
  "idValue": "<SKU>",
  "productStoreId": "<STORE_ID>",
  "facilityGroupId": "<FacilityGroupID>",
  "conditionMap": {
    "externalFacilityId_value": "<External Facility ID>",
    "externalFacilityId_op": "<operator>"
  }
}
```

### Sample

```json
{
  "idType": "SKU",
  "idValue": "MSH02-32-Black",
  "productStoreId": "DEMO_STORE",
  "facilityGroupId": "FAC_GRP",
  "conditionMap": {
    "externalFacilityId_value": "101",
    "externalFacilityId_op": "notEqual"
  }
}
```

### Parameters

| Parameter Name            | Description                                                                       |
| ------------------------- | --------------------------------------------------------------------------------- |
| idType                    | Specifies the type of identifier being used (e.g., "SKU")                         |
| idValue                   | The specific value of the SKU being referenced                                    |
| productStoreId            | Identifies the store or location within the system where the product is available |
| conditionMap              | Contains conditions for filtering or specifying attributes related to the request |
| externalFacilityId\_value | The value of the external facility ID                                             |
| externalFacilityId\_op    | The operation or condition applied to the external facility ID (e.g., "notEqual") |

## Response

### Status Code

HTTP/1.1 200 OK

### Headers

Content-Type: application/json

### Body

```json
{
    "onlineAtp": "<Value>"
}
```

### Sample

```json
{
    "onlineAtp": 100
}
```

## Parameters

| Parameter Name | Description                                              |
| -------------- | -------------------------------------------------------- |
| onlineAtp      | The online available to promise inventory of the product |


---

# Agent Instructions: 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:

```
GET https://docs.hotwax.co/documents/integrate-with-hotwax/hotwax-commerce-api-and-data-feeds/inventory/get-online-atp.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
