Skip to main content
POST
Refund an invoice

Authorizations

Authorization
string
header
required

OAuth 2.1 authorization code + PKCE (S256). Tokens are tenant-bound (company_id) and scoped. Discover endpoints via /.well-known/oauth-authorization-server.

Headers

Idempotency-Key
string

Client-chosen key; replaying the same key + body returns the original response, a different body returns 409.

Path Parameters

id
string
required

The id.

Body

application/json

Refund (fully or partially) a paid invoice. Debits the company wallet and issues a live refund (money out).

amountCents
integer
required

Amount to refund, in cents. Must be positive and not exceed the invoice's remaining refundable amount.

reason
string
required

Reason for the refund (required).

Minimum string length: 1
note
string

Optional internal note for the refund.

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.

data
object
required

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.