curl --request PATCH \
--url https://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/{purchaseOrderId}/items/{lineItemId}/lot \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"lot_id": 3312
}'{
"data": {
"id": 78001,
"purchase_order_id": 9001,
"product_id": 4501,
"lot_id": 3312,
"lot_number": "LOT-2026-0042"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Set or clear a purchase-order line's lot
Assign a lot to a single purchase-order line item, or clear the one it already has, ahead of
receiving. The change is lot-only and stock-neutral — nothing is received, allocated, or costed
— so an automated process can annotate the lots on an active purchase order without going through
the replace-all PUT /purchase-orders/{id}.
Provide exactly one intent:
- Assign — supply a lot identifier (
lot_id, orlot_number/lot_name). By default the lot must already exist for the line’s product; passcreate_lot: trueto create it fromlot_numberon the fly (optionally seedingproduction_date,expiry_dateandmanufacturer_code). - Clear — send
clear_lot: trueto unassign the line’s current lot.
Unassigning is explicit: an absent, empty, or null lot value is never read as a request to
clear — you must send clear_lot: true. This protects unattended callers, where an unset template
variable ("lot_id": "") would otherwise silently wipe a lot the office had already set. Send a
lot identifier or clear_lot, never both.
The lot is resolved against the line’s own product; a lot belonging to a different product, an
unknown lot_number without create_lot, or a non-lot-tracked product all return 422.
curl --request PATCH \
--url https://{companyName}.api.joinluminous.com/external/api/v1/purchase-orders/{purchaseOrderId}/items/{lineItemId}/lot \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"lot_id": 3312
}'{
"data": {
"id": 78001,
"purchase_order_id": 9001,
"product_id": 4501,
"lot_id": 3312,
"lot_number": "LOT-2026-0042"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
Authenticate using a bearer token. To create a token, navigate to /settings/api-tokens and click Create API Token.
Path Parameters
ID of the purchase order the line item belongs to
ID of the purchase-order line item to set the lot on
Body
Supply a lot identifier to assign, or clear_lot: true to unassign. Exactly one of the
two intents is required.
ID of an existing lot on the line's product. Mutually exclusive with lot_number /
lot_name. A null or empty value is not treated as a clear — use clear_lot.
x >= 13312
Lot number to resolve on the line's product. With create_lot: true a matching lot
is created if none exists. Mutually exclusive with lot_id.
255"LOT-2026-0042"
Human-readable lot name, used when resolving by number.
255"Batch 42"
When true, create the lot from lot_number if it does not already exist on the
product. When omitted or false, an unknown lot_number returns 422.
true
Production date to seed on a newly created lot.
"2026-08-01"
Expiry date to seed on a newly created lot.
"2027-08-01"
Manufacturer code to seed on a newly created lot.
255"MFR-77"
Send true to unassign the line's current lot. Cannot be combined with a lot
identifier.
false
Response
Lot set or cleared on the line item
Show child attributes
Show child attributes