Skip to main content

Create Vendor Credit

POST 

/api/vendor-credits

Create a new vendor credit.

Required fields:

  • supplier_id (int) — Supplier the credit is from.

Optional top-level fields:

  • purchase_order_id, purchase_invoice_id — Links to the source PO / bill.
  • warehouse_id, store_id — For restock-type credits.
  • credit_type — One of: restock, unstock, service, overpayment, rebate.
  • refund_method — One of: applied_to_bill, cash_refund, retained_credit.
  • currency_id OR currency_code — ISO code like USD.
  • tax_rate_id — Default tax rate for lines.
  • credit_date — ISO date (defaults to today).
  • supplier_reference — External RMA / credit reference from supplier.
  • vendor_credit_number — Auto-generated if omitted.
  • is_tax_included, is_for_overpayment — Booleans.
  • vendor_credit_note — Free-text note.
  • tax_lines, metadata — Optional arrays.

Lines (array, required for most credit types): Each line is either:

  1. A PO-line-linked line: purchase_order_line_id + quantity + optional unit_cost/amount/restock_inventory.
  2. A description-only line (service/rebate): description + quantity + amount (+ optional nominal_code_id).

Validation enforces that the requested quantity on any PO-line-linked line does not exceed (received_quantity - already_credited_quantity) for that PO line.

Request

Responses

Successful response