Add a cost line
Add a new cost line for one of the five line-typed cost surfaces
— order, gateway, shipping (profile rule), variable, or
fixed. The server assigns a ULID for the new line.
The line body is discriminated by costType — see the
per-type schemas (OrderCostLine, GatewayCostLine,
ShippingProfileCostLine, VariableCostLine, FixedCostLine)
for the shape required by each.
Triggers a per-order COGS recalculation downstream — except for
variable and fixed, which apply at aggregate report time and
do not require per-order recalc.
Required scope: costs:write.
Authorizations
Your Upstack API key. Starts with upstack_.
The pixel id the request targets.
Body
line shape is discriminated by costType — the listed schemas
for each cost type are validated server-side. Sending an
OrderCostLine shape with costType=variable is rejected with 400.
The five cost-line surfaces. Each value selects the corresponding
line shape in the line (POST) or updates (PUT) field of the
request body.
order, gateway, shipping, variable, fixed One of the per-type line shapes, selected by costType.
- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
Response
The updated cost config (with the new line appended).