Skip to main content

Create battery units (one passport per battery) on a published model

POST 

/api/v1/products/:id/units

Required scope: dpp:draft:write. A WRITE (HMAC + Idempotency-Key). The same operation as the operator portal's unit-list upload. The model must already be published (Approved) by a person in the Traceable UI; this call adds unit identifiers under that published model and never publishes or changes the model itself.

Up to 1,000 units per call (TOO_MANY_UNITS above that; send a larger fleet as several calls). Serials are trimmed and de-duplicated (first row wins). Idempotent per serial: a serial that already exists comes back existing and is never minted twice, so a retry with a new Idempotency-Key is still safe. A unit that already exists keeps its stored batch (storedBatch). A serial or batch that breaks the identifier rule is a per-row invalid result, never a failed call. The plan's battery passport limit is checked for the whole call before the first unit is created (PLAN_LIMIT_REACHED, nothing created). Units are created and audited in chunks of 100; if a call fails part-way, earlier chunks are kept and the same list can simply be sent again. Returns 201 when at least one unit was created, 200 when every row already existed or was invalid.

Request​

Responses​

No new unit (every row existed or was invalid)

Was this page helpful?