Refund an invoice
refund a paid invoice for the token tenant. Requires the invoices:write scope.
Authorizations
OAuth 2.1 authorization code + PKCE (S256). Tokens are tenant-bound (company_id) and scoped. Discover endpoints via /.well-known/oauth-authorization-server.
Headers
Client-chosen key; replaying the same key + body returns the original response, a different body returns 409.
Path Parameters
The id.
Body
Refund (fully or partially) a paid invoice. Debits the company wallet and issues a live refund (money out).
Response
Refund result. Carries message + newWalletBalance on success, or a warning if the wallet was debited but the refund call failed.
Envelope wrapping the invoice refund result.
Result of an invoice refund. On the success path it carries message + newWalletBalance; if the wallet was debited but the live refund call failed it carries a warning instead (still HTTP 200). The use-case success flag is stripped. Surface any warning to the user rather than reporting unconditional success.