# Invoice type


An invoice, advance invoice or credit note imported from an accounting system. MAX never issues
invoices: it mirrors them, and your integration keeps the copy current with
[`syncInvoice`](/chameleoon-max/mutation/sync-invoice).

- Requires the `invoice.read` permission.
- A credit note's amounts are negative: its lines, VAT summary, totals and payment amounts.
- Dates are calendar days, returned as midnight UTC.

## Fields

### id

[`UUID!`](/chameleoon-max/type/uuid)

The invoice's MAX id.

### direction

[`InvoiceDirection!`](/chameleoon-max/type/invoice-direction)

Whether your organisation issued the invoice or received it.

### kind

[`InvoiceKind!`](/chameleoon-max/type/invoice-kind)

What kind of document it is.

### status

[`InvoiceStatus!`](/chameleoon-max/type/invoice-status)

Where the document stands in the accounting system.

### failureReason

`String`

Why the document failed. Null unless `status` is `FAILED`, which MAX does not return yet.

### source

`String!`

The code of the accounting system's external source.

### sourceDocumentType

`String`

The accounting system's own name for the type of document.

### sourceChangedAt

[`Time`](/chameleoon-max/type/time)

When the document last changed in the accounting system, as your integration sent it.

### syncedAt

[`Time`](/chameleoon-max/type/time)

When MAX last wrote a sync or a removal of the document.

### cancelled

`Boolean!`

Whether the document is cancelled in the accounting system.

### number

`String`

The document's number. Every synced document has one. Null only in a status MAX does not
return yet (`PENDING`, `FAILED`).

### variableSymbol

`String`

The variable symbol (the payment reference).

### constantSymbol

`String`

The constant symbol.

### specificSymbol

`String`

The specific symbol.

### supplierNumber

`String`

On a received invoice, the supplier's own number of the document.

### orderNumber

`String`

The number of the order the invoice names.

### issueDate

[`Time`](/chameleoon-max/type/time)

The issue date. Null when the accounting system does not state it.

### taxPointDate

[`Time`](/chameleoon-max/type/time)

The tax point date.

### dueDate

[`Time`](/chameleoon-max/type/time)

The due date.

### receivedDate

[`Time`](/chameleoon-max/type/time)

On a received invoice, the date it was received.

### vatClaimDate

[`Time`](/chameleoon-max/type/time)

The date the VAT is claimed.

### legalEntityId

[`UUID!`](/chameleoon-max/type/uuid)

The MAX id of the company (legal entity) the invoice belongs to.

### legalEntityMatch

[`InvoiceLegalEntityMatch!`](/chameleoon-max/type/invoice-legal-entity-match)

How MAX found the company.

### partnerId

[`UUID`](/chameleoon-max/type/uuid)

The partner's MAX id. Your integration named the partner, or MAX found it by the company
registration number (IČO) or e-mail, or created it from the invoice's party.

### partnerMatch

[`InvoicePartnerMatch`](/chameleoon-max/type/invoice-partner-match)

How MAX found the partner. Null when there is none.

### partnerEditable

`Boolean!`

Whether a user (or [`setInvoicePartner`](/chameleoon-max/mutation/set-invoice-partner)) may set or change the partner. `true` when
MAX found no partner, or a user chose it.

### seller

[`InvoiceParty!`](/chameleoon-max/type/invoice-party)

The seller as printed.

### buyer

[`InvoiceParty!`](/chameleoon-max/type/invoice-party)

The buyer as printed.

### delivery

[`InvoiceParty!`](/chameleoon-max/type/invoice-party)

The delivery address as printed.

### paymentMethod

[`InvoicePaymentMethod`](/chameleoon-max/type/invoice-payment-method)

How the invoice is to be paid.

### paymentMethodName

`String`

The accounting system's own label for the payment method.

### bankAccountNumber

`String`

The bank account number for the payment.

### bankCode

`String`

The bank code.

### bankName

`String`

The bank's name.

### iban

`String`

The IBAN for the payment.

### swift

`String`

The SWIFT (BIC) code.

### currencyCode

`String!`

The ISO 4217 code of the document's currency.

### exchangeRate

[`Decimal`](/chameleoon-max/type/decimal)

The exchange rate to the home currency.

### exchangeRateAmount

`Int`

The number of units of the document's currency that `exchangeRate` is quoted for.

### homeCurrencyCode

`String!`

The ISO 4217 code of the home currency.

### textBeforeItems

`String`

The text printed before the lines.

### textAfterItems

`String`

The text printed after the lines.

### printedNote

`String`

The note printed on the document.

### vatNote

`String`

The statutory VAT wording the accounting system printed, for example "Dodanie je oslobodené od
dane podľa § 43 zákona o DPH".

### reverseCharge

`Boolean!`

Whether the reverse charge applies.

### oss

`Boolean!`

Whether the invoice falls under the One-Stop Shop (OSS) scheme.

### totalNet

[`Decimal!`](/chameleoon-max/type/decimal)

The total without VAT.

### totalVat

[`Decimal!`](/chameleoon-max/type/decimal)

The VAT total.

### totalGross

[`Decimal!`](/chameleoon-max/type/decimal)

The total including VAT.

### rounding

[`Decimal!`](/chameleoon-max/type/decimal)

The rounding.

