Manage cost configuration that drives every margin calculation in the dashboard. Wraps theDocumentation Index
Fetch the complete documentation index at: https://docs.upstackdata.com/llms.txt
Use this file to discover all available pages before exploring further.
/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
| Subcommand | Wraps |
|---|---|
show | GET /api/costs |
global-override set | PUT /api/costs/global-product-override |
shipping set | PUT /api/costs/shipping-settings |
lines add | POST /api/costs/lines |
lines update | PUT /api/costs/lines/{lineId} |
lines delete | DELETE /api/costs/lines/{lineId} |
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 / handling fee applied to product variants that have no per-variant COG line. At least one of--default-cogs, --handling-fee, or --currency is required.
--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.
marketing.json for a variable line (”% of ad spend”):
shopify-payments.json for a gateway line:
klaviyo-subscription.json for a fixed line:
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.costs:write.
lines delete
Delete a cost line by its ULID. The CLI prompts for confirmation;--yes (or -y) skips it.
costs:write.