getNewReceipts
The method allows you to retrieve receipts waiting to be issued. This method should be used in creating integration with a fiscal printer. The method can be requested for new receipts every e.g. 10 seconds. If any receipts appear in response, they should be confirmed by the setOrderReceipt method after printing to disappear from the waiting list.
Input parameters
Output data:
A sample request in PHP:
series_id | int | (optional) The numbering series ID allows filtering by the receipt numbering series. Using multiple series numbering for receipts is recommended when the user has multiple fiscal printers. Each fiscal printer should have a separate series. |
id_from | int | (optional) ID from which logs are to be retrieved. [default=0] |
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 |
orders | array | An array of information on the receipts found. Each order is described by the fields listed below. |
receipt_id | int | The receipt ID, used in the setOrderReceipt method to return the receipt as printed. |
series_id | int | Receipt numbering series identifier |
receipt_full_nr | varchar(30) | The number assigned by BaseLinker when creating the receipt. Example number: "123/10/2018/P". The format depends on the settings - the numbering can be monthly, annual or continuous (then the number is a consecutive number). The number can be skipped, the fiscal printer can generate its own receipt number and save it in the setOrderReceipt method. |
order_id | int | Order Identifier from BaseLinker order manager |
date_add | int | Date of order creation (in unix time format) |
payment_method | varchar(30) | Payment type name |
nip | varchar(30) | Payers details - VAT Reg No.. It may contain special characters: letters (prefix), hyphens and spaces. The VAT registration number should be cleared from these characters at your own discretion. |
products | array | An array of order products. Each element of the array is also an array containing fields: name (varchar) - product name price_brutto (float) - single item gross 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 sku (varchar) - product SKU number ean (varchar) - product EAN number |
Sample
Input data:Output data:
A sample request in PHP: