Open Inventory / Docs
EndpointsManufacturingResourcesIdStockBuilds

Atomically consume components and create finished stock

The API runs on your application instance. Schemas and field names come directly from the OpenAPI specification. Session-authenticated requests require a session on that instance.

POST
/resources/{id}/stock/builds

Authorization

bearerAuth
headerAuthorizationBearer <inv_ token>

Path Parameters

id*string
Formatuuid

Header Parameters

Idempotency-Key*string

UUID identifying this atomic operation; reuse it only to retry the exact same request.

Formatuuid
X-Organization-ID?string

Organization membership selected for this request. User-bound credentials may select any active membership; standalone tokens may only repeat their pinned organization ID.

Formatuuid

Request Body

application/json
  1. body
outputResourceId?string

Finished item to credit. Must be the requested item or a direct variant. Required when the requested item has finished variants or variable component slots unless outputConfiguration is supplied; componentResourceSelections never infer the output. Explicitly use the primary ID for unassigned output. When building a variant directly, its ID is the default output. Missing or conflicting output selections return 422.

Formatuuid
outputConfiguration?

Complete selection of variable BOM slots for a finished product. Each value must be the slot's component or an active member of its component family. Mutually exclusive with outputResourceId and componentResourceSelections. Reuses a matching finished article or creates just this configuration atomically with the build. Existing manual recipe overrides are preserved. No Cartesian product is stored.

Properties1 <= properties <= 100
quantity*integer
Range1 <= value <= 1000
occurredAt?string
Formatdate-time
location?|
Lengthlength <= 240
note?string
Lengthlength <= 20000
componentResourceSelections?

Maps stable BOM slot keys to either that slot's component resource or an active member of its first-class component family. The selected resource is consumed and snapshotted in build history. When the output is a finished variant, selections must match its complete effective BOM; conflicting substitutions return 422 before any stock is booked.

componentUnitIds?
outputUnitCodes?array<>

Response Body

Replayed the original assembly build

Example Request
curl -X POST 'https://inventory.example.com/api/v1/resources/497f6eca-6276-4993-bfeb-53cbbbba6f08/stock/builds' \  -H 'Idempotency-Key: 497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Content-Type: application/json' \  -d '{  "quantity": 1}'
Example Response
Empty