How to Integrate
This guide ties together the Inventory Product Template, Product, Batch, Picking, Active Ingredient, Product Brand, Product Category, and Inventory Adjustments endpoints into a single, practical walkthrough for building an inventory integration against API v1: the request body conventions shared across endpoints, every automation field, a full end-to-end example, how to query the resulting data, and how to handle errors.
Prerequisites
- A valid API key — see the Authentication Guide.
- All requests are made to
https://{account-name}.juleb.com/api/v1. - All examples below send
Authorization: ******— replace it with your real API key.
The *Picking / PickingLines body wrapper
Unlike most other POST/PATCH endpoints in the API, several Inventory write endpoints wrap
their payload in a named key instead of sending the fields flat at the top level:
| Endpoint | Wrapper key | Why |
|---|---|---|
POST /inventory/picking/delivery, /return, /receipt, /return-delivery, /scrap | PartnerPicking | Lets you create one or many pickings in a single call (send an object or an array). |
POST /inventory/picking/internal-transfer | CompanyPicking | Same batching behavior, for company-to-company transfers. |
PATCH /inventory/picking/{id}/lines | PickingLines | An array of lines to add to an existing picking. |
POST /inventory/batch | PickingLines | An array of batches/lots to create (the key name is reused from the picking lines DTO). |
For example, creating a delivery is not:
{ "companyId": 1, "lines": [...] }
but instead:
{ "PartnerPicking": { "companyId": 1, "lines": [...] } }
See Create a delivery for the full field reference that the other picking-creation endpoints share.
Automation fields
| Field | Endpoint(s) | What it does |
|---|---|---|
autoValidate | All POST /inventory/picking/* create endpoints | Automatically validates the picking a few seconds after creation, so you don't need a separate Validate a Picking call. |
autoCreateBatch | All POST /inventory/picking/* create endpoints (always on for receipt) | Creates a missing batch/lot named in a line's batch automatically (requires expiry on that line). |
default_code (on picking lines, and on Create a batch) | Picking lines, Batch create | Alternate lookup for a product by its internal reference/code, instead of productId/product_id. |
default_code (on Product Template) | Product Template create | Omit or send null/false to auto-generate an internal reference instead of choosing one yourself. |
is_rsd_product, rsd_deserialization, global_import, international_export | Product Template, Picking creates | Flags used for external RSD (track-and-trace) and government import/export reporting. |
sync_with_pos_category + pos_categ_id | Create/Update a Product Category | Keeps the inventory category linked to a matching POS category automatically. |
prefill_counted_quantity | Create an Inventory Adjustment | Pre-fills each count line with the current theoretical on-hand quantity instead of starting at 0. |
Full flow example: product → batch → receipt → validate
A typical onboarding flow for a new trackable product:
1. Create the product template
POST /inventory/product-template
{
"type": "product",
"categ_id": 12,
"name": "Paracetamol 500mg",
"tracking": "lot",
"uom_id": 1,
"uom_po_id": 1
}
See Create a Product Template for the full field list. Note
the returned id — you'll need it for the next steps.
2. Create a batch/lot for it (optional — receipts can auto-create one)
POST /inventory/batch
{
"PickingLines": [
{ "name": "LOT-0001", "product_id": 9123, "company_id": 1, "life_date": "2026-01-01" }
]
}
See Create a batch. You can skip this step and instead set
autoCreateBatch: true (or just use a receipt, where it's automatic) on the next step.
3. Receive stock for it
POST /inventory/picking/receipt
{
"PartnerPicking": {
"companyId": 1,
"partnerId": 51,
"autoValidate": true,
"lines": [
{ "productId": 9123, "productQty": 100, "batch": "LOT-0001", "expiry": "2026-01-01" }
]
}
}
See Create a receipt. With autoValidate: true you don't need to call
validate yourself — otherwise, continue to step 4.
4. Validate the picking (skip if autoValidate was used)
POST /inventory/picking/validate
{ "id": 11010 }
See Validate a Picking.
5. Read the results back
GET /inventory/picking/11010
GET /inventory/picking/11010/line
GET /inventory/product-template/9123
Querying the data afterward
Every GET list endpoint in this module supports the same fields / filter / page /
limit query parameters — see Mastering API Queries for the full
syntax. A few examples:
# Products with low list price
GET /inventory/product-template?fields=id,name,list_price&filter=list_price<50&page=1&limit=50
# Pickings awaiting validation for a company
GET /inventory/picking?fields=id,name,state,company_id&filter=state=assigned&company_id=1
# Inventory adjustments still in progress
GET /inventory/inventory-adjustments?fields=id,name,state&filter=state=confirm
Error handling
| Status | Message | Cause |
|---|---|---|
| 400 | product id or default_code is not valid | Create a batch: neither product_id nor default_code resolved to a product. |
| 400 | No valid products found for the provided lines. | A picking create had no resolvable products in lines. |
| 400 | Product id {id} not found | A specific picking line's product couldn't be resolved. |
| 400 | Batch/Lot is required for product id {id} as it is a tracked product | A tracking: lot product was used without a batch. |
| 400 | Expiry date is required to create batch/lot {batch} for product id {id} | autoCreateBatch (or a receipt) needed to create a batch but expiry was missing. |
| 400 | A picking with the same origin already exists with id {id} / ...same note... | Duplicate-origin/note protection is enabled for your company/picking type. |
| 400 | partner_code {code} not found | The partner_code on a picking didn't match a partner. |
| 400 | Product ids {ids} are not found | Create an Inventory Adjustment: invalid product_ids. |
| 400 | inventory adjustment is already validated for id {id} | Tried to validate an adjustment already done. |
| 400 | invalid ids there is no inventory line ids for ids [...] | Update Inventory Adjustment Lines: line IDs don't belong to that adjustment. |
| 401 | Unauthorized | Missing or invalid Authorization header. |
| 404 | Record not found | The id requested on a GET/PATCH/DELETE endpoint doesn't exist (or doesn't belong to the given parent). |
Related endpoints
- Product Template and Product — generic product data and variants.
- Batch — lot/serial batches.
- Picking — deliveries, receipts, returns, internal transfers, scraps.
- Active Ingredient, Product Brand, Product Category — product classification.
- Inventory Adjustments — stock counts/cycle counts.