Create Repair Cost
POST/api/repairs/:repair/costs
Adds a cost line of any type to a repair. Consumed lines post to the general ledger. A part with a line, product and warehouse moves stock at FIFO; use Add Part to Unit to pick lots, serials or another unit of measure.
repairs:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Fields:
repair_order_line_id(integer, optional; required whentypeispart) — the unit the cost belongs to; leave empty for a repair-level cost such as freight. Must be on this repair.type(string, required) —part,labour,vendor_service,freight_inbound,freight_outbound,assessment_fee,other.description(string, required, max 255).quantity(number, optional, > 0, max 100000) — default 1.unit_cost(number, required, ≥ 0).bill_price(number, optional, ≥ 0) — unit price charged when billed to the customer.bill_to(string, optional) —warranty,goodwill,customer,supplier. Defaults from the unit's coverage (in warranty →warranty, out of warranty →customer).state(string, optional) —plannedorconsumed(defaultconsumed).operation(string, optional) — parts only:add,remove(a component taken off a brand-owned unit back into stock),recycle.product_id(integer) — required whentypeispart.warehouse_id(integer, optional; required whentypeispart).repair_shipment_id(integer, optional) — link a freight cost to a repair shipment.purchase_order_id(integer, optional) — link a cost to a purchase order.
A part cost always moves real stock, so it needs the unit, product and warehouse — without them the request is refused with 422 rather than recorded as a plain cost line. A consumed part is refused with 422 when free stock is short ("Only N on hand at <warehouse>").
Authentication: Bearer token with the repairs:write scope.
Request
Responses
- 200
- 401
- 403
- 404
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Unprocessable Entity
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.