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


ProductsList
The method allows you to download basic product data from the store's warehouse, using optional selection and sorting criteria. The results of this function should return all matching products, excluding variants.


Input parameters
Incoming as $_POST fields.
category_idstring(optional) Get products from a specific category. WARNING: ProductsList must handle both the empty value of this field and the value of "all" - in both cases it means no filtering by category!
filter_limitint(optional) limiting the number of returned products
filter_sortstring(optional) value by which the list of products is to be sorted. Possible values: "id [ASC|DESC]", "name [ASC|DESC]", "quantity [ASC|DESC]", "price [ASC|DESC]"
filter_idstring(optional) limit the results to a specific product id
filter_ids_liststring(optional) limit the results to a list of specific product id's
filter_eanstring(optional) limiting the results to a specific ean
filter_skustring(optional) limiting the results to a specific SKU
filter_namestring(optional) item name filter (can be part of the name)
filter_price_fromfloat(optional) lower price limit (products with a lower price are not returned)
filter_price_tofloat(optional) upper price limit
filter_quantity_fromint(optional) lower limit of the quantity of products
filter_quantity_toint(optional) upper limit on the quantity of products
filter_availableint(optional) displaying only products marked as available (1) or unavailable (0) or all (empty value)
pageint(optional) Page number when pagination occurs.



Outgoing data
Array fields that the method should return.
list of productsarrayAn array with product identifiers as the key and an array with the fields listed below:
| - namestringProduct name
| - quantityintProduct quantity (stock)
| - pricefloatPrice gros
| - eanstring(optional) EAN - 13 digit barcode
| - skustring(optional) Stock Keeping Unit
| - locationstring(optional) Location in the warehouse
| - currencychar (3)(optional) ISO code of the product currency, e.g. EUR, USD, PLN
pagesint(optional) number of pages. We recommend 1000 results on 1 page. The limit is 1000 pages.



Example:
Input data:
Array
(
    [filter_price_from] => 100
    [filter_sort] => price
)

POST request:
filter_price_from=100&filter_sort=price


returned data JSON:
{"214":{"name":"krem intensywnie nawil\u017caj\u0105cy 50ml Olivia","quantity":"2","price":"119.00","sku":"AB-123"},"5105":{"name":"Shiseido krem na noc ka\u017cdy rodzaj cery 150ml","quantity":"1","price":"169.00","sku":"ZZ-552"},"pages":4}

Dane wyjściowe:
Array
(
    [214] => Array
        (
            [name] => krem intensywnie nawilżający 50ml Olivia
            [quantity] => 2
            [price] => 119.00
            [sku] => AB-123
        )

    [5105] => Array
        (
            [name] => Shiseido krem na noc każdy rodzaj cery 150ml
            [quantity] => 1
            [price] => 169.00
            [sku] => ZZ-552
        )

    [pages] => 4
)