Invoice types
The types the invoice domain defines, with the fields other domains add to them.
Objects
Invoice
An amount a company owes, issued as a document and settled separately from the orders it bills. One invoice may cover several orders, and an order paid on account is billed by one later.
| Field | Type | Description |
|---|---|---|
id | ID! | Unique identifier of the invoice |
invoiceNumber | String! | Invoice number as the issuing system assigned it |
invoiceDate | Date! | Calendar date the invoice was issued |
dueDate | Date | Calendar date payment is due. Null where the issuer set no term. |
status | InvoiceStatusType! | Where the invoice stands, derived from what has been collected |
total | Money! | What the invoice bills in total |
amountPaid | Money! | What has been collected against it |
amountDue | Money! | What is still to be collected |
reference | String | The issuer's own reference, usually the buyer's, shown on the document |
invoiceUrl | URL | Link to the invoice document, where the issuer publishes one |
orderNumbers | [String!]! | Numbers of the orders this invoice bills |
payable | Boolean! | Whether a payment may be started against this invoice right now. False once nothing is outstanding, and false while a payment is already underway. A client cannot derive the second: an invoice with a pending charge still shows a balance, and offering to pay it again is how the same amount gets collected twice. |
availablePaymentMethods | [PaymentMethod!]! | How this invoice may be paid.
Not the same list a cart gets: paying on account is left out, because the
invoice exists in the first place because credit was granted, and settling
it on account would grant the same credit again.Arguments: device |
InvoiceResult
Paginated result containing invoices
| Field | Type | Description |
|---|---|---|
items | [Invoice!]! | Invoices in the current page |
pagination | Pagination! | Where this page sits within the full result set |
statusCounts | [InvoiceStatusCount!] | How many invoices each status holds under this list's search term and date range, whatever its status filter, so every status tab can show a count. Asked of the engine once per status, so query it where the tabs are shown. Null when the engine cannot count per status. |
InvoiceStatusCount
The number of invoices in one status
| Field | Type | Description |
|---|---|---|
status | InvoiceStatusType! | |
count | Int! |
Enums
InvoiceStatusType
Where an invoice stands, derived on read from what has been collected against it. Nothing stores this: a status field and a ledger of transactions can disagree, and only one of them is what the money did.
OPEN | Nothing collected, and the due date has not passed |
OVERDUE | Nothing collected, and the due date has passed |
PAYMENT_UNDERWAY | A payment has been started against it and has not finished |
PARTLY_PAID | Some of it has been collected and a balance remains |
PAID | Collected in full |
CREDITED | Credited back, in whole or in part |