### advancesDeducted

[`Decimal!`](/chameleoon-max/type/decimal)

The advances deducted.

### amountDue

[`Decimal!`](/chameleoon-max/type/decimal)

The amount due.

### totalNetHome

[`Decimal`](/chameleoon-max/type/decimal)

The total without VAT, in the home currency.

### totalVatHome

[`Decimal`](/chameleoon-max/type/decimal)

The VAT total, in the home currency.

### totalGrossHome

[`Decimal`](/chameleoon-max/type/decimal)

The total including VAT, in the home currency.

### paymentStatus

[`InvoicePaymentStatus!`](/chameleoon-max/type/invoice-payment-status)

How much of the invoice is paid, as the accounting system states it.

### paidAmount

[`Decimal`](/chameleoon-max/type/decimal)

The amount paid. Null when the accounting system does not state it.

### remainingAmount

[`Decimal`](/chameleoon-max/type/decimal)

The amount still to be paid. Null when the accounting system does not state it.

### paidAt

[`Time`](/chameleoon-max/type/time)

The day the invoice was paid. Null when the accounting system does not state it.

### correctsInvoiceId

[`UUID`](/chameleoon-max/type/uuid)

On a credit note, the MAX id of the invoice it corrects. Null when that invoice is not in MAX
or your API key cannot see it.

### correctedNumber

`String`

On a credit note, the number of the invoice it corrects.

### correctedIssueDate

[`Time`](/chameleoon-max/type/time)

On a credit note, the issue date of the invoice it corrects.

### correctedTaxPointDate

[`Time`](/chameleoon-max/type/time)

On a credit note, the tax point date of the invoice it corrects.

### correctionReason

`String`

On a credit note, why the invoice is corrected.

### internalNote

`String`

A note for colleagues in MAX. It is never printed, and a sync never changes it. Null in the
result of [`syncInvoice`](/chameleoon-max/mutation/sync-invoice) and [`removeInvoice`](/chameleoon-max/mutation/remove-invoice) when your API key lacks the
`invoice.read` permission. No error comes with the null.

### lines

[`InvoiceLineConnection`](/chameleoon-max/type/invoice-line-connection)

Arguments:

- `first`: `Int`
- `after`: `String`
- `last`: `Int`
- `before`: `String`

The lines, by `lineNo`.

- A connection, paged with `first`/`after` or `last`/`before`, at most 250 a page.
- 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.

### vatSummary

[`InvoiceVatRowConnection`](/chameleoon-max/type/invoice-vat-row-connection)

Arguments:

- `first`: `Int`
- `after`: `String`
- `last`: `Int`
- `before`: `String`

The VAT summary, the highest rate first.

- A connection, paged with `first`/`after` or `last`/`before`, at most 250 a page.
- 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.

### settlements

[`InvoiceSettlementConnection`](/chameleoon-max/type/invoice-settlement-connection)

Arguments:

- `first`: `Int`
- `after`: `String`
- `last`: `Int`
- `before`: `String`

What reduced the amount due: deducted advances and offset credit notes.

- A connection, paged with `first`/`after` or `last`/`before`, at most 250 a page.
- 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.

### links

[`InvoiceLinkConnection`](/chameleoon-max/type/invoice-link-connection)

Arguments:

- `first`: `Int`
- `after`: `String`
- `last`: `Int`
- `before`: `String`

The MAX documents the invoice is linked to.

- A connection, paged with `first`/`after` or `last`/`before`, at most 250 a page.
- 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.

### documents

[`DocumentConnection`](/chameleoon-max/type/document-connection)

Arguments:

- `first`: `Int`
- `after`: `String`
- `last`: `Int`
- `before`: `String`

The invoice's files, such as the accounting system's PDF ([`attachInvoiceDocument`](/chameleoon-max/mutation/attach-invoice-document)),
oldest first. Removed documents are left out.

- A connection, paged with `first`/`after` or `last`/`before`, at most 250 a page. Its
  cursors belong to this invoice's documents; any other connection refuses them.
- Requires the `invoice.read` permission.
- 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.

### createdAt

[`Time!`](/chameleoon-max/type/time)

When the invoice was created in MAX.

### updatedAt

[`Time!`](/chameleoon-max/type/time)

When the invoice last changed in MAX.

## Used by

- [`linkInvoice`](/chameleoon-max/mutation/link-invoice) (mutation)
- [`setInvoicePartner`](/chameleoon-max/mutation/set-invoice-partner) (mutation)
- [`unlinkInvoice`](/chameleoon-max/mutation/unlink-invoice) (mutation)
- [`updateInvoice`](/chameleoon-max/mutation/update-invoice) (mutation)
- [`invoice`](/chameleoon-max/query/invoice) (query)
- [`Document`](/chameleoon-max/type/document)
- [`InvoiceConnection`](/chameleoon-max/type/invoice-connection)
- [`InvoiceEdge`](/chameleoon-max/type/invoice-edge)
- [`InvoiceSyncResult`](/chameleoon-max/type/invoice-sync-result)
- [`InvoiceTagsResult`](/chameleoon-max/type/invoice-tags-result)
- [`SalesOrder`](/chameleoon-max/type/sales-order)
- [`SalesOrderInvoiceConnection`](/chameleoon-max/type/sales-order-invoice-connection)
