What-if calculation

POST /api/v1/inventory/production/runs/{run_id}/calculate

Recalculate costs without persisting. Override total_units and/or unit_sale_price.

Operation ID: calculate_run_api_v1_inventory_production_runs__run_id__calculate_post · View as markdown · OpenAPI slice

Authentication

Bearer token authentication. Pass your DayZero API token in the Authorization header and the target business UUID in x-business-id.

Parameters

Path

run_id string required

Request body

total_units integer
unit_sale_price integer

Responses

201 Successful Response

materials_by_category object

Cost per category in cents.

processing_steps_by_type object

Cost per step_type in cents.

material_line_items array · object
step_line_items array · object
total_cost integer
cost_per_unit integer
sales_potential integer
gross_profit integer
gross_margin_pct number
total_weight number
total_weight_unit string

404 Not Found - Resource does not exist

422 Validation Error

detail array · ValidationError ValidationError
5 fields
loc array · string | integer required
msg string required
type string required
input object
ctx object