Skip to main content

Update Vendor Credit

PUT 

/api/vendor-credits/:vendor_credit

Update an existing vendor credit. Accepts the same fields as Create.

Not yet available to API tokens

This endpoint currently requires session authentication; Personal Access Token scope support is in progress.

Currency rules:

  • currency_id (or currency_code) can be updated ONLY while the credit has no activity.
  • If the credit has any allocations (applied to bills) or payments, attempting to change the currency returns a 422 with a currency_id validation error.
  • If the credit is linked to a purchase order, the currency MUST match the PO's currency — any mismatch returns a 422.

Line replacement semantics: supplying lines replaces the existing line set (use with care). Closed or voided credits may be blocked from editing — check the manager.

Reference fields:

  • vendor_credit_number (string, max 255, unique) — The supplier's credit memo number as printed on their document (e.g. "Credit Memo 0001669"). This becomes the credit's number in SKU. Leave blank/omit to auto-generate a local number (VC-00001, VC-00002, …). Supplying a number already used by another credit returns a 422 with a vendor_credit_number validation error.
  • supplier_reference (string, max 255) — Any additional reference on the supplier's document, e.g. their internal order number ("Credit Order 0010764"). The credit-memo OCR pipeline's duplicate detection matches an extracted memo number against BOTH supplier_reference and vendor_credit_number.
  • supplier_po_number (string, max 255) — The PO number printed on the supplier's memo, recorded as text for reference only. It does NOT link to a purchase order in SKU (use purchase_order_id for an actual link).
  • purchase_order_id (int) — Link the credit to an actual PO in SKU (return/damage credits). When linked, the credit's currency must match the PO's currency.

This endpoint also accepts the PATCH method with identical behavior.

Request

Responses

Successful response