# Stock Query

Operations related to stock availability checking

## Check Stock Availability on Selected Locations

> Check if all requested SKUs can be fulfilled from the specified stock locations.\
> This endpoint is optimized for basket/cart validation scenarios where you need to\
> verify that all items in a basket can be fulfilled from specific stock locations.\
> \
> \*\*Key Features:\*\*\
> \- Supports multiple SKUs and multiple stock locations\
> \- Checks available stock after considering reservations\
> \- Returns fulfillment status per stock location\
> \- Supports filtering by ERP codes or tags\
> \- Optimized with bulk queries for performance\
> \
> \*\*Business Logic:\*\*\
> \- For each stock location, checks if ALL requested SKUs are available\
> \- Available stock = Total stock - Reserved stock\
> \- Returns true only if ALL SKUs can be fulfilled from that location\
> \- Considers quantity requirements (duplicate SKUs in the list)<br>

```json
{"openapi":"3.0.3","info":{"title":"OMS Products Module API","version":"1.0.0"},"tags":[{"name":"Stock Query","description":"Operations related to stock availability checking"}],"servers":[{"url":"https://{domain}/api/v1/oms","variables":{"domain":{"default":"domain.akinon.com"}}}],"security":[{"tokenAuth":[]}],"components":{"securitySchemes":{"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Use format: `Token <your_token>`"}},"schemas":{"ErrorResponse":{"type":"object","required":["error","message","code"],"properties":{"error":{"type":"string","description":"Error type identifier"},"message":{"type":"string","description":"Human-readable error message"},"code":{"type":"integer","description":"HTTP status code"},"timestamp":{"type":"string","format":"date-time","description":"When the error occurred"}}},"ValidationErrorResponse":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string","description":"Error type identifier"},"message":{"type":"string","description":"General validation error message"},"details":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}},"description":"Field-specific validation errors"}}}}},"paths":{"/query-stock-availability":{"get":{"summary":"Check Stock Availability on Selected Locations","description":"Check if all requested SKUs can be fulfilled from the specified stock locations.\nThis endpoint is optimized for basket/cart validation scenarios where you need to\nverify that all items in a basket can be fulfilled from specific stock locations.\n\n**Key Features:**\n- Supports multiple SKUs and multiple stock locations\n- Checks available stock after considering reservations\n- Returns fulfillment status per stock location\n- Supports filtering by ERP codes or tags\n- Optimized with bulk queries for performance\n\n**Business Logic:**\n- For each stock location, checks if ALL requested SKUs are available\n- Available stock = Total stock - Reserved stock\n- Returns true only if ALL SKUs can be fulfilled from that location\n- Considers quantity requirements (duplicate SKUs in the list)\n","operationId":"checkStockAvailabilityOnSelectedLocations","tags":["Stock Query"],"parameters":[{"name":"sku","in":"query","description":"Product SKU(s) to check availability for. Can be specified multiple times\nfor multiple products. Duplicate SKUs are counted as quantity requirements.\n","required":true,"schema":{"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9\\-_]+$","minLength":1,"maxLength":50},"minItems":1,"maxItems":100},"style":"form","explode":true},{"name":"erp_code","in":"query","description":"ERP code(s) of specific stock locations to check. Can be specified multiple times.\nIf not provided, all active stock locations will be considered.\n","required":false,"schema":{"type":"array","items":{"type":"string","pattern":"^[A-Za-z0-9\\-_]+$","minLength":1,"maxLength":20},"maxItems":50},"style":"form","explode":true},{"name":"tag","in":"query","description":"Tag name(s) to filter stock locations by tags. Can be specified multiple times.\nOnly stock locations with matching tags will be considered.\n","required":false,"schema":{"type":"array","items":{"type":"string","minLength":1,"maxLength":50},"maxItems":20},"style":"form","explode":true}],"responses":{"200":{"description":"Stock availability check completed successfully. \nReturns fulfillment status for each stock location.\n","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"boolean","description":"True if the stock location can fulfill ALL requested SKUs,\nfalse otherwise\n"}}}}},"400":{"description":"Bad Request - Invalid parameters or no valid stock locations found\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Unprocessable Entity - Request validation failed\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationErrorResponse"}}}},"500":{"description":"Internal Server Error - Unexpected server error occurred\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


---

# 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://apidocs.akinon.com/oms-openapis/products/stock-query.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.
