Inventory Import
Import inventory data via JSON payload or CSV file upload
The Inventory Import API allows external systems to create and update inventory records in Claret. The API supports two methods: JSON payloads for direct integrations and CSV file uploads with optional field mapping.
As with all Claret API endpoints, the Inventory Import API requires token authentication. For instructions on how to retrieve and pass through the authentication token, please refer to the Authentication documentation.
POST Inventory Import
POST https://plan.claret.app/{tenant}/api/v1/inventory/import/process
Import inventory records using either JSON payload or CSV file upload.
Rate Limits:
Maximum 1000 records per request
Request Methods
The API supports two methods for importing inventory data:
JSON Payload
application/json
200 OK
Via UI link only
CSV File Upload
multipart/form-data
202 Accepted
Via job_log_id (programmatic)
JSON Payload Method
Use this method for direct API integrations where you construct inventory records programmatically.
Headers
Content-Type
application/json
Authorization
Bearer {token}
Request Body
source*
string
Must be "api" for API requests
arguments*
object
Processing options (see below)
payload*
array
Array of inventory records to import
(arguments) allow_record_creation*
boolean
Allow creating new inventory records
(arguments) allow_record_update*
boolean
Allow updating existing records
(arguments) should_continue_on_error*
boolean
Continue processing if errors occur
(payload) item_name*
string
Item name (must exist in Claret)
(payload) bin_name*
string
Bin name (must exist in Claret)
(payload) lot_name*
string
Lot name (must exist in Claret)
(payload) date_filled*
string
Date inventory was filled. Format: YYYY-MM-DD
(payload) quantity*
number
Quantity amount (positive number)
(payload) uom*
string
Unit of measure (name or abbreviation)
Example: JSON Payload Request
CSV File Upload Method
Use this method when exporting data from external systems or when you need programmatic job status monitoring.
Headers
Content-Type
multipart/form-data
Authorization
Bearer {token}
Form Fields
file*
file
CSV file to upload (max 10MB)
arguments*
JSON string
Processing options (see below)
field_mappings
JSON string
Required when headers_match_exactly is false
Arguments Object
headers_match_exactly
boolean
Set true if CSV headers match staging column names exactly
allow_record_creation*
boolean
Allow creating new inventory records
allow_record_update*
boolean
Allow updating existing records
should_continue_on_error*
boolean
Continue processing if errors occur
Option A: CSV with Exact Headers
When your CSV file has headers that exactly match Claret's expected column names.
Required CSV Headers:
item_namebin_namelot_namedate_filledquantityuom
Option B: CSV with Custom Headers + Field Mapping
When your CSV file has custom headers (e.g., exports fromm other systems), provide a mapping to Claret's column names.
Field Mappings Object: Maps your CSV headers to Claret's staging column names.
Valid Claret Column Names:
item_namebin_namelot_namedate_filledquantityuom
Checking Job Status
For CSV file uploads, use the returned job_log_id to programmatically monitor import progress.
See the Job Status documentation for details on the status endpoint.
Pre-requisites
Before importing inventory via the API, ensure these entities exist in Claret:
Items
Must exist with exact name matching item_name
Bins
Must exist with exact name matching bin_name
Lots
Must exist with exact name matching lot_name
UOMs
Must exist with name or abbreviation matching uom
Common Errors
Invalid payload structure
Single object instead of array
Wrap record in array: [{...}]
Item with name '...' does not exist
Item name mismatch
Verify item exists in Claret, check exact name
Bin with name '...' does not exist
Bin name mismatch
Verify bin exists in Claret, check exact name
Invalid file type. Only CSV files are allowed.
Non-CSV file uploaded
Upload a valid CSV file (.csv extension)
File size exceeds maximum allowed size of 10MB
File too large
Split into multiple smaller files
Field mappings are required
Missing field_mappings when headers don't match
Provide field_mappings parameter
Invalid mapping target
Invalid Claret column name in mapping
Use only: item_name, bin_name, lot_name, date_filled, quantity, uom
Last updated
Was this helpful?