Document type
A file kept with a sales order (such as an invoice or a delivery note) or with an invoice imported from the accounting system (its PDF). A document has versions; the newest is the current one.
Fields
id
The document's MAX id.
kind
What the document is.
title
String
The document's title.
externalId
String
The issuing system's own id of the document.
externalNumber
String
The document's number in the issuing system.
createdAt
When the document was created.
updatedAt
When its last version was added.
versionCount
Int!
The number of versions. The current version has the highest number.
file
The current version's file.
downloadUrl
String
Where to download the current version. The address stays the same across versions.
- The download still requires your API key, with the read permission of the document's
target:
order.readfor a sales order's document,invoice.readfor an invoice's. - Null when MAX has no public address configured.
versions
Arguments:
first:Intafter:Stringlast:Intbefore:String
The document's versions, newest first.
- A connection, paged with
first/afterorlast/before, at most 250 a page. Its cursors belong to this document's versions; any other connection refuses them. - Null, with an error at its path, when its page cannot be read, for example because of a cursor of another parent. The rest of the response is returned.
- A page costs 2 + first (or last) × the cost of one node.
salesOrder
The sales order the document is kept with. Null for an invoice's document (see invoice), and
when your API key can no longer see the order. No error comes with the null.
invoice
The invoice the document is kept with (attachInvoiceDocument). Null for a sales
order's document (see salesOrder), without the invoice.read permission, and when your API
key can no longer see the invoice. No error comes with the null.