Skip to content

Void an invoice

POST
/invoices/{id}/void

draft/open → voided (terminal): the invoice can never be paid. Idempotent — voiding a voided invoice is a 200 no-op. A paid invoice refuses with 409 (money already moved; that would be a refund). Void transition rules are flagged for review (see contract doc).

id
required
string

Invoice ID

The invoice, now voided

object
created
required
integer format: int64
currency
required

Currently supported currencies by Paygasus Pay

string
Allowed values: USD
Example
USD
customer
required
string
due_date
required

Unix epoch milliseconds.

integer format: int64
id
required
string
lines
required
Array<object>

One display line on the invoice. Amounts are minor units, like every amount on the wire (design.md §5).

object
amount
required

A monetary amount in the currency’s minor units (e.g. cents for USD).

integer format: int64
Example
1000
description
required
string
livemode
required
boolean
memo
string | null
number
required
string
object
required
string
paid_at

Unix epoch milliseconds; set once paid.

integer | null format: int64
payment_intent_id
One of:
null
payment_url

Set once sent: the stable invoice payment URL the customer pays at.

string | null
status
required
string
Allowed values: draft open paid voided
tax_amount
required

A monetary amount in the currency’s minor units (e.g. cents for USD).

integer format: int64
Example
1000
total
required

Server-computed: sum of line amounts + tax_amount.

integer format: int64
Example
1000

No such invoice

object
error
required
object
code
required
string
message
required
string
param
string | null
retryable

When present and true, the caller may retry the same request.

boolean | null
type
required
string

Invoice is paid and cannot be voided

object
error
required
object
code
required
string
message
required
string
param
string | null
retryable

When present and true, the caller may retry the same request.

boolean | null
type
required
string