Organization API: Billing & Payouts: Invoices
The 3 Organization API operations for invoices.
Part of Billing & Payouts.
Operations
Section titled Operations| Method | Path | Summary |
|---|---|---|
| GET | /api/v1/orgs/{org_slug}/invoices |
The org's invoices, newest first, each naming its customer |
| GET | /api/v1/orgs/{org_slug}/invoices/{invoice_id} |
Get invoice |
| POST | /api/v1/orgs/{org_slug}/invoices/{invoice_id}/mark-paid |
Settle an invoice nobody paid through a gateway (a bank transfer, cash) |
The org's invoices, newest first, each naming its customer
Section titled The org's invoices, newest first, each naming its customerGET /api/v1/orgs/{org_slug}/invoices
The org's invoices, newest first, each naming its customer.
status_filter=open is unpaid or overdue. q, since and
until narrow the rows in the query, before the page is cut.
with_total=true answers {items, total, limit, offset, counts, outstanding} instead of a bare list: counts per status ignore the
status filter (they are the tab's pills) but follow the customer, the
search and the days, as total does; outstanding is what every open
invoice owes per currency under the customer filter alone, whatever the
search, days, status or page.
Parameters
Section titled Parameters| Name | In | Type | Required | Description |
|---|---|---|---|---|
org_slug |
path | string | yes | |
customer_id |
query | integer | no | |
status_filter |
query | string | no | |
q |
query | string or null | no | Invoice number, customer email, name or company, or an invoice or customer number. |
since |
query | string (date) or null | no | Raised on or after this day, in UTC (YYYY-MM-DD). |
until |
query | string (date) or null | no | Raised on or before this day, in UTC (YYYY-MM-DD). |
limit |
query | integer | no | Default: 50. |
offset |
query | integer | no | Default: 0. |
with_total |
query | boolean | no | Default: False. |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Get invoice
Section titled Get invoiceGET /api/v1/orgs/{org_slug}/invoices/{invoice_id}
One invoice with its lines and customer, and last_sent: when its
email was last sent again from the console, and to whom.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
invoice_id |
path | integer | yes |
org_slug |
path | string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Fields of a 200 response:
| Field | Type |
|---|---|
id |
integer |
org_id |
integer |
customer_id |
integer |
invoice_number |
string |
subtotal |
string |
tax |
string |
total |
string |
amount_paid |
string |
currency |
string |
status |
string |
due_date |
string (date-time) or null |
paid_at |
string (date-time) or null |
notes |
string or null |
created_at |
string (date-time) or null |
customer_name |
string or null |
customer_email |
string or null |
items |
array of OrgInvoiceItemResponse |
items[].id |
integer |
items[].invoice_id |
integer |
items[].org_service_id |
integer or null |
items[].description |
string |
items[].item_type |
string |
items[].quantity |
string |
items[].unit_price |
string |
items[].total |
string |
last_sent |
OrgInvoiceSent or null |
last_sent.at |
string (date-time) |
last_sent.to |
string or null |
last_sent.template |
string |
Settle an invoice nobody paid through a gateway (a bank transfer, cash)
Section titled Settle an invoice nobody paid through a gateway (a bank transfer, cash)POST /api/v1/orgs/{org_slug}/invoices/{invoice_id}/mark-paid
Settle an invoice nobody paid through a gateway (a bank transfer, cash).
Billing, admins and the owner, after a step-up (403 reauth_required
otherwise); audited; 429 past sixty an hour, shared with the staff
console's mark-paid. 409 with a sentence for a cancelled or refunded
invoice, which nothing settles; 400 for one already paid.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
invoice_id |
path | integer | yes |
org_slug |
path | string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |