Skip to main content
Manage cost configuration that drives every margin calculation in the dashboard. Wraps the /api/costs* endpoints — see the API reference under the Costs group for full request / response shapes. Mutations trigger the same per-order COGS recalculation flow as the web UI — so CLI-driven changes update existing orders identically.

Subcommands

show

Print the full cost configuration as JSON, or filter to a single type.
--type values: global_product_override, order, gateway, shipping, variable, fixed. Required scope: costs:read.

global-override set

Update the default COGS and handling fee. The default COGS applies to variants with no per-variant COG line; the handling fee applies, per unit sold, to variants with no per-variant handling fee. At least one of --default-cogs, --handling-fee, or --currency is required.
The CLI prints a confirmation summary; --yes (or -y) skips it. Required scope: costs:write.

shipping set

Switch the shipping cost attribution method.
--method values: shopify_charges, fixed_rate, shipping_profiles. --fixed-rate is required when --method=fixed_rate. Required scope: costs:write.

lines add

Add a cost line for one of the five line-typed cost surfaces — order, gateway, shipping (profile rule), variable, or fixed. The line body shape depends on --type; supply it as a JSON file via --from-file. The server assigns a ULID for the new line.
Example marketing.json for a variable line (”% of ad spend”):
Example shopify-payments.json for a gateway line:
Example klaviyo-subscription.json for a fixed line:
See the API reference under Costs for the full field set of each cost type (OrderCostLine, GatewayCostLine, ShippingProfileCostLine, VariableCostLine, FixedCostLine). Required scope: costs:write.

lines update

Update an existing cost line by its server-assigned ULID. The JSON file contains a partial update — any subset of the fields valid for that cost type. Omitted fields stay as-is.
Required scope: costs:write.

lines delete

Delete a cost line by its ULID. The CLI prompts for confirmation; --yes (or -y) skips it.
Required scope: costs:write.