Import inventory level with csv url or with a csv file
Creates or updates inventory levels from a CSV, supplied either as a multipart file upload or as a url (for example one uploaded through the presigned CSV URL endpoint). The CSV must have the headers variant_id, warehouse_id, on_hand, available, unavailable and committed; the headers of an inventory CSV export (Variant ID, Warehouse ID, Available count and so on) are accepted too. A row needs whole-number counts that are not negative, with on_hand equal to available + committed + unavailable; a row that does not is reported as failed and writes nothing. The response summarises the row outcomes and links to a copy of the CSV annotated with a per-row status. A file with a missing or repeated required header, or that is not a valid CSV, is refused with 422, and so is a request with neither a file nor a url. Requires the inventory.update permission.
curl --request POST \
--url https://api.fluid.app/api/inventory_levels/import_csv \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form url=https://storage.googleapis.com/fluid-production-uploads/uploads/20260914/3b9e4f12-7c5d-4a8e-b1f6-9d2c0e7a5b43/inventory_levels_20260914.csvimport requests
url = "https://api.fluid.app/api/inventory_levels/import_csv"
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"url\"\r\n\r\nhttps://storage.googleapis.com/fluid-production-uploads/uploads/20260914/3b9e4f12-7c5d-4a8e-b1f6-9d2c0e7a5b43/inventory_levels_20260914.csv\r\n-----011000010111000001101001--"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "multipart/form-data"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const form = new FormData();
form.append('url', 'https://storage.googleapis.com/fluid-production-uploads/uploads/20260914/3b9e4f12-7c5d-4a8e-b1f6-9d2c0e7a5b43/inventory_levels_20260914.csv');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.fluid.app/api/inventory_levels/import_csv', 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/import_csv",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"url\"\r\n\r\nhttps://storage.googleapis.com/fluid-production-uploads/uploads/20260914/3b9e4f12-7c5d-4a8e-b1f6-9d2c0e7a5b43/inventory_levels_20260914.csv\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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/import_csv"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"url\"\r\n\r\nhttps://storage.googleapis.com/fluid-production-uploads/uploads/20260914/3b9e4f12-7c5d-4a8e-b1f6-9d2c0e7a5b43/inventory_levels_20260914.csv\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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/import_csv")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"url\"\r\n\r\nhttps://storage.googleapis.com/fluid-production-uploads/uploads/20260914/3b9e4f12-7c5d-4a8e-b1f6-9d2c0e7a5b43/inventory_levels_20260914.csv\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/inventory_levels/import_csv")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"url\"\r\n\r\nhttps://storage.googleapis.com/fluid-production-uploads/uploads/20260914/3b9e4f12-7c5d-4a8e-b1f6-9d2c0e7a5b43/inventory_levels_20260914.csv\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"created": 12,
"updated": 31,
"failed": 1,
"invalid_rows": 0,
"import_status_url": "https://storage.googleapis.com/fluid-production-uploads/uploads/20260914/3b9e4f12-7c5d-4a8e-b1f6-9d2c0e7a5b43/dunder-mifflin_inventory_import_status_20260914153208.csv?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=uploads%40fluid-production.iam.gserviceaccount.com%2F20260914%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20260914T153208Z&X-Goog-Expires=43200&X-Goog-SignedHeaders=host&X-Goog-Signature=4f1c9a7e2b",
"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
}
}{
"error_message": "Missing required headers: variant_id (Variant ID)",
"errors": {},
"meta": {
"request_id": "5f0c2d9e-8b1a-4c3e-9d7f-2a6b8e4c1f03",
"timestamp": "2026-09-14T15:32:08Z"
}
}Body
curl --request POST \
--url https://api.fluid.app/api/inventory_levels/import_csv \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form url=https://storage.googleapis.com/fluid-production-uploads/uploads/20260914/3b9e4f12-7c5d-4a8e-b1f6-9d2c0e7a5b43/inventory_levels_20260914.csvimport requests
url = "https://api.fluid.app/api/inventory_levels/import_csv"
payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"url\"\r\n\r\nhttps://storage.googleapis.com/fluid-production-uploads/uploads/20260914/3b9e4f12-7c5d-4a8e-b1f6-9d2c0e7a5b43/inventory_levels_20260914.csv\r\n-----011000010111000001101001--"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "multipart/form-data"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const form = new FormData();
form.append('url', 'https://storage.googleapis.com/fluid-production-uploads/uploads/20260914/3b9e4f12-7c5d-4a8e-b1f6-9d2c0e7a5b43/inventory_levels_20260914.csv');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.fluid.app/api/inventory_levels/import_csv', 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/import_csv",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"url\"\r\n\r\nhttps://storage.googleapis.com/fluid-production-uploads/uploads/20260914/3b9e4f12-7c5d-4a8e-b1f6-9d2c0e7a5b43/inventory_levels_20260914.csv\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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/import_csv"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"url\"\r\n\r\nhttps://storage.googleapis.com/fluid-production-uploads/uploads/20260914/3b9e4f12-7c5d-4a8e-b1f6-9d2c0e7a5b43/inventory_levels_20260914.csv\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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/import_csv")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"url\"\r\n\r\nhttps://storage.googleapis.com/fluid-production-uploads/uploads/20260914/3b9e4f12-7c5d-4a8e-b1f6-9d2c0e7a5b43/inventory_levels_20260914.csv\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fluid.app/api/inventory_levels/import_csv")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"url\"\r\n\r\nhttps://storage.googleapis.com/fluid-production-uploads/uploads/20260914/3b9e4f12-7c5d-4a8e-b1f6-9d2c0e7a5b43/inventory_levels_20260914.csv\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"created": 12,
"updated": 31,
"failed": 1,
"invalid_rows": 0,
"import_status_url": "https://storage.googleapis.com/fluid-production-uploads/uploads/20260914/3b9e4f12-7c5d-4a8e-b1f6-9d2c0e7a5b43/dunder-mifflin_inventory_import_status_20260914153208.csv?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=uploads%40fluid-production.iam.gserviceaccount.com%2F20260914%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20260914T153208Z&X-Goog-Expires=43200&X-Goog-SignedHeaders=host&X-Goog-Signature=4f1c9a7e2b",
"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
}
}{
"error_message": "Missing required headers: variant_id (Variant ID)",
"errors": {},
"meta": {
"request_id": "5f0c2d9e-8b1a-4c3e-9d7f-2a6b8e4c1f03",
"timestamp": "2026-09-14T15:32:08Z"
}
}