Inventory
Set Inventory Level
Updates an inventory level if found or creates if not found for given variant in a warehouse. Adds an audit log entry for the operation. Returns 201 when a new level is created and 200 when an existing one is updated. Requires the inventory.update permission.
POST
/
api
/
inventory_levels
/
set
Set Inventory Level
curl --request POST \
--url https://api.fluid.app/api/inventory_levels/set \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"inventory_level": {
"variant_id": 70421,
"warehouse_id": 212,
"available": 240,
"committed": 12,
"unavailable": 4,
"reason": "Opening stock for Scranton warehouse"
}
}
'import requests
url = "https://api.fluid.app/api/inventory_levels/set"
payload = { "inventory_level": {
"variant_id": 70421,
"warehouse_id": 212,
"available": 240,
"committed": 12,
"unavailable": 4,
"reason": "Opening stock for Scranton warehouse"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
inventory_level: {
variant_id: 70421,
warehouse_id: 212,
available: 240,
committed: 12,
unavailable: 4,
reason: 'Opening stock for Scranton warehouse'
}
})
};
fetch('https://api.fluid.app/api/inventory_levels/set', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fluid.app/api/inventory_levels/set",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'inventory_level' => [
'variant_id' => 70421,
'warehouse_id' => 212,
'available' => 240,
'committed' => 12,
'unavailable' => 4,
'reason' => 'Opening stock for Scranton warehouse'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fluid.app/api/inventory_levels/set"
payload := strings.NewReader("{\n \"inventory_level\": {\n \"variant_id\": 70421,\n \"warehouse_id\": 212,\n \"available\": 240,\n \"committed\": 12,\n \"unavailable\": 4,\n \"reason\": \"Opening stock for Scranton warehouse\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.fluid.app/api/inventory_levels/set")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"inventory_level\": {\n \"variant_id\": 70421,\n \"warehouse_id\": 212,\n \"available\": 240,\n \"committed\": 12,\n \"unavailable\": 4,\n \"reason\": \"Opening stock for Scranton warehouse\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/inventory_levels/set")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"inventory_level\": {\n \"variant_id\": 70421,\n \"warehouse_id\": 212,\n \"available\": 240,\n \"committed\": 12,\n \"unavailable\": 4,\n \"reason\": \"Opening stock for Scranton warehouse\"\n }\n}"
response = http.request(request)
puts response.read_body{
"inventory_level": {
"id": 48213,
"committed": 12,
"available": 240,
"on_hand": 256,
"unavailable": 4,
"adjustments": null,
"unavailable_item_counts_by_category": null,
"warning": null,
"variant": {
"id": 70421,
"sku": "DM-20LB-CASE",
"track_quantity": true,
"keep_selling": false
},
"product": {
"id": 31877,
"title": "Dunder Mifflin 20lb Copy Paper",
"image_url": "https://cdn.fluid.app/dunder-mifflin/products/20lb-copy-paper.jpg"
},
"warehouse": {
"id": 212,
"country": {
"id": 233,
"name": "United States",
"iso": "US"
},
"address": {
"id": 90544,
"city": "Scranton",
"state": "PA",
"address1": "1725 Slough Avenue",
"postal_code": "18505"
}
}
},
"meta": {
"request_id": "5f0c2d9e-8b1a-4c3e-9d7f-2a6b8e4c1f03",
"timestamp": "2026-09-14T15:32:08Z"
}
}{
"inventory_level": {
"id": 48213,
"committed": 12,
"available": 240,
"on_hand": 256,
"unavailable": 4,
"adjustments": null,
"unavailable_item_counts_by_category": null,
"warning": null,
"variant": {
"id": 70421,
"sku": "DM-20LB-CASE",
"track_quantity": true,
"keep_selling": false
},
"product": {
"id": 31877,
"title": "Dunder Mifflin 20lb Copy Paper",
"image_url": "https://cdn.fluid.app/dunder-mifflin/products/20lb-copy-paper.jpg"
},
"warehouse": {
"id": 212,
"country": {
"id": 233,
"name": "United States",
"iso": "US"
},
"address": {
"id": 90544,
"city": "Scranton",
"state": "PA",
"address1": "1725 Slough Avenue",
"postal_code": "18505"
}
}
},
"meta": {
"request_id": "5f0c2d9e-8b1a-4c3e-9d7f-2a6b8e4c1f03",
"timestamp": "2026-09-14T15:32:08Z"
}
}{
"error_message": "inventory_level variant must belong to this company",
"errors": [],
"meta": {
"request_id": "5f0c2d9e-8b1a-4c3e-9d7f-2a6b8e4c1f03",
"timestamp": "2026-09-14T15:32:08Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"code": "<string>",
"blocked_date": "2026-11-30",
"blocked_day": 30,
"allowed_date": "2026-11-28",
"scheduled_date": "2026-12-10",
"last_bill_date": "2026-11-10",
"requested_date": "2026-11-30",
"payment_uuid": "<string>",
"error_details": [
{
"code": "<string>",
"field": "<string>",
"payment": "not_attempted",
"message": "<string>"
}
],
"coded_recovery": true
}
}⌘I
Set Inventory Level
curl --request POST \
--url https://api.fluid.app/api/inventory_levels/set \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"inventory_level": {
"variant_id": 70421,
"warehouse_id": 212,
"available": 240,
"committed": 12,
"unavailable": 4,
"reason": "Opening stock for Scranton warehouse"
}
}
'import requests
url = "https://api.fluid.app/api/inventory_levels/set"
payload = { "inventory_level": {
"variant_id": 70421,
"warehouse_id": 212,
"available": 240,
"committed": 12,
"unavailable": 4,
"reason": "Opening stock for Scranton warehouse"
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
inventory_level: {
variant_id: 70421,
warehouse_id: 212,
available: 240,
committed: 12,
unavailable: 4,
reason: 'Opening stock for Scranton warehouse'
}
})
};
fetch('https://api.fluid.app/api/inventory_levels/set', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.fluid.app/api/inventory_levels/set",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'inventory_level' => [
'variant_id' => 70421,
'warehouse_id' => 212,
'available' => 240,
'committed' => 12,
'unavailable' => 4,
'reason' => 'Opening stock for Scranton warehouse'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fluid.app/api/inventory_levels/set"
payload := strings.NewReader("{\n \"inventory_level\": {\n \"variant_id\": 70421,\n \"warehouse_id\": 212,\n \"available\": 240,\n \"committed\": 12,\n \"unavailable\": 4,\n \"reason\": \"Opening stock for Scranton warehouse\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.fluid.app/api/inventory_levels/set")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"inventory_level\": {\n \"variant_id\": 70421,\n \"warehouse_id\": 212,\n \"available\": 240,\n \"committed\": 12,\n \"unavailable\": 4,\n \"reason\": \"Opening stock for Scranton warehouse\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/inventory_levels/set")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"inventory_level\": {\n \"variant_id\": 70421,\n \"warehouse_id\": 212,\n \"available\": 240,\n \"committed\": 12,\n \"unavailable\": 4,\n \"reason\": \"Opening stock for Scranton warehouse\"\n }\n}"
response = http.request(request)
puts response.read_body{
"inventory_level": {
"id": 48213,
"committed": 12,
"available": 240,
"on_hand": 256,
"unavailable": 4,
"adjustments": null,
"unavailable_item_counts_by_category": null,
"warning": null,
"variant": {
"id": 70421,
"sku": "DM-20LB-CASE",
"track_quantity": true,
"keep_selling": false
},
"product": {
"id": 31877,
"title": "Dunder Mifflin 20lb Copy Paper",
"image_url": "https://cdn.fluid.app/dunder-mifflin/products/20lb-copy-paper.jpg"
},
"warehouse": {
"id": 212,
"country": {
"id": 233,
"name": "United States",
"iso": "US"
},
"address": {
"id": 90544,
"city": "Scranton",
"state": "PA",
"address1": "1725 Slough Avenue",
"postal_code": "18505"
}
}
},
"meta": {
"request_id": "5f0c2d9e-8b1a-4c3e-9d7f-2a6b8e4c1f03",
"timestamp": "2026-09-14T15:32:08Z"
}
}{
"inventory_level": {
"id": 48213,
"committed": 12,
"available": 240,
"on_hand": 256,
"unavailable": 4,
"adjustments": null,
"unavailable_item_counts_by_category": null,
"warning": null,
"variant": {
"id": 70421,
"sku": "DM-20LB-CASE",
"track_quantity": true,
"keep_selling": false
},
"product": {
"id": 31877,
"title": "Dunder Mifflin 20lb Copy Paper",
"image_url": "https://cdn.fluid.app/dunder-mifflin/products/20lb-copy-paper.jpg"
},
"warehouse": {
"id": 212,
"country": {
"id": 233,
"name": "United States",
"iso": "US"
},
"address": {
"id": 90544,
"city": "Scranton",
"state": "PA",
"address1": "1725 Slough Avenue",
"postal_code": "18505"
}
}
},
"meta": {
"request_id": "5f0c2d9e-8b1a-4c3e-9d7f-2a6b8e4c1f03",
"timestamp": "2026-09-14T15:32:08Z"
}
}{
"error_message": "inventory_level variant must belong to this company",
"errors": [],
"meta": {
"request_id": "5f0c2d9e-8b1a-4c3e-9d7f-2a6b8e4c1f03",
"timestamp": "2026-09-14T15:32:08Z"
}
}{
"message": "<string>",
"error": "<string>",
"error_message": "<string>",
"errors": "<string>",
"meta": {
"request_id": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"code": "<string>",
"blocked_date": "2026-11-30",
"blocked_day": 30,
"allowed_date": "2026-11-28",
"scheduled_date": "2026-12-10",
"last_bill_date": "2026-11-10",
"requested_date": "2026-11-30",
"payment_uuid": "<string>",
"error_details": [
{
"code": "<string>",
"field": "<string>",
"payment": "not_attempted",
"message": "<string>"
}
],
"coded_recovery": true
}
}