GraphQL: Invoices
Read invoices with their line items, totals, payments, customer, job and estimate, and create, update or delete invoices.
| Operation | Type | Description |
|---|---|---|
invoice(id) | Query | Get one invoice |
invoices(first, after, filter, sort) | Query | List invoices |
createInvoice(input) | Mutation | Create an invoice |
updateInvoice(id, input) | Mutation | Update an invoice |
deleteInvoice(id) | Mutation | Delete an invoice |
InvoiceStatus: DRAFT, AWAIT_PAYMENT, PARTIALLY_PAID, PAID, BAD_DEBT, ARCHIVED, CLOSED, CANCELED, READY_TO_INVOICE
Invoice fields
Details
| Field | Type | Description |
|---|---|---|
id | ID! | Invoice UID |
invoice_no | Int | Invoice number |
invoice_no_string | String | Invoice number, as text |
reference_no | String | |
invoice_title | String | |
invoice_status | InvoiceStatus | |
invoice_description | String | |
invoice_date | DateTime | |
due_date | DateTime | |
custom_fields | [CustomField!]! | |
external_ids | [ExternalId!]! | { key value } |
Amounts
Zuper calculates all amounts from the line items, discounts and taxes.
| Field | Type | Description |
|---|---|---|
line_items | [LineItem!]! | |
sub_total | Float | |
total_discount | Float | |
taxable_amount | Float | |
tax | [TaxLine!]! | Taxes on the whole invoice |
total | Float | |
net_total | Float |
Payments
| Field | Type | Description |
|---|---|---|
is_paid | Boolean | |
amount_paid | Float | |
amount_due | Float | |
paid_date | DateTime | |
payments | [InvoicePayment!]! | { payment_history_uid amount payment_date reference_no payment_via is_void }. payment_via is PAYMENT_METHOD, CREDIT or CHECK |
Related records and audit
| Field | Type | Description |
|---|---|---|
customer | Customer | |
organization | Organization | |
property | Property | |
job | Job | |
estimate | Estimate | The estimate this invoice was created from |
created_by | User | |
created_at | DateTime | |
updated_at | DateTime |
Get an invoice
invoice(id: ID!) returns one invoice, or null if the UID doesn't exist in your account.
query InvoiceDetails($id: ID!) {
invoice(id: $id) {
id
invoice_no_string
reference_no
invoice_title
invoice_status
invoice_date
due_date
paid_date
line_items { name description quantity unit_price discount discount_type total tax { tax_name tax_amount } }
sub_total
total_discount
taxable_amount
tax { tax_name tax_percent tax_amount }
total
net_total
amount_paid
amount_due
is_paid
payments { payment_history_uid amount payment_date reference_no payment_via is_void }
customer { id customer_full_name customer_email customer_billing_address { street city zip_code } }
property { property_name }
job { work_order_number job_title }
estimate { estimate_no_string }
custom_fields { label value }
created_at
}
}{ "id": "<invoice_uid>" }List invoices
invoices(first, after, filter, sort) returns a paginated list.
InvoiceFilter
| Field | Type | Matches |
|---|---|---|
status_in | [InvoiceStatus!] | Invoices in any of these statuses |
customer_uid | ID | Linked customer |
organization_uid | ID | Linked organization |
property_uid | ID | Linked property |
job_uid | ID | Linked job |
estimate_uid | ID | Linked estimate |
is_paid | Boolean | Paid or unpaid invoices |
invoice_date_from / invoice_date_to | DateTime | Range on invoice_date |
due_date_from / due_date_to | DateTime | Range on due_date |
created_after / created_before | DateTime | Range on created_at |
updated_after | DateTime | Invoices changed at or after this time |
custom_field | [CustomFieldFilter!] | { label, value } exact matches |
InvoiceSortField: CREATED_AT, UPDATED_AT, INVOICE_DATE, DUE_DATE, INVOICE_NO
Example: overdue invoices, oldest due date first
query OverdueInvoices($today: DateTime!, $after: String) {
invoices(
first: 100
after: $after
filter: { status_in: [AWAIT_PAYMENT, PARTIALLY_PAID], is_paid: false, due_date_to: $today }
sort: { field: DUE_DATE, direction: ASC }
) {
nodes {
id
invoice_no_string
due_date
total
amount_paid
amount_due
customer { customer_full_name customer_email }
job { work_order_number }
}
page_info { has_next_page end_cursor }
}
}{ "today": "2026-11-17T23:59:59Z", "after": null }Example: invoices raised in a month, by invoice number
query MonthlyInvoices($from: DateTime!, $to: DateTime!, $after: String) {
invoices(
first: 100
after: $after
filter: { invoice_date_from: $from, invoice_date_to: $to }
sort: { field: INVOICE_NO, direction: ASC }
) {
nodes { id invoice_no invoice_no_string invoice_date invoice_status net_total }
page_info { has_next_page end_cursor }
}
}{ "from": "2026-10-01T00:00:00Z", "to": "2026-10-31T23:59:59Z", "after": null }Example: a customer's invoices for an estimate, due in a date range
query InvoicesForRecord($customer: ID, $estimate: ID, $dueFrom: DateTime, $dueTo: DateTime) {
invoices(
first: 25
filter: { customer_uid: $customer, estimate_uid: $estimate, due_date_from: $dueFrom, due_date_to: $dueTo }
sort: { field: INVOICE_DATE, direction: DESC }
) {
nodes { id invoice_no_string invoice_status due_date amount_due estimate { estimate_no_string } }
page_info { has_next_page end_cursor }
}
}{
"customer": "<customer_uid>",
"estimate": "<estimate_uid>",
"dueFrom": "2026-11-01T00:00:00Z",
"dueTo": "2026-12-31T23:59:59Z"
}Example: invoices changed since a date, with a custom field value
query InvoiceSync($since: DateTime!, $cf: [CustomFieldFilter!], $after: String) {
invoices(
first: 100
after: $after
filter: { updated_after: $since, custom_field: $cf }
sort: { field: UPDATED_AT, direction: ASC }
) {
nodes { id invoice_no_string invoice_status is_paid amount_due updated_at }
page_info { has_next_page end_cursor }
}
}{ "since": "2026-11-01T00:00:00Z", "cf": [{ "label": "Source", "value": "API" }], "after": null }Create an invoice
createInvoice(input: InvoiceCreateInput!)
InvoiceCreateInput
| Field | Type | Required | Description |
|---|---|---|---|
customer_uid | ID | Yes | |
invoice_date | DateTime | Yes | Send at noon UTC, for example 2026-11-17T12:00:00Z |
due_date | DateTime | Yes | Send at noon UTC |
line_items | [LineItemInput!] | Yes | Same format as for estimates |
organization_uid | ID | No | |
property_uid | ID | No | |
job_uid | ID | No | |
estimate_uid | ID | No | The estimate to invoice. See below |
invoice_title | String | No | Defaults to the customer's or organization's name |
reference_no | String | No | |
invoice_description | String | No | |
custom_fields | [CustomFieldInput!] | No | { label value } |
Linking an estimate:
- If you send
estimate_uid, that estimate is marked as converted. - If you send
job_uidwithoutestimate_uid, and the job has exactly oneAPPROVEDestimate, that estimate is linked automatically.
Note: Always send
unit_priceon each line item, including for catalog products. A missingunit_priceis saved as 0.
mutation CreateInvoice($input: InvoiceCreateInput!) {
createInvoice(input: $input) {
invoice {
id
invoice_no_string
invoice_status
invoice_title
sub_total
total_discount
tax { tax_name tax_amount }
total
amount_due
estimate { estimate_no_string is_converted }
}
user_errors { field message code }
}
}{
"input": {
"customer_uid": "<customer_uid>",
"job_uid": "<job_uid>",
"estimate_uid": "<estimate_uid>",
"property_uid": "<property_uid>",
"invoice_title": "AC maintenance - November",
"reference_no": "PO-88213",
"invoice_description": "Quarterly maintenance visit",
"invoice_date": "2026-11-17T12:00:00Z",
"due_date": "2026-12-02T12:00:00Z",
"line_items": [
{ "product_uid": "<product_uid>", "quantity": 2, "unit_price": 150 },
{ "name": "Labor", "quantity": 3, "unit_price": 95, "discount": 10, "discount_type": "PERCENTAGE" }
],
"custom_fields": [{ "label": "Source", "value": "API" }]
}
}Possible user_errors messages include Mandatory details are Missing (HTTP_400) and Invalid Quote UID (HTTP_404, when estimate_uid doesn't exist).
Update an invoice
updateInvoice(id: ID!, input: InvoiceUpdateInput!) changes only the fields you send.
InvoiceUpdateInput: invoice_title, reference_no, invoice_description, invoice_date, due_date, line_items, custom_fields
line_itemsreplaces all existing line items. Send the complete list.line_itemsis ignored when the invoice isBAD_DEBT,ARCHIVED,CLOSEDorCANCELED.- Secondary customers on the invoice are kept.
mutation UpdateInvoice($id: ID!, $input: InvoiceUpdateInput!) {
updateInvoice(id: $id, input: $input) {
invoice { id invoice_title due_date reference_no total amount_due }
user_errors { field message code }
}
}{
"id": "<invoice_uid>",
"input": {
"invoice_title": "AC maintenance - November (revised)",
"due_date": "2026-12-05T12:00:00Z",
"reference_no": "PO-88213-A",
"line_items": [{ "name": "Labor", "quantity": 3, "unit_price": 100 }]
}
}Delete an invoice
deleteInvoice(id: ID!)
You can't delete an invoice that has active payments (Please ensure that there is no active payments left.).
mutation DeleteInvoice($id: ID!) {
deleteInvoice(id: $id) {
deleted_id
user_errors { field message code }
}
}{ "id": "<invoice_uid>" }Updated about 21 hours ago
