> ## Documentation Index
> Fetch the complete documentation index at: https://developers.e-cross.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Update SKU inventory

> Update the available quantity of a SKU in a warehouse

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST 'https://product.api.e-cross.tech/ext/inventories/' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Content-Type: application/json' \
    -d '{
      "skuId": "1234567891",
      "quantity": 49,
      "warehouseId": 1,
      "inventoryType": "AVAILABLE"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "id": "ACME-1234567891-1-AVAILABLE",
    "skuId": "1234567891",
    "skuName": "T-Shirt",
    "merchantId": "ACME",
    "quantity": 3,
    "inventoryType": "AVAILABLE",
    "lastUpdateDate": "2024-01-17T19:58:53.270Z",
    "warehouseId": 1,
    "warehouseName": "Default",
    "warehouseCountry": "ES"
  }
  ```
</ResponseExample>

### Request Parameters

<ParamField body="skuId" type="string" required>
  The SKU ID in the sales channel (the SKU\_ID used to create the SKU).
</ParamField>

<ParamField body="quantity" type="integer" required>
  The available quantity of the SKU. This represents how many pieces can be sold.
</ParamField>

<ParamField body="warehouseId" type="integer" required>
  The ID of the warehouse where the SKU is stocked. Use `1` unless you are informed otherwise.
</ParamField>

<ParamField body="inventoryType" type="string" required>
  The type of inventory to update. Available values are:

  * `AVAILABLE`: available quantity of the SKU for sales.
  * `DAMAGED`: damaged quantity of the SKU. This is used to track the quantity of returned SKUs that are damaged and can't be sold as new.
</ParamField>

### Response Fields

<ResponseField name="id" type="string">
  The unique identifier of this SKU inventory record.
</ResponseField>

<ResponseField name="merchantId" type="string">
  The unique identifier of the merchant within the e-CROSS platform.
</ResponseField>

<ResponseField name="skuId" type="string">
  The SKU ID in the sales channel.
</ResponseField>

<ResponseField name="skuName" type="string">
  The SKU name within e-CROSS. If the SKU isn't registered in the e-CROSS platform, this field won't be returned.
</ResponseField>

<ResponseField name="warehouseId" type="integer">
  The ID of the warehouse where the SKU is stocked.
</ResponseField>

<ResponseField name="warehouseName" type="string">
  The name of the warehouse where the SKU is stocked.
</ResponseField>

<ResponseField name="warehouseCountry" type="string">
  The country of the warehouse where the SKU is stocked.
</ResponseField>

<ResponseField name="quantity" type="integer">
  The quantity of SKUs stocked in this warehouse.
</ResponseField>

<ResponseField name="inventoryType" type="string">
  The type of this inventory record.
</ResponseField>

<ResponseField name="lastUpdateDate" type="string">
  The date and time when the product inventory entry was created or the quantity was changed, in ISO 8601 format.
</ResponseField>

<ResponseField name="lastIntegrationDate" type="string">
  The date and time when the sales channel updated the inventory quantity in their system. If no integration has occurred yet, this field won't be returned.
</ResponseField>

<ResponseField name="returnedOrders" type="array">
  Array containing the orders that generated the inventory position.

  <Expandable title="returnedOrders details">
    <ResponseField name="orderId" type="string">
      The ID of the order that generated the inventory position.
    </ResponseField>

    <ResponseField name="returnedDate" type="string">
      The date and time when the order was returned, in ISO 8601 format.
    </ResponseField>

    <ResponseField name="quantity" type="integer">
      The quantity of the SKU that was returned.
    </ResponseField>
  </Expandable>
</ResponseField>
