Skip to main content

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:

EndpointWrapper keyWhy
POST /inventory/picking/delivery, /return, /receipt, /return-delivery, /scrapPartnerPickingLets you create one or many pickings in a single call (send an object or an array).
POST /inventory/picking/internal-transferCompanyPickingSame batching behavior, for company-to-company transfers.
PATCH /inventory/picking/{id}/linesPickingLinesAn array of lines to add to an existing picking.
POST /inventory/batchPickingLinesAn 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​

FieldEndpoint(s)What it does
autoValidateAll POST /inventory/picking/* create endpointsAutomatically validates the picking a few seconds after creation, so you don't need a separate Validate a Picking call.
autoCreateBatchAll 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 createAlternate lookup for a product by its internal reference/code, instead of productId/product_id.
default_code (on Product Template)Product Template createOmit or send null/false to auto-generate an internal reference instead of choosing one yourself.
is_rsd_product, rsd_deserialization, global_import, international_exportProduct Template, Picking createsFlags used for external RSD (track-and-trace) and government import/export reporting.
sync_with_pos_category + pos_categ_idCreate/Update a Product CategoryKeeps the inventory category linked to a matching POS category automatically.
prefill_counted_quantityCreate an Inventory AdjustmentPre-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​

StatusMessageCause
400product id or default_code is not validCreate a batch: neither product_id nor default_code resolved to a product.
400No valid products found for the provided lines.A picking create had no resolvable products in lines.
400Product id {id} not foundA specific picking line's product couldn't be resolved.
400Batch/Lot is required for product id {id} as it is a tracked productA tracking: lot product was used without a batch.
400Expiry 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.
400A picking with the same origin already exists with id {id} / ...same note...Duplicate-origin/note protection is enabled for your company/picking type.
400partner_code {code} not foundThe partner_code on a picking didn't match a partner.
400Product ids {ids} are not foundCreate an Inventory Adjustment: invalid product_ids.
400inventory adjustment is already validated for id {id}Tried to validate an adjustment already done.
400invalid ids there is no inventory line ids for ids [...]Update Inventory Adjustment Lines: line IDs don't belong to that adjustment.
401UnauthorizedMissing or invalid Authorization header.
404Record not foundThe id requested on a GET/PATCH/DELETE endpoint doesn't exist (or doesn't belong to the given parent).