Skip to main content

Querying Invoice Data

Basics

The data of an existing invoice can be queried. This is demonstrated in the following example file: ./examples/document/invoice/get_invoice_data.php

tip

Invoice data can be queried based on the invoice number or order number. When querying based on the order number, the last document with this order number is returned. If desired, the invoice PDF can be downloaded as well by specifying an additional parameter.

// Download based on invoice number:
$agent->getInvoiceData('TESZT-001');

// Download based on order number (including invoice PDF):
$agent->getInvoiceData('TESZT-001', Invoice::FROM_ORDER_NUMBER, true);

// Retrieve all invoice data as follows:
$result->getData();

Expected and Optional Inputs

Invoice Data

DescriptionFieldTypeRequiredDefault
Invoice numberinvoiceNumberstringyes
Order numberorderNumberstring
PDF downloaddownloadPdfbooleanfalse