Update a cost rule
Update an existing cost rule. Same body shape as create, but every field is
optional — send the fields you intend to change. Nested collections
(scopes, conditions, tiers) replace the existing set when provided.
Requires the tenant Cost Rules feature flag.
This endpoint also accepts POST /cost-rules/{id} for clients that cannot
send PUT.
Delete is not exposed on the External API — set status to INACTIVE
to deactivate a rule.
Authorizations
Authenticate using a bearer token. To create a token, navigate to /settings/api-tokens and click Create API Token.
Path Parameters
Cost rule ID.
Body
Supplier / factory ID. Required on create unless output_kind is EXTRA_COST
(where the supplier is an optional document condition). Optional on update.
Rule name. Required on create. Must be unique per vendor among non-deleted rules.
2551000Document types the rule applies to. Required on create (or provide singular document_type).
1PURCHASE_ORDER, WORK_ORDER, SHIPMENT Singular alternative to document_types (back-compat).
PURCHASE_ORDER, WORK_ORDER, SHIPMENT Defaults to NON_GRADUATED.
NON_GRADUATED, GRADUATED Defaults to LINE.
LINE, SCOPE_GROUP Defaults to 100.
1 <= x <= 1000Defaults to ACTIVE on create.
ACTIVE, INACTIVE, DRAFT Must be on or after effective_from.
x >= 0x >= 0Defaults to UNIT_COST.
UNIT_COST, EXTRA_COST 255UNIT_BASED_ALLOCATION, VOLUME_BASED_ALLOCATION, WEIGHT_BASED_ALLOCATION, VALUE_BASED_ALLOCATION Required when output_kind is EXTRA_COST.
PERCENTAGE, FIXED Required when output_kind is EXTRA_COST.
x >= 030Product / category / tag / supplier-SKU scopes. Replaces existing scopes when provided.
Document-level applicability gates. Replaces existing conditions when provided.
Quantity tiers with their effects. Replaces existing tiers when provided.
Response
Cost rule updated.
A cost rule — vendor-scoped tiered pricing or extra-cost rule applied to
purchase orders, work orders, and shipments. Nested scopes, conditions,
and tiers (with effects) are only present when the relation is loaded
(always on GET /cost-rules/{id}).