Skip to main content

Downloading Invoice PDF


An existing invoice can be downloaded as a PDF document. The implementation is illustrated in the following example file: ./examples/document/invoice/get_invoice_pdf.php


Downloading the Invoice PDF can be done based on either the invoice number or the order number. When downloading based on the order number, the last document with this order number is returned.

// Download based on invoice number:

// Download based on order number:
$agent->getInvoicePdf('TESZT-001', Invoice::FROM_ORDER_NUMBER);

// Download based on external invoice ID:
$agent->getInvoicePdf('TESZT-001', Invoice::FROM_INVOICE_EXTERNAL_ID);

// The response is a PDF type invoice, which can be downloaded as follows:

The filename is not mandatory. If not provided, the invoice number will be used as the PDF file name.

Expected and Optional Inputs

Invoice Data

Invoice numberinvoiceNumberstringyes
Order numberorderNumberstring
PDF downloaddownloadPdfbooleanfalse