getInvoiceFile
The method allows you to get the invoice file from BaseLinker.
Input parameters
Output data:
A sample request in PHP:
invoice_id | int | BaseLinker invoice identifier |
get_external | bool | false (by default) - download invoice file generated by BaseLinker true - download an invoice from an external accounting system (if provided there), or an invoice uploaded by API. If an additional invoice file does not exist, an invoice in BaseLinker format will be returned |
Output data
The method returns the data in JSON format.
status | varchar(30) | SUCCESS - request executed correctly ERROR - an error occurred during an API request. Error details will be described in 2 additional returned fields: error_message and error_code |
invoice | text | Invoice file in binary format encoded in base64, at the very beginning of the invoice string a prefix "data:" is provided e.g. "data:4AAQSkSzkJRgABA[...]" |
invoice_number | varchar(30) | BaseLinker invoice number (or external accounting system number if get_external is set to true) |
Sample
Input data:Output data:
A sample request in PHP: