SyncInvoiceInput input
The whole document, as the accounting system holds it now.
Input fields
source
String! · required
The code of the accounting system's external source. The source must be of kind ERP.
externalId
String! · required
The accounting system's own id of the document. At most 200 characters on an issued
INVOICE.
sourceChangedAt
When the document last changed in the accounting system. A call older than the one MAX holds
writes nothing and returns STALE.
direction
InvoiceDirection! · required
Whether your organisation issued the invoice or received it. It cannot change later.
kind
InvoiceKind! · required
What kind of document it is. It cannot change later.
legalEntity
String
The company (legal entity) the invoice belongs to, by code. If omitted, MAX takes the company whose company registration number (IČO) is printed on your organisation's side of the invoice (the seller of an issued invoice, the buyer of a received one). If none matches, MAX takes the organisation's default company.
legalEntityId
The company (legal entity) the invoice belongs to, by MAX id (as in SalesOrder.legalEntityId).
Send it instead of legalEntity, never with it (VALIDATION on legalEntityId).
partner
The partner, when your integration knows it.
If you omit it, or send an externalId that no partner holds yet, MAX finds the partner from
the invoice's party: the buyer of an issued invoice, the seller of a received one.
- MAX looks the partner up by the party's company registration number (IČO), then by its e-mail. When several partners match, MAX takes the oldest and returns a warning.
- When none matches, MAX creates the partner from the party.
A partner already on the invoice stays.
sourceDocumentType
String
The accounting system's own name for the type of document.
cancelled
Boolean · default false
Whether the document is cancelled in the accounting system.
number
String! · required
The document's number. At most 100 characters on an issued INVOICE.
variableSymbol
String
The variable symbol (the payment reference).
constantSymbol
String
The constant symbol.
specificSymbol
String
The specific symbol.
supplierNumber
String
The supplier's own number of the document. Only on a received invoice.
orderNumber
String
The number of the order the invoice names.
On an issued invoice, when the number is new (the first call, or a changed number) and exactly
one sales order matches it (not counting drafts and merged orders), MAX links that order
(AUTO), with its shipped consignments and their stock issues. An order matches when its MAX
number equals orderNumber and it belongs to the invoice's company, or when its order number
or id in an external source equals orderNumber, in any company. Linking requires the
order.read permission for the order, fulfilment.read for the consignments, and
issue.read for their stock issues.
An order that is still a draft is linked once it is confirmed, if the invoice links no sales
order by then.
issueDate
The issue date.
taxPointDate
The tax point date.
dueDate
The due date.
receivedDate
The date the invoice was received. Only on a received invoice.
vatClaimDate
The date the VAT is claimed.
seller
The seller as printed.
buyer
The buyer as printed.
delivery
The delivery address as printed.
paymentMethod
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! · required
The ISO 4217 code of the document's currency.
exchangeRate
The exchange rate to the home currency. Must be positive.
exchangeRateAmount
Int
The number of units of the document's currency that exchangeRate is quoted for. Must be positive.
homeCurrencyCode
String
The ISO 4217 code of the home currency. If omitted, the document's 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 printed on the document, for example "Dodanie je oslobodené od dane podľa § 43 zákona o DPH". If omitted, it is cleared, like the other header texts.
reverseCharge
Boolean · default false
Whether the reverse charge applies.
oss
Boolean · default false
Whether the invoice falls under the One-Stop Shop (OSS) scheme.
totalNet
Decimal! · required
The total without VAT.
totalVat
Decimal! · required
The VAT total.
totalGross
Decimal! · required
The total including VAT.
rounding
The rounding.
advancesDeducted
The advances deducted.
amountDue
Decimal! · required
The amount due.
totalNetHome
The total without VAT, in the home currency.
totalVatHome
The VAT total, in the home currency.
totalGrossHome
The total including VAT, in the home currency.
paymentStatus
InvoicePaymentStatus · default UNKNOWN
How much of the invoice is paid, as the accounting system states it.
paidAmount
The amount paid. Null when the accounting system does not state it.
remainingAmount
The amount still to be paid. Null when the accounting system does not state it.
paidAt
When the invoice was paid.
correctsInvoice
On a credit note only, the invoice it corrects. If MAX does not know it, correctsInvoiceId
stays null and correctedNumber is kept.
correctedNumber
String
On a credit note only, the number of the invoice it corrects.
correctedIssueDate
On a credit note only, the issue date of the invoice it corrects.
correctedTaxPointDate
On a credit note only, the tax point date of the invoice it corrects.
correctionReason
String
On a credit note only, why the invoice is corrected.
lines
The lines. They replace every line MAX holds.
vatSummary
The VAT summary. It replaces the one MAX holds.
settlements
The settlements. They replace the ones MAX holds.
links
The MAX documents to link the invoice to. MAX adds them and never removes a link because you left it out.
Used by
syncInvoice(mutation)