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_idORcurrency_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:
- A PO-line-linked line:
purchase_order_line_id+quantity+ optionalunit_cost/amount/restock_inventory. - A description-only line (service/rebate):
description+quantity+amount(+ optionalnominal_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
- 200
Successful response