type charge or refund (amounts are magnitudes either way). order and customer by { id } or { externalId } in the channel; a line names the order line it bills (orderLineId, externalLineId, product) or is a custom line. Totals are recomputed: a mismatch is 422 totals_mismatch with the computed values; a charge invoice may not exceed its order. onDuplicate (default update): update applies the sent fields (outcome unchanged when nothing differs), skip answers the stored invoice, error is 409. A money change on an invoice that carries payments is 409 state_conflict. Unknown fields are refused (400).
Scope: invoices:write, channel:write or admin. A permission group made before the Channel API scopes existed grants it as invoices:manage.
Idempotency: send Idempotency-Key; a retry with the same key replays the first answer.
Rate limit: write class, 1,200 requests per minute per tenant by default (read class 6,000). Every response carries X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset; a refusal is 429 rate_limited with Retry-After.
