Skip to main content
POST
/
api
/
v1
/
inventory_levels
/
set
Set Inventory Level
curl --request POST \
  --url https://api.launchmystore.io/api/v1/inventory_levels/set \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "inventory_item_id": "<string>",
  "location_id": "<string>",
  "available": 123,
  "reason": "<string>"
}
'
{
  "success": true,
  "data": {
    "inventory_item_id": "<string>",
    "location_id": "<string>",
    "variant_id": "<string>",
    "sku": "<string>",
    "available": 123,
    "incoming": 123,
    "committed": 123,
    "on_hand": 123,
    "updated_at": "<string>"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.launchmystore.io/llms.txt

Use this file to discover all available pages before exploring further.

Set Inventory Level

Sets the inventory level for an inventory item at a location to an absolute value. Unlike adjust, this sets the exact quantity rather than adding or subtracting.

Request

curl -X POST "https://api.launchmystore.io/api/v1/inventory_levels/set" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "inventory_item_id": "inv_abc123",
    "location_id": "loc_main",
    "available": 100,
    "reason": "Physical inventory count"
  }'

Body Parameters

inventory_item_id
string
required
The inventory item ID to update
location_id
string
required
The location ID where the inventory should be set
available
integer
required
The absolute available quantity to set (must be >= 0)
reason
string
Reason for setting the inventory (for audit trail)

Response

success
boolean
Whether the request succeeded
data
object
The updated inventory level

Example Response

{
  "success": true,
  "data": {
    "inventory_item_id": "inv_abc123",
    "location_id": "loc_main",
    "variant_id": "var_xyz789",
    "sku": "TSHIRT-S-BLK",
    "available": 100,
    "incoming": 50,
    "committed": 0,
    "on_hand": 100,
    "updated_at": "2024-01-25T10:00:00Z"
  }
}

Connect Inventory Item to Location

Before setting inventory levels, ensure the inventory item is connected to the location:
curl -X POST "https://api.launchmystore.io/api/v1/inventory_levels/connect" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "inventory_item_id": "inv_abc123",
    "location_id": "loc_warehouse2"
  }'

Disconnect from Location

To remove inventory from a location entirely:
curl -X DELETE "https://api.launchmystore.io/api/v1/inventory_levels" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "inventory_item_id": "inv_abc123",
    "location_id": "loc_warehouse2"
  }'

Use Cases

ScenarioEndpoint to Use
Physical count reconciliationset - Set to exact counted value
Receiving shipmentadjust - Add received quantity
Damaged goodsadjust - Subtract damaged quantity
Opening new locationconnect then set
Closing locationdisconnect (moves to other locations or sets to 0)

Error Codes

CodeDescription
UNAUTHORIZEDInvalid or missing access token
FORBIDDENApp doesn’t have write_inventory scope
NOT_FOUNDInventory item or location not found
NOT_CONNECTEDInventory item not connected to this location
VALIDATION_ERRORInvalid request body (e.g., negative quantity)