getInvoices
The method allows you to download invoices issued from the BaseLinker order manager. The list of invoices can be limited using filters described in the method parameters. Maximum 100 invoices are returned at a time.
Input parameters
Output data:
A sample request in PHP:
invoice_id | int | (optional) Invoice identifier. Completing this field will result in downloading information about only one specific invoice. |
order_id | int | (optional) Order identifier. Completing this field will result in downloading information only about the invoice associated with this order (if the order has an invoice created). |
date_from | int | (optional) Date from which invoices are to be collected. Unix time stamp format. |
id_from | int | (optional) The invoice ID number from which subsequent invoices are to be retrieved. |
series_id | int | (optional) numbering series ID that allows filtering after the invoice numbering series. |
get_external_invoices | bool | If set to 'false' then omits from the results invoices that already have an external invoice file uploaded by addOrderInvoiceFile method (useful for ERP integrations uploading invoice files to BaseLinker) |
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 |
invoices | array | An array of the information about the invoices found. Each invoice is described by the fields listed below. |
invoice_id | int | Invoice identifier |
order_id | int | Order identifier for which an invoice is issued |
series_id | int | Invoice numbering series identifier |
type | varchar(10) | Type of invoice. Available values: normal - regular invoice correcting - corrective invoice |
number | varchar(30) | Full invoice number. Format depends on account settings. Usually [no]/[month]/[year] |
sub_id | int | Monthly/yearly number - invoice number element |
month | int | Month - element of invoice number (0 if annual numbering is used) |
year | int | Year - invoice number element |
postfix | varchar(1) | Suffix - invoice number element |
date_add | int | Invoice creation date (unix time format) |
date_sell | int | Sale date (unix time format) |
date_pay_to | int | Due date (unix time format). Not completed by default (value 0) |
currency | char(3) | 3-letter currency symbol (e.g. EUR, PLN) |
total_price_brutto | float | Total gross invoice value |
total_price_netto | float | Total net invoice value |
payment | varchar(100) | Payment method name |
additional_info | varchar(500) | Additional information/invoice remarks |
invoice_fullname | varchar(100) | Billing details - name and surname |
invoice_company | varchar(100) | Billing details - company |
invoice_nip | varchar(100) | Billing details - Vat Reg. no./tax number |
invoice_address | varchar(100) | Billing details - street and house number |
invoice_postcode | varchar(100) | Billing details - postcode |
invoice_city | varchar(100) | Billing details - city |
invoice_country | varchar(20) | Billing details - country |
invoice_country_code | char(2) | Billing details - country code (two-letter, e.g. EN) |
seller | varchar(250) | Seller data (all in one field) |
issuer | varchar(100) | Issuer data |
correcting_to_invoice_id | int | Only with a corrective invoice. The identifier of the corrected invoice. |
correcting_reason | varchar(100) | Only with a corrective invoice. Reason for correcting an invoice. |
correcting_items | bool | Only with a corrective invoice. Flag indicating whether the correction changes the invoice items. |
correcting_data | bool | Only with a corrective invoice. A flag indicating whether the correction changes the buyer data. |
external_invoice_number | varchar(30) | External system invoice number |
exchange_currency | char(3) | Only for converted invoices. The target currency into which the invoice value was additionally converted. |
exchange_rate | decimal(10,4) | Only for converted invoices. Exchange rate (conversion from field "currency" to field "exchange_currency". |
exchange_date | varchar(10) | Only for converted invoices. Date of exchange rate. |
exchange_info | varchar(10) | Only for converted invoices. Information on the exchange rate source (NBP table number). |
external_id | int(11) | Invoice identifier used in a remote accounting system. |
items | array | An array of invoice items. Each element of the array is also an array containing fields: name (varchar) - item name sku (varchar) - product SKU number ean (varchar) - product EAN number price_brutto (float) - single item gross price price_netto (float) - single item net price tax_rate (float) - VAT tax rate e.g. "23", (value from range 0-100, EXCEPTION values: "-1" for "EXPT"/"ZW" exempt from VAT, "-0.02" for "NP" annotation, "-0.03" for "OO" VAT reverse charge) quantity (int) - quantity of pieces is_shipment (int) - if the item is a shipment (0 - no, 1 - yes) order_product_id (int) - ID of order item from BaseLinker order manager |
Sample
Input data:Output data:
A sample request in PHP: