Update Vendor Credit
PUT/api/vendor-credits/:vendor_credit
Update an existing vendor credit. Accepts the same fields as Create.
This endpoint currently requires session authentication; Personal Access Token scope support is in progress.
Currency rules:
currency_id(orcurrency_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_idvalidation 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 avendor_credit_numbervalidation 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 BOTHsupplier_referenceandvendor_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 (usepurchase_order_idfor 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
- 200
- 401
- 403
- 404
- 422
- 429
Successful response
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Validation failed — the body is a field → messages map (Laravel shape) or the platform envelope with a stable machine-readable code. Fix the payload and resubmit.
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.