Skip to main content
PUT
/
v1
/
listings
/
{id}
/
inventory
Update Listing Inventory
curl --request PUT \
  --url https://api.treet-test.co/v1/listings/{id}/inventory \
  --header 'Content-Type: application/json' \
  --header 'X-Treet-Authentication-Key: <api-key>' \
  --header 'X-Treet-Client-Id: <api-key>' \
  --data '
{
  "action": "SET_INVENTORY",
  "oldInventory": 5,
  "newInventory": 3
}
'
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "availableInventory": 3
}

Authorizations

X-Treet-Client-Id
string
header
required
X-Treet-Authentication-Key
string
header
required

Path Parameters

id
string<uuid>
required

The listing ID.

Body

application/json

Inventory update action

action
enum<string>
required

The inventory update operation to perform.

  • SET_INVENTORY — sets inventory to an exact value. Requires oldInventory and newInventory.
  • ADJUST_INVENTORY — adjusts inventory by a delta. Requires inventoryAdjustment.
Available options:
SET_INVENTORY,
ADJUST_INVENTORY
oldInventory
integer

The expected current inventory count. The update will only proceed if the listing's current inventory matches this value.

*Required if action is SET_INVENTORY

Required range: x >= 0
newInventory
integer

The inventory value to set.

*Required if action is SET_INVENTORY

Required range: x >= 0
inventoryAdjustment
integer

The amount to add (positive) or subtract (negative) from the current inventory.

*Required if action is ADJUST_INVENTORY

Response

Inventory updated successfully

id
string
required

The Treet listing ID.

Example:

"550e8400-e29b-41d4-a716-446655440000"

availableInventory
integer
required

The updated available inventory count.

Required range: x >= 0
Example:

3