Skip to main content
PATCH

Authorizations

Authorization
string
header
required

Authenticate using a bearer token. To create a token, navigate to /settings/api-tokens and click Create API Token.

Path Parameters

purchaseOrderId
integer
required

ID of the purchase order the line item belongs to

lineItemId
integer
required

ID of the purchase-order line item to set the lot on

Body

application/json

Supply a lot identifier to assign, or clear_lot: true to unassign. Exactly one of the two intents is required.

lot_id
integer | null

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.

Required range: x >= 1
Example:

3312

lot_number
string | null

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.

Maximum string length: 255
Example:

"LOT-2026-0042"

lot_name
string | null

Human-readable lot name, used when resolving by number.

Maximum string length: 255
Example:

"Batch 42"

create_lot
boolean

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.

Example:

true

production_date
string<date> | null

Production date to seed on a newly created lot.

Example:

"2026-08-01"

expiry_date
string<date> | null

Expiry date to seed on a newly created lot.

Example:

"2027-08-01"

manufacturer_code
string | null

Manufacturer code to seed on a newly created lot.

Maximum string length: 255
Example:

"MFR-77"

clear_lot
boolean

Send true to unassign the line's current lot. Cannot be combined with a lot identifier.

Example:

false

Response

Lot set or cleared on the line item

data
object