.. _update-listings-inventory-label: **POST** /listings/v3/update/inventory -------------------------------------- Summary: Update product listing's inventory. Description: This call updates listing's inventory against the specified SKUs. If the SKU doesn't exist in the system, then an error will be returned against the SKU. The values that the listing attributes can take can change with time and selling constructs. It is recommended to explicitly handle errors and warnings returned by this API. In addition to the authorization header, which is required for all Flipkart REST API calls, the following table includes additional headers required by this call: +--------------+---------------------------------------------------------+----------+--------------------------------+ | Header | Description | Required | Allowed Values | +==============+=========================================================+==========+================================+ | Content-Type | The MIME type of the body of the request. Must be JSON. | Yes | application/json; | | | | | charset=utf-8 | +--------------+---------------------------------------------------------+----------+--------------------------------+ Input: .. container:: toggle .. container:: header ☰ Toggle **Payload Model** .. literalinclude:: v3/payloads/UpdateInventoryRequest.json :linenos: :language: json **Request field descriptions** The payload is a map of SKU identifiers to their corresponding update inventory request. Max batch size allowed is "10". The fields of the update inventory request are described in the table below. +---------------------------------------------+-----------------------+-------------+------------------------------------------------------------------------------------------------------------------------+ | Field | Type | Occurrence | Description | +=============================================+=======================+=============+========================================================================================================================+ | product_id | String | Mandatory | This is the product's identifier in the Flipkart Marketplace. Length Range -> 13 to 16 characters. | +---------------------------------------------+-----------------------+-------------+------------------------------------------------------------------------------------------------------------------------+ | locations | Array | Mandatory | Your selling locations for this listing. | +---------------------------------------------+-----------------------+-------------+------------------------------------------------------------------------------------------------------------------------+ | locations[].id | String | Mandatory | The location ID obtained via the Onboarding API. | +---------------------------------------------+-----------------------+-------------+------------------------------------------------------------------------------------------------------------------------+ | locations[].inventory | Non-negative Integer | Mandatory | The available inventory at this location. | +---------------------------------------------+-----------------------+-------------+------------------------------------------------------------------------------------------------------------------------+ Output: .. container:: toggle .. container:: header ☰ Toggle **Response Headers** +--------------+--------------------------------+ | Header | Meaning | +==============+================================+ | Content-Type | application/json; | | | charset=utf-8 | +--------------+--------------------------------+ **Status Codes** This call may return the HTTP status codes defined in the table below. +--------+---------------------+ | Status | Interpretation | +========+=====================+ | 200 | Success. | | | IndividualSKUs may | | | have | | | failed. The | | | ``status`` field | | | has to be tested to | | | determine the | | | actual | | | result. | +--------+---------------------+ | 400 | Bad Request | +--------+---------------------+ | 500 | Internal | | | ServerError | +--------+---------------------+ **Payload Model** 1. 200 OK .. literalinclude:: v3/payloads/ListingChangeResponse.json :linenos: :language: json 2. 400 Bad Request .. literalinclude:: v3/payloads/ClientErrorResponse.json :linenos: :language: json 3. 500 Bad Request .. literalinclude:: v3/payloads/ServerErrorResponse.json :linenos: :language: json **Response field descriptions** The response is a map of SKU identifiers to their corresponding update listing response objects. The fields of the update listing response are defined in the table below. +------------------------------------+-------------+-------------+------------------------------------------------------------------+ | Field | Type | Occurrence | Description | +====================================+=============+=============+==================================================================+ | status | Enumeration | Mandatory | Indicates the status of the request. | +------------------------------------+-------------+-------------+------------------------------------------------------------------+ | errors | Array | Conditional | Indicates errors encountered while processing the request, | | | | | if any. | +------------------------------------+-------------+-------------+------------------------------------------------------------------+ | errors[].severity | Enumeration | Mandatory | The severity of the error. Warnings may require no | | | | | further action. | +------------------------------------+-------------+-------------+------------------------------------------------------------------+ | errors[].code | Integer | Mandatory | The error code. | +------------------------------------+-------------+-------------+------------------------------------------------------------------+ | errors[].description | String | Mandatory | The error description. | +------------------------------------+-------------+-------------+------------------------------------------------------------------+ | attribute_errors | Array | Conditional | Indicates validation errors tied to a specified | | | | | request attribute. | +------------------------------------+-------------+-------------+------------------------------------------------------------------+ | attribute_errors[].severity | Enumeration | Mandatory | The severity of the error. Warnings may require no | | | | | further action. | +------------------------------------+-------------+-------------+------------------------------------------------------------------+ | attribute_errors[].code | Integer | Mandatory | The error code. | +------------------------------------+-------------+-------------+------------------------------------------------------------------+ | attribute_errors[].description | String | Mandatory | The error description. | +------------------------------------+-------------+-------------+------------------------------------------------------------------+ | attribute_errors[].path | String | Mandatory | The JSON path to the attribute. | +------------------------------------+-------------+-------------+------------------------------------------------------------------+