Skip to content

Create an invoice

POST
/invoices

Creates a draft. The total is computed server-side from the line amounts plus tax_amount; the draft is not payable until it is sent.

object
currency
required

Currently supported currencies by Paygasus Pay

string
Allowed values: USD
Example
USD
customer
required

Customer display name.

string
due_date
required

Unix epoch milliseconds. Overdue is derived from this while the invoice is open — never stored as a status.

integer format: int64
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
memo
string | null
number
required

Human display label (e.g. INV-1044). Never used as an identifier or in a URL — the opaque id is the only reference.

string
tax_amount
required

Tax in minor units. The server computes total = lines + tax; a client-supplied total is not accepted anywhere on this API.

integer format: int64
Example
1000

Invoice created as a draft

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

Invalid request

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