Chameleoon MAX · Types
EmailAttachmentInput input
One attachment of a send. Pass exactly one of orderInvoice, invoicePdf, document or file.
Input fields
orderInvoice
The MAX id of a sales order whose invoice to attach.
- MAX attaches the order's governing invoice, as
invoicePdfgives it. The governing invoice is the order's newest linked invoice of kindINVOICEthat is issued, created, not cancelled and numbered. - When your API key may not see that invoice, the call fails with
FORBIDDEN_ROLEand reasonDOCUMENT_READ_REQUIRED. The order's own file is never sent instead. - With no governing invoice, MAX attaches the order's current
INVOICEdocument, else the call fails withINVOICE_NOT_READY. - Advance invoices and credit notes are never picked.
- Requires the
invoice.readpermission, and alsoprice.readwhen MAX renders the PDF itself.
invoicePdf
The MAX id of an invoice to attach as a PDF. The invoice can be of any kind, but must be issued,
created and not cancelled (otherwise INVOICE_NOT_PRINTABLE). MAX takes the first PDF there is:
- The accounting system's PDF attached to the invoice (
attachInvoiceDocument). - A linked order's document of the invoice's kind (
INVOICE,CREDIT_NOTEorPROFORMA_INVOICE) under the invoice's number. - MAX's own render from its print template, where the invoice's external source allows it
(
ExternalSource.invoicePrintAllowed).
With none of them, the call fails with INVOICE_PDF_MISSING. Requires the invoice.read
permission, and also price.read when MAX renders the PDF itself.
document
The MAX id of a document of an order or an invoice. Its current version is attached.
file
The id of a file you uploaded through POST /api/v1/files.
filename
String
A new file name for the attachment.