Skip to main content

Create Return Shipment

POST 

/api/vendor-credits/:vendor_credit/shipments

Create a return (RTV) shipment against an authorized vendor credit. For each restock product line, posts the outbound inventory movement (negative adjustment) and transitions the matching planned allocation to fulfilled.

Authentication: Requires Bearer token (PAT).

Body fields:

  • warehouse_id (required, integer) — warehouse the goods ship out of.
  • shipment_date (required, date).
  • status (optional, one of: pending, shipped, delivered, cancelled — defaults to shipped).
  • tracking_number (optional, string, max 191).
  • shipping_method_id (optional, integer — exists in shipping_methods).
  • custom_carrier (optional, string, max 191).
  • expected_arrival_date (optional, date).
  • vendor_rma_number (optional, string, max 191).
  • notes (optional, string).
  • lines (required, array, min 1) — each line:
    • vendor_credit_line_id (required, integer — exists in vendor_credit_lines).
    • quantity (required, integer, min 1).
    • warehouse_location_id (optional, integer — exists in warehouse_locations).
    • notes (optional, string).
    • lot_allocation (optional, array) — FEFO override for lot-tracked products. When supplied, the named FIFO layers are consumed instead of automatic FEFO. Each entry: { fifo_layer_id (required, exists in fifo_layers), quantity (required, > 0) }. The allocation must sum to the line quantity, every layer must be an active layer of the line's product + the shipment warehouse with enough available quantity, and the tenant's lot override policy is enforced (under enforce, consuming expired stock or skipping the earliest-expiry FEFO lot is rejected with 422). Omit to consume by automatic FEFO/FIFO.
Required scope: accounting:write

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

Request

Responses

OK

Response Headers
    Content-Type