Skip to main content
PUT
/
ecommerce
/
inventories
/
{id}
Update Inventory
curl --request PUT \
  --url https://api.rootfi.dev/v4/ecommerce/inventories/{id} \
  --header 'Content-Type: application/json' \
  --header 'api_key: <api-key>' \
  --data '
{
  "data": [
    {
      "item_id": "<string>",
      "variant_id": "<string>",
      "sku": "<string>",
      "quantity": 123,
      "reserved_quantity": 123,
      "available_quantity": 123,
      "status": "in_stock",
      "is_trackable": true,
      "reorder_level": 123,
      "reorder_quantity": 123,
      "addresses": [
        {
          "rootfi_id": 123,
          "platform_id": "<string>",
          "type": "billing",
          "street": "<string>",
          "city": "<string>",
          "state": "<string>",
          "postal_code": "<string>",
          "country": "<string>"
        }
      ],
      "created_at": "<string>",
      "updated_at": "<string>"
    }
  ]
}
'
{
  "rootfi_id": 157,
  "rootfi_created_at": "2024-01-22T05:07:31.465Z",
  "rootfi_updated_at": "2024-01-22T05:07:31.465Z",
  "rootfi_company_id": 1089,
  "platform_id": "123456_1",
  "product_id": "prod_789",
  "sku": "WH-2024-BLK",
  "quantity": 45
}
Update an existing inventory record in the e-commerce platform. Only provided fields will be updated.

Path Parameters

ParameterTypeRequiredDescription
idstringYesThe rootfi_id or platform_id of the inventory record to update

Request Body

FieldTypeRequiredDescription
quantityintegerNoAvailable quantity in stock
reserved_quantityintegerNoQuantity reserved for pending orders
warehouse_locationstringNoWarehouse or location identifier
See Inventory Overview for complete field details.

Authorizations

api_key
string
header
required

Path Parameters

id
string
required

The rootfi_id or platform_id of the inventory record

Body

application/json
data
ecommerceInventoriesFields · object[]
required

The data of the inventories endpoint

Response

Inventory updated successfully

V4 Inventory object with comprehensive stock tracking

rootfi_id
number<double>
required

The unique ID we assign for that data's information

Example:

157

rootfi_created_at
string<date-time>
required

The date at which RootFi first synced this data

Example:

"2024-01-22T05:07:31.465Z"

rootfi_updated_at
string<date-time>
required

The latest date at which RootFi updated this data

Example:

"2024-01-22T05:07:31.000Z"

rootfi_company_id
number<double>
required

The ID of the company in the accounting platform

Example:

1089

platform_id
string
required

An unique custom RootFi ID made from platform's unique_id.

Example:

"123456"

rootfi_deleted_at
string<date-time> | null

The date at which the data was deleted in the accounting platform

platform_unique_id
string | null

The ID of the data in the accounting platform.

raw_data
object

A JSON containing fields that you can directly get from the accounting platform.

data_hash
string | null

The hash of the data

item_id
string | null

Reference to the Item being tracked

variant_id
string | null

Reference to the specific Variant being tracked

sku
string | null

Stock Keeping Unit for this inventory item

quantity
integer | null

Total physical quantity in stock

reserved_quantity
integer | null

Quantity allocated to pending orders but not yet shipped

available_quantity
integer | null

Quantity available for new orders (quantity - reserved_quantity)

status
enum<string> | null

Current inventory status

Available options:
in_stock,
low_stock,
out_of_stock,
discontinued,
unknown
is_trackable
boolean | null

Whether inventory levels are actively monitored for this item

reorder_level
integer | null

Quantity threshold that triggers reorder alerts

reorder_quantity
integer | null

Suggested quantity to reorder when stock is low

addresses
ecommerceV4AddressObject · object[] | null

Warehouse locations where this inventory is stored

created_at
string | null

When this inventory record was created

updated_at
string | null

When this inventory record was last updated