API documentation
Method list
Test your request
Changelog


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
invoice_idint(optional) Invoice identifier. Completing this field will result in downloading information about only one specific invoice.
order_idint(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_fromint(optional) Date from which invoices are to be collected. Unix time stamp format.
id_fromint(optional) The invoice ID number from which subsequent invoices are to be retrieved.
series_idint(optional) numbering series ID that allows filtering after the invoice numbering series.
get_external_invoicesbool(optional) 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)
get_government_databool(optional) If set to 'true' then includes government data fields in the response:
- gov_id (varchar) - government invoice identifier
- gov_date (int) - government invoice date (unix time format)
- gov_status (int) - government invoice status ( 1 => Sent, 2 => Accepted, 3 => Rejected, 5 => Offline mode)



Output data
The method returns the data in JSON format.
statusvarchar(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
invoicesarrayAn array of the information about the invoices found. Each invoice is described by the fields listed below.
| - invoice_idintInvoice identifier
| - order_idintOrder identifier for which an invoice is issued
| - series_idintInvoice numbering series identifier
| - typevarchar(10)Type of invoice. Available values:
normal - regular invoice
correcting - corrective invoice
| - numbervarchar(30)Full invoice number. Format depends on account settings. Usually [no]/[month]/[year]
| - sub_idintMonthly/yearly number - invoice number element
| - monthintMonth - element of invoice number (0 if annual numbering is used)
| - yearintYear - invoice number element
| - postfixvarchar(1)Suffix - invoice number element
| - date_addintInvoice creation date (unix time format)
| - date_sellintSale date (unix time format)
| - date_pay_tointDue date (unix time format). Not completed by default (value 0)
| - currencychar(3)3-letter currency symbol (e.g. EUR, PLN)
| - total_price_bruttofloatTotal gross invoice value
| - total_price_nettofloatTotal net invoice value
| - paymentvarchar(100)Payment method name
| - additional_infovarchar(500)Additional information/invoice remarks
| - invoice_fullnamevarchar(100)Billing details - name and surname
| - invoice_companyvarchar(100)Billing details - company
| - invoice_nipvarchar(100)Billing details - Vat Reg. no./tax number
| - invoice_addressvarchar(100)Billing details - street and house number
| - invoice_postcodevarchar(100)Billing details - postcode
| - invoice_cityvarchar(100)Billing details - city
| - invoice_countryvarchar(20)Billing details - country
| - invoice_country_codechar(2)Billing details - country code (two-letter, e.g. EN)
| - sellervarchar(250)Seller data (all in one field)
| - issuervarchar(100)Issuer data
| - correcting_to_invoice_idintOnly with a corrective invoice. The identifier of the corrected invoice.
| - correcting_reasonvarchar(100)Only with a corrective invoice. Reason for correcting an invoice.
| - correcting_itemsboolOnly with a corrective invoice. Flag indicating whether the correction changes the invoice items.
| - correcting_databoolOnly with a corrective invoice. A flag indicating whether the correction changes the buyer data.
| - external_invoice_numbervarchar(30)External system invoice number
| - exchange_currencychar(3)Only for converted invoices. The target currency into which the invoice value was additionally converted.
| - exchange_ratedecimal(10,6)Only for converted invoices. Exchange rate (conversion from field "currency" to field "exchange_currency".
| - exchange_datevarchar(10)Only for converted invoices. Date of exchange rate.
| - exchange_infovarchar(20)Only for converted invoices. Information on the exchange rate source (NBP table number).
| - external_idintInvoice identifier used in a remote accounting system.
| - itemsarrayAn 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: