Skip to main content

Create Vendor Return

POST 

/api/vendor-returns

Create a draft vendor return for goods that will be physically sent back to a supplier.

Authentication: Requires Bearer token.

Body fields:

  • supplier_id (integer, required): supplier the goods return to
  • warehouse_id (integer, required): warehouse the goods ship out of
  • return_date (date, required, YYYY-MM-DD)
  • supplier_rma_number (string, optional, max 255): the supplier's RMA reference
  • reason (string, optional, max 255)
  • notes (string, optional)
  • currency_id (integer, optional): defaults to the account's base currency
  • lines (array, optional) - each line:
    • purchase_order_line_id (integer, required unless product_id is given): the received purchase order line being returned
    • product_id (integer, required unless purchase_order_line_id is given; derived from the purchase order line when omitted)
    • quantity (number, required, greater than 0)
    • unit_cost (number, optional; when omitted it is filled from the cost basis of the purchase order line)
    • reason (string, optional, max 255)
    • is_write_off (boolean, optional, default false): write-off lines are expensed to cost of goods sold at ship instead of the clearing/accounts-payable split

Validation invariants:

  • Single purchase order: every line that references a purchase order line must belong to the SAME purchase order. Mixing lines from different purchase orders is rejected.
  • Returnable quantity: per purchase order line, the return quantity cannot exceed received quantity minus what was already returned (across other non-void returns and historical credits). Check availability first with List Returnable Lines For Purchase Order.

Request

Responses

OK

Response Headers
    Content-Type