Upsert a cost type
Create or update a single cost type. This is one endpoint for both operations: omit id to create a new cost type (responds 201), or pass the id of an existing cost type to update it (responds 200). The URL and request shape are identical either way.
On create, name, cost_per_unit, unit_type_id and allow_inline_edits are all required. On update the body is sparse — only the fields you send are changed, and any field you omit keeps its current value. unit_type_id is immutable: once a cost type has a unit type it cannot be reassigned, so sending a different unit_type_id on update is rejected. name must be unique within your company, compared case-insensitively, among cost types that are both active and not soft-deleted; inactive or deleted cost types do not reserve their name, so deactivating or deleting a cost type frees its name for reuse. cost_per_unit must be non-zero (it may be negative).
A cost type is configuration, not a transaction: this endpoint writes only the cost-type template itself. It does not create, consume, reserve, or release inventory, and it never syncs to Metrc or BioTrack — cost types have no compliance identity of their own. It also does not touch costs already applied from this cost type: each applied cost (on a plant, a package or batch, an assembly or breakdown output, a purchase item, or a product) snapshots its own amount and quantity at apply time, so changing this cost type's cost_per_unit or allow_inline_edits affects only future applications, never historical cost records.
Required permission: costs_permissions_manage_cost_types.
Request body
Response
The updated cost type
Changes
No recorded changes to this endpoint across all 1 revision of this API.