Update Invoice
PUT/api/supplier-portal/invoices/:invoice
Edit and resubmit an invoice you submitted here while it is submitted, under review or rejected (unpaid). Replaces its lines, number, date and stated total, clears the rejection and puts it back in the buyer's review. Caps are re-checked against the order's current received/shipped state, excluding this invoice. A new attachment is added. With a file, send POST multipart with _method=PUT.
Called by a B2B portal buyer with the bearer token POST /api/portal/auth/login returns (or the buyer's feed key) — not with a staff Personal Access Token.
Fields: mode (required: flip = invoice from the PO lines, upload = your PDF only, no lines), supplier_invoice_number (required, max 100, unique across all of the buyer's invoices for your supplier, case-insensitive), invoice_date (required, YYYY-MM-DD, not more than 1 day in the future), note (optional, max 2000; added as a note on the buyer's invoice), attachment (file: pdf, png, jpg, jpeg, max 10 MB; required for upload on create), stated_total (upload only, required, number >= 0.01 — the total on your PDF), lines (flip only, optional; omitted = every invoiceable line at its full invoiceable quantity and PO unit cost): lines[].purchase_order_line_id (required), lines[].quantity (required, >= 0; 0 = not on this invoice; repeated lines are summed), lines[].unit_cost (optional, >= 0; default the PO unit cost).
Caps: each line's quantity must not exceed what was received (warehouse orders) or shipped (dropship orders) and is not yet invoiced on any invoice; checked under a lock against the order's current state. Review flags (never blocking; returned as warnings and shown as under_review): price_variance when a unit cost differs from the PO cost; qty_variance when a line bills fewer units than were received/shipped and not yet invoiced at submit. Billing exactly the invoiceable quantity at PO cost is clean (submitted).
Errors: 409 invoice_not_editable (reason not_portal_invoice | approved | paid), 422, 404. Rate limited: 20 per minute.
Request
Responses
- 200
- 401
- 403
- 404
- 409
- 422
- 429
OK
Response Headers
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
Response Headers
Conflict
Response Headers
Unprocessable Entity
Response Headers
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.