# Batch inventory availability check

Executes availability checks for one or more products in a single request.
No query resource is persisted — results reflect domain data at the time
of the call.

Each item independently determines check type based on the presence of date:
- date present → ATP (Available to Promise by that date)
- date absent  → ATS (Available to Sell — current sellable quantity)

The checkType field in each result indicates which check was performed.
Items with an invalid productId return 404 in items[].error.
Items with zero availability at a valid branch return availableQty: 0 — not an error.

Endpoint: POST /v1/{countryCode}/availability-queries
Version: 0.0.1
Security: jwt-authorizer

## Path parameters:

  - `countryCode` (string, required)
    Enum: "au", "nz"

## Request fields (application/json):

  - `branchId` (string, required)
    Branch to check availability at. Applies to all items in the request.

  - `channelId` (string, required)
    Availability channel — consumer-provided. Valid values: BLMaxx, BLBranch, BLEcom, OnsiteMaxx, OnsiteBranch, OnsiteEcom.
    Enum: "BLMaxx", "BLBranch", "BLEcom", "OnsiteMaxx", "OnsiteBranch", "OnsiteEcom"

  - `items` (array, required)
    One or more products to check availability for. Maximum 25 items per request.

  - `items.productId` (string, required)
    Product identifier.

  - `items.quantity` (integer, required)
    Requested quantity to check.

  - `items.date` (string)
    ISO 8601 date (e.g. 2026-08-25). Presence triggers ATP check; absence triggers ATS check.

## Response 200 fields (application/json):

  - `branchId` (string, required)

  - `channelId` (string, required)

  - `items` (array, required)
    Availability result for each requested item, in request order.

  - `items.productId` (string, required)

  - `items.checkType` (string, required)
    Indicates which availability model was evaluated — ATP (Available to Promise) or ATS (Available to Sell).
    Enum: "ATP", "ATS"

  - `items.availableQty` (integer, required)
    Quantity available. For ATP, this is the quantity available by the requested date. Zero when product is unstocked at the branch.

  - `items.availableByDate` (string)
    Earliest date the full requested quantity is available. Present only for ATP checks.

  - `items.requested` (object, required)

## Response 400 fields (application/json):

  - `errorCode` (string, required)
    Stable, machine-readable application error identifier in
UPPERCASE_WITH_UNDERSCORES format (e.g. VALIDATION_ERROR,
RESOURCE_NOT_FOUND). Numeric suffixes may be used for further
categorisation (e.g. PAYMENT_FAILED_002).
    Example: "VALIDATION_ERROR"

  - `message` (string, required)
    Human-readable description suitable for logs or user-facing translation.

  - `status` (integer, required)
    HTTP status code of the response.
    Example: 400

  - `timestamp` (string, required)
    Time the error occurred, in ISO 8601 format.

  - `correlationId` (string)
    Identifier for the originating request, used for tracing and support diagnostics.

  - `details` (array)
    Structured additional information, such as field-level validation errors.

  - `details.field` (string)
    Request field or parameter that produced the issue.

  - `details.issue` (string)
    Human-readable explanation of the field-level issue.


