Skip to main content

Create Cost Category

POST 

/api/cost-categories

Create a new cost category.

Required scope: settings:write

Grant 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
  • default_nominal_code_id (optional, integer, nullable) — the nominal code a landed-cost bill line assigned to this category posts its debit to by default. Must exist in nominal_codes. Leave null to fall back to the nominal code mapping settings at posting time.

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.

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.

Request​

Responses​

Created

Response Headers
    Content-Type