Skip to content

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.

FieldTypeDescription
idID!Unique identifier of the invoice
invoiceNumberString!Invoice number as the issuing system assigned it
invoiceDateDate!Calendar date the invoice was issued
dueDateDateCalendar date payment is due. Null where the issuer set no term.
statusInvoiceStatusType!Where the invoice stands, derived from what has been collected
totalMoney!What the invoice bills in total
amountPaidMoney!What has been collected against it
amountDueMoney!What is still to be collected
referenceStringThe issuer's own reference, usually the buyer's, shown on the document
invoiceUrlURLLink to the invoice document, where the issuer publishes one
orderNumbers[String!]!Numbers of the orders this invoice bills
payableBoolean!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

FieldTypeDescription
items[Invoice!]!Invoices in the current page
paginationPagination!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

FieldTypeDescription
statusInvoiceStatusType!
countInt!

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.

OPENNothing collected, and the due date has not passed
OVERDUENothing collected, and the due date has passed
PAYMENT_UNDERWAYA payment has been started against it and has not finished
PARTLY_PAIDSome of it has been collected and a balance remains
PAIDCollected in full
CREDITEDCredited back, in whole or in part