Skip to main content

Resolve Repair Line

POST 

/api/repairs/:repair/lines/:line/resolve

Resolves a unit with an outcome and creates whatever the outcome needs: a return shipment, a replacement or parts sales order, a refund or store credit, a discount code, a stock capitalization, or a scrap adjustment. The unit moves to the resolved stage and the repair's status rolls up. A unit that is at a repair vendor on an open dispatch can't be resolved (422 on outcome) until it is received back, or claimed as missing if the vendor lost it; the line's resolve_blocked_reason says why. Resolving an already-resolved unit with a different outcome first undoes the previous resolution.

Required scope: repairs:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Fields:

  • outcome (string, required) — repaired, parts_sent, replaced, refurbished_to_stock, unrepairable_credited, unrepairable_returned, no_fault_found, declined_by_customer, not_covered_returned, scrapped.
  • notes (string, optional, max 2000) — recorded on the resolution and in the activity log; used as the reason in the unrepairable email.
  • bill_to (string, optional) — warranty, goodwill, customer or supplier. Defaults to the bill-to already on the unit, else the coverage's default.
  • warehouse_id (integer, optional) — warehouse that ships a replacement or parts order. Defaults to the repair's warehouse.
  • performed_service (string, optional) — repair, replate, replace, parts, credit, none. Derived from the outcome when omitted.

By outcome:

  • repaired (customer-owned unit) — sends the unit back. create_outbound_shipment (boolean, optional) opens a draft us-to-customer shipment for the unit when it is on hand.
  • repaired (our own unit) / refurbished_to_stock — the unit goes into stock of a target SKU at its refurbished cost. The unit must be received. target_kind (same, blemished, designated), target_product_id (integer, the SKU to stock it as), blemished_sku (string, max 255; defaults to the unit's SKU + -B, created when missing). When the per-unit cost is above the target SKU's average selling price the request is refused with an nrv error unless expense_nrv_excess (boolean, expense the excess) or accept_above_nrv (boolean, keep the higher cost) is true. Use Preview Refurbish Cost first.
  • parts_sent — creates a parts sales order. parts (array, required for this outcome): parts[].product_id (integer, required), parts[].quantity (number > 0, required), parts[].unit_price (number ≥ 0, optional; charged only when bill-to is customer).
  • replaced — creates a replacement sales order. replacement_product_id (integer, defaults to the unit's product), replacement_quantity (integer 1–100000, defaults to the unit quantity). When a customer-owned unit is already on hand, ownership_disposition is required: add_to_stock, blemished, keep_in_repair or discard (with blemished_sku for blemished).
  • unrepairable_credited — credit_type (required): refund (a sales credit against the original order; needs one), store_credit or discount_offer. credit_amount (number > 0) is required for refund and store credit when no order price can default it; discount_percent (number, 0–100) is required for a discount offer, which creates a single-use discount code. The customer is emailed the unrepairable notice.
  • unrepairable_returned, no_fault_found, declined_by_customer, not_covered_returned — return the unit as-is. return_method (return or dispose); disposal_consent_note (string, max 1000) is required with dispose and records the customer's consent. charge_assessment_fee (boolean) adds the warranty policy's assessment fee as a customer cost. create_outbound_shipment opens a draft return shipment. unrepairable_returned also emails the customer.
  • scrapped — writes the unit off with an inventory adjustment (our own units only).

The response holds the resolution with the full unit (line) and every document it created.

Authentication: Bearer token with the repairs:write scope.

Request​

Responses​

OK

Response Headers
    Content-Type