getReceipt
The method allows you to retrieve a single receipt from the BaseLinker order manager. To retrieve a list of new receipts (when integrating a fiscal printer), use the getNewReceipts method.
Input parameters
Output data:
A sample request in PHP:
receipt_id | int | Receipt ID. Not required if order_id is provided. |
order_id | int | Order ID. Not required if receipt_id is provided. |
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 |
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. |
year | int | Year - an element of the receipt number |
month | int | Month - element of receipt number (0 if annual numbering is used) |
sub_id | int | Monthly/yearly number - receipt number element |
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. |
currency | char(3) | 3-letter currency symbol (e.g. EUR, PLN) |
total_price_brutto | float | Łączna wartość paragonu brutto |
external_receipt_number | varchar(30) | Receipt number from the fiscal cash register or from the external system |
exchange_currency | char(3) | Only for converted receipts. The target currency into which the receipt value was additionally converted. |
exchange_rate | decimal(10,4) | Only for converted receipts. Exchange rate (conversion from field "currency" to field "exchange_currency". |
exchange_date | varchar(10) | Only for converted receipts. Date of exchange rate. |
exchange_info | varchar(10) | Only for converted receipts. Information on the exchange rate source (NBP table number). |
items | array | An array of receipt 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 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 |
Sample
Input data:Output data:
A sample request in PHP: