# Stock API Quickstart import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; By the end of this guide, you'll have set the available quantity for a SKU in one of your warehouses using the Stock API. ## Prerequisites - Authentication set up — see [Getting Credentials][getting-credentials] and [Authenticating Your Requests][authenticating-requests] - A `warehouse_code` (from Seller Lab, set during FBPI warehouse setup) and a partner SKU that already exists on noon ## Make your first call `UpdateStock` (`POST /stock/v1/stock-update`) sets the available quantity for one or more SKUs in a warehouse. It's the right starting point — pushing availability is the core reason to use this API. The quantity you send is **absolute** — it becomes the new available quantity, it is not added to the current value. ```python # get_authenticated_session() is provided in docs/snippets/auth.mdx — see Authenticating Your Requests session = get_authenticated_session() response = session.post( "https://noon-api-gateway.noon.partners/stock/v1/stock-update", json={ "items": [ {"warehouse_code": "WH-DXB-01", "partner_sku": "MYSKU-001", "qty": 25} ] }, headers={"Content-Type": "application/json", "User-Agent": "MyApp/1.0.0"}, timeout=30, ) response.raise_for_status() result = response.json() ``` ```javascript // getAuthenticatedClient() is provided in docs/snippets/auth.mdx — see Authenticating Your Requests const client = await getAuthenticatedClient(); const response = await client.post( "https://noon-api-gateway.noon.partners/stock/v1/stock-update", { items: [{ warehouse_code: "WH-DXB-01", partner_sku: "MYSKU-001", qty: 25 }] }, { headers: { "Content-Type": "application/json", "User-Agent": "MyApp/1.0.0" } } ); ``` Replace `WH-DXB-01` with your warehouse code, `MYSKU-001` with a partner SKU from your catalog, and `25` with the available quantity you want noon to hold. **Response:** ```json { "items": [ { "warehouse_code": "WH-DXB-01", "partner_sku": "MYSKU-001", "status": { "status_id": 0, "status_code": "OK", "message": "", "details": [] } } ] } ``` ## What you got back The response returns one entry per SKU you submitted, echoing its `warehouse_code` and `partner_sku`. Each entry carries its own `status` — a `status_code` of `OK` confirms the available quantity was set. After this call, noon offers exactly that many units to customers until the next update or until stock is reserved against an order. ## Checking for errors This API can return errors in two ways: - **Non-2xx response** — the entire request failed (for example, authentication or a malformed body). Check the HTTP status. - **Item-level error within a 200** — the request succeeded but one or more SKUs failed. Always inspect each item's `status` in the response body, even when the HTTP status is `200` — a SKU that does not exist on noon can fail while the rest succeed. ## Where to go next - [Stock API Overview][stock-intro] — what the Stock API is and when to use it - [UpdateStock API Reference][update-stock] — full request and response schema, including the Usage Plan (rate limits) - [GetStock API Reference][get-stock] — read current quantities back from noon