An invoice document can be the invoice or a creaditnote.
Preface
When creating an invoice, the API facilitates two types of invoice-models. A regular invoice, with invoice data and multiple invoice lines data. A creditnote, that also has the same depth of invoice lines that can be refunded. The endpoint is available from an HTTP_POST at POST V2Invoices
Ground rules for creating an invoice
There are a couple of rules, that needs attention before we go into the further details.
- The given amount should always be positive, both on the invoice and in the invoice lines.
- An invoice has the InvoiceTypeCodeset to PIE
- A creditnote has the InvoiceTypeCode set to PCM
- Card payments can be done instantly, both payments and creditnotes.
PdfInvoice(optional) can hold your own PDF invoice layout and details. When absent, FarPay standard PDF invoice will be shown.PdfAttachments(optional), append PDF documents to the PdfInvoice, in order of appearence in the attachment list.- An existing customer will only be referenced with
CustomerNumber - New customer can be created when not identified by the
CustomerNumber- But it is recommended that the Customers POST endpoint is used to create new customers.