Update Cost Category
PUT/api/cost-categories/:cost_category
Update an existing cost category.
settings:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Authentication: Requires Bearer token.
Request body fields:
name(required, string, max:255) — unique category name (ignores this record for the uniqueness check)default_nominal_code_id(optional, integer, nullable) — default posting nominal code; must exist innominal_codes. Send null to clear it and fall back to the nominal code mapping settings.
Note: the name of a system cost category cannot be changed (returns 422).
cogs_nominal_code_id (integer, optional, nullable) — the account this category's share of cost of goods sold posts to. When a shipped unit's landed cost includes this category (e.g. customs duty or inbound freight), that portion is expensed to this account instead of the order's COGS account, and a restocked return reverses it from the same account. Null keeps the share in the order's COGS account. Orders whose product or sub-sales channel has its own COGS account post the whole cost there. Omit the field to leave the current value unchanged.
cogs_accounts (array, optional) — per-channel COGS accounts for this category. Each item has nominal_code_id (required) and exactly one of sales_channel_id or sub_sales_channel_id. For an order, the most specific account wins: its sub-sales channel, then its sales channel, then cogs_nominal_code_id. A sub-sales channel that has its own COGS account posts the whole cost there unless it is listed here. Get the channel ids from List Cost Category COGS Channels. Sending the array replaces the current list; omit it to leave the list unchanged.
Request
Responses
- 200
- 401
- 403
- 404
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Unprocessable Entity
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.