Documentation of the shops data exchange protocol - baselinker.com
Function list
Tests
ChangeLog


OrdersGet
The method provides orders list from a specific date. Enter the date and / or order number from which the list of orders should begin (at least one of these two fields must be provided). Additionally, the list of returned orders may be limited only to paid orders, if the parameter is provided and set to 1


Input parameters
Incoming as $_POST fields.
time_fromint(optional) Date from which the orders are to be picked up. Unix time stamp format.
id_fromint(optional) Order ID number from which subsequent orders are to be retuned.
only_paidint(optional) Flag determining whether only paid orders are to be downloaded (0/1).
order_idstring(optional) Only one order ID return only one Order data
pageint(optional) Page number when pagination occurs.



Outgoing data
Array fields that the method should return.
list of ordersarrayList of orders, the key of which is a numeric order ID in the range 1 to 2 31 , and each value is an array containing the fields listed below:
delivery_fullnamestringDelivery address: full name
delivery_companystringDelivery address: company name
delivery_addressstringDelivery address: street and home/local number
delivery_citystringDelivery address: city
delivery_postcodestringDelivery address: postcode
delivery_state_codestringDelivery address: State code
delivery_countrystringDelivery address: Country name
delivery_country_codestringDelivery address: ISO country code (2 letters)
invoice_fullnamestringBilling data: full name
invoice_companystringBilling data: company
invoice_addressstringBilling data: street and home/local number
invoice_citystringBilling data: city
invoice_state_codestringBilling data: state code
invoice_postcodestringBilling data: postcode
invoice_countrystringBilling data:
invoice_country_codestringBilling data: ISO country code (2 letters)
invoice_nipstringBilling data: Tax identifier
delivery_point_idstringdelivery to point: code of point or machine
delivery_point_namestringdelivery to point: name of point or machine
delivery_point_addressstringdelivery to point: street and home/local number
delivery_point_postcodestringdelivery to point: postcode
delivery_point_citystringdelivery to point: city
phonestringtelephone number
emailstringemail
date_addintdate in UNIX_TIMESTAMP format
payment_method_idstringID of payment method
payment_methodstringName of payment method
payment_method_codintflag determining whether the payment is cash on delivery (0/1)
payment_external_idstring(optional) External payment identifier
payment_operatorstring(optional) Name of the payment operator
currencystringISO code of the order currency, e.g. EUR, USD, PLN
user_commentsstringcustomer comment
user_comments_longstringcustomer comment (as above, but without restrictions on the size of the text )
admin_commentsstringshort note from the operator to the order
status_idstringID of order status
delivery_method_idstringID of delivery method
delivery_methodstringName of delivery method
delivery_pricefloatdelivery price
paidintflag determining whether the order is paid (0/1)
paid_timeintdate in UNIX_TIMESTAMP format
want_invoiceinta flag specifying whether the customer wants an invoice (0/1)
extra_field_1stringadditional field (any data)
extra_field_2stringadditional field (any data)
productsarraya list of ordered products, where each element is an array with the following fields:
| - idstringproduct ID
| - variant_idstringvariant ID (0 when main product)
| - namestringfull product or variant name
| - quantityintnumber of items purchased
| - pricefloatgross price of one item
| - weightfloatWeight expressed in kilograms
| - taxfloattax amount expressed as a percentage, as a number from 0-100. Without % character.
| - eanstringEAN - 13 digit barcode
| - skustring Stock Keeping Unit
| - locationstringLocation in the warehouse
| - attributesarrayan optional array with selectable product attributes describing the purchased variant, in which each element contains the following fields:
      |- namestringattribute name (e.g. 'color')
      |- valuestringattribute value (e.g. 'red')
      |- pricefloatprice difference to the basic price
pagesint(optional) number of pages. We recommend 1000 results on 1 page. The limit is 1000 pages.



Example:
Input data:
Array
(
    [time_from] => 1529505396
)

POST request:
time_from=1529505396


returned data JSON:
{"123":{"delivery_fullname":"Jan Kowalski","delivery_company":"Firma sp.z.o.o.","delivery_address":"ul. Kolejowa 1","delivery_city":"Warszawa","delivery_postcode":"00-000","delivery_country":"Polska","delivery_country_code":"PL","invoice_fullname":"Jan Kowalski","invoice_company":"","invoice_nip":"","invoice_address":"ul. Kolejowa 1","invoice_city":"Warszawa","invoice_postcode":"00-000","invoice_country":"Polska","invoice_country_code":"PL","phone":"1234567890","email":"example@example.com","want_invoice":0,"date_add":1529505947,"user_comments":"Proszę o wysyłkę w dniu dzisiejszym","delivery_method":"Paczka24 - Poczta Polska","payment_method":"Przelew natychmiastowy","payment_method_cod":0,"delivery_price":"8.50","currency":"PLN","status_id":"1","paid":0,"products":[{"id":"12","name":"Toster - czerwony","quantity":"1","price":"49.99","tax":"23","weight":"0","sku":"Toster123","ean":"","attributes":[]}]}}

Dane wyjściowe:
Array
(
    [123] => Array
        (
            [delivery_fullname] => Jan Kowalski
            [delivery_company] => Firma sp.z.o.o.
            [delivery_address] => ul. Kolejowa 1
            [delivery_city] => Warszawa
            [delivery_postcode] => 00-000
            [delivery_country] => Polska
            [delivery_country_code] => PL
            [invoice_fullname] => Jan Kowalski
            [invoice_company] => 
            [invoice_nip] => 
            [invoice_address] => ul. Kolejowa 1
            [invoice_city] => Warszawa
            [invoice_postcode] => 00-000
            [invoice_country] => Polska
            [invoice_country_code] => PL
            [phone] => 1234567890
            [email] => example@example.com
            [want_invoice] => 0
            [date_add] => 1529505947
            [user_comments] => Proszę o wysyłkę w dniu dzisiejszym
            [delivery_method] => Paczka24 - Poczta Polska
            [payment_method] => Przelew natychmiastowy
            [payment_method_cod] => 0
            [delivery_price] => 8.50
            [currency] => PLN
            [status_id] => 1
            [paid] => 0
            [products] => Array
                (
                    [0] => Array
                        (
                            [id] => 12
                            [name] => Toster - czerwony
                            [quantity] => 1
                            [price] => 49.99
                            [tax] => 23
                            [weight] => 0
                            [sku] => Toster123
                            [ean] => 
                            [attributes] => Array
                                (
                                )

                        )

                )

        )

)