API documentation
Method list
Test your request
Changelog


Introduction
The API enables the information exchange between an external system and BaseLinker.
Communication uses data in JSON format. To make a request to the API, send the proper POST request to:
https://api.baselinker.com/connector.php

To send a request for each method a token is required. The token is assigned directly to the BaseLinker user account. User can generate API token in BaseLinker panel in "Account & other -> My account -> API" section.
Authorization with http header (X-BLToken) is recommended.

3 values must be submitted to the connector.php file via POST:
  1. token - unique user API key - DEPRECATED, please use X-BLToken header
  2. method - the name of the requested API method
  3. parameters - arguments of the requested function in JSON format

Sample: curl 'https://api.baselinker.com/connector.php' -H 'X-BLToken: 1-23-ABC' --data-raw 'method=getOrders&parameters=%7B%22date_from%22%3A+1407341754%7D'
Request limit
The API request limit is 100 requests per minute.


Latest changes
The API was last updated 2024-03-05.


Encoding standards
The API uses UTF-8.
The API expects base64 content in some endpoints and it is very important to replace "+" character with "%2B" sequence before sending it to our API to avoid an incorrect decoding.


Product catalog
addInventoryPriceGroupThe method allows to create a price group in BaseLinker storage. Providing a price group ID will update the existing price group. Such price groups may be later assigned in addInventory method.
deleteInventoryPriceGroupThe method allows you to remove the price group from BaseLinker storage.
getInventoryPriceGroupsThe method allows to retrieve price groups existing in BaseLinker storage
addInventoryWarehouseThe method allows you to add a new warehouse available in BaseLinker catalogues. Adding a warehouse with the same identifier again will cause updates of the previously saved warehouse. The method does not allow editing warehouses created automatically for the purpose of keeping external stocks of shops, wholesalers etc. Such warehouse may be later used in addInventory method.
deleteInventoryWarehouseThe method allows you to remove the warehouse available in BaseLinker catalogues. The method does not allow to remove warehouses created automatically for the purpose of keeping external stocks of shops, wholesalers etc.
getInventoryWarehousesThe method allows you to retrieve a list of warehouses available in BaseLinker catalogues. The method also returns information about the warehouses created automatically for the purpose of keeping external stocks (shops, wholesalers etc.)
addInventoryThe method allows you to add the BaseLinker catalogs. Adding a catalog with the same identifier again will cause updates of the previously saved catalog.
deleteInventoryThe method allows you to delete a catalog from BaseLinker storage.
getInventoriesThe method allows you to retrieve a list of catalogs available in the BaseLinker storage.
addInventoryCategoryThe method allows you to add a category to the BaseLinker catalog. Adding a category with the same identifier again, updates the previously saved category
deleteInventoryCategoryThe method allows you to remove categories from BaseLinker warehouse. Along with the category, the products contained therein are removed (however, this does not apply to products in subcategories). The subcategories will be changed to the highest level categories.
getInventoryCategoriesThe method allows you to retrieve a list of categories for a BaseLinker catalog.
addInventoryManufacturerThe method allows you to add a manufacturer to the BaseLinker catalog. Adding a manufacturer with the same identifier again, updates the previously saved manufacturer
deleteInventoryManufacturerThe method allows you to remove manufacturer from BaseLinker catalog
getInventoryManufacturersThe method allows you to retrieve a list of manufacturers for a BaseLinker catalog.
getInventoryExtraFieldsThe method allows you to retrieve a list of extra fields for a BaseLinker catalog.
getInventoryIntegrationsThe method returns a list of integrations where text values in the catalog can be overwritten. The returned data contains a list of accounts for each integration and a list of languages supported by the integration
getInventoryAvailableTextFieldKeysThe method returns a list of product text fields that can be overwritten for specific integration.
addInventoryProductThe method allows you to add a new product to BaseLinker catalog. Entering the product with the ID updates previously saved product.
deleteInventoryProductThe method allows you to remove the product from BaseLinker catalog.
getInventoryProductsDataThe method allows you to retrieve detailed data for selected products from the BaseLinker catalogue.
getInventoryProductsListThe method allows to retrieve a basic data of chosen products from BaseLinker catalogs.
getInventoryProductsStockThe method allows you to retrieve stock data of products from BaseLinker catalogs
updateInventoryProductsStockThe method allows to update stocks of products (and/or their variants) in BaseLinker catalog. Maximum 1000 products at a time.
getInventoryProductsPricesThe method allows to retrieve the gross prices of products from BaseLinker catalogues.
updateInventoryProductsPricesThe method allows bulk update of gross prices of products (and/or their variants) in the BaseLinker catalog. Maximum 1000 products at a time.
getInventoryProductLogsThe method allows to retrieve a list of events related to product change (or their variants) in the BaseLinker catalog.
runProductMacroTriggerThe method allows you to run personal trigger for products automatic actions.


External storages
getExternalStoragesListThe method allows you to retrieve a list of available external storages (shops, wholesalers) that can be referenced via API.
getExternalStorageCategoriesThe method allows you to retrieve a category list from an external storage (shop/wholesale) connected to BaseLinker.
getExternalStorageProductsDataThe method allows to retrieve detailed data of selected products from an external storage (shop/wholesaler) connected to BaseLinker.
getExternalStorageProductsListThe method allows to retrieve detailed data of selected products from an external storage (shop/wholesaler) connected to BaseLinker.
getExternalStorageProductsQuantityThe method allows to retrieve stock from an external storage (shop/wholesaler) connected to BaseLinker.
getExternalStorageProductsPricesThe method allows to retrieve product prices from an external storage (shop/wholesaler) connected to BaseLinker.
updateExternalStorageProductsQuantityThe method allows to bulk update the product stock (and/or variants) in an external storage (shop/wholesaler) connected to BaseLinker. Maximum 1000 products at a time.


Orders
getJournalListThe method allows you to download a list of order events from the last 3 days.
addOrderThe method allows adding a new order to the BaseLinker order manager.
getOrderSourcesThe method returns types of order sources along with their IDs. Order sources are grouped by their type that corresponds to a field order_source from the getOrders method. Available source types are "personal", "shop" or "marketplace_code" e.g. "ebay", "amazon", "ceneo", "emag", "allegro", etc.
getOrderExtraFieldsThe method returns extra fields defined for the orders. Values of those fields can be set with method setOrderFields. In order to retrieve values of those fields set parameter include_custom_extra_fields in method getOrders
getOrdersThe method allows you to download orders from a specific date from the BaseLinker order manager. The order list can be limited using the filters described in the method parameters. A maximum of 100 orders are returned at a time.

It is recommended to download only confirmed orders (get_unconfirmed_orders = false). Unconfirmed orders may be incomplete. The user may be, for example, in the process of creating an order - it already exists in the database, but not all information is completed. Unconfirmed orders may contain only a partial list of products and may be changed soon. Confirmed orders usually do not change anymore and can be safely downloaded to an external system.

The best way to download the ongoing orders is:
Collecting new order identifiers using getJournalList.

Or, using this method:
1. Setting the starting date and specifying it in the date_confirmed_from field
2. Processing of all received orders. If 100 orders are received, there may be even more to download.
3. Downloading the next package of orders by entering the value of the date_confirmed field from last downloaded order in the date_confirmed_from field. In order to avoid downloading the same orders value of date_confirmed should be increased by 1 second. This operation is repeated until you receive a package with less than 100 orders (this means that there are no more orders left to download).
4. Saving the date_confirmed last processed order. You can download orders from this date onwards so that you do not download the same order twice. It is not possible for an order to 'jump' into the database with an earlier confirmation date. This way you can be sure that all confirmed orders have been downloaded.
getOrderTransactionDetailsThe method allows you to retrieve transaction details for a selected order (it now works only for orders from Amazon)
getOrdersByEmailThe method allows to search for orders related to the given e-mail address. This function is designed to be used in plugins for mail clients (Thunderbird, Outlook, etc.).
getOrdersByPhoneThe method allows you to search for orders related to the given phone number. This function is intended for use in caller recognition programs.
addInvoiceThe method allows to issue an order invoice.
getInvoicesThe 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.
getSeriesThe method allows to download a series of invoice/receipt numbering.
getOrderStatusListThe method allows you to download order statuses created by the customer in the BaseLinker order manager.
getOrderPaymentsHistoryThe method allows you to retrieve payment history for a selected order, including an external payment identifier from the payment gateway. One order can have multiple payment history entries, caused by surcharges, order value changes, manual payment editing
getOrderPickPackHistoryThe method allows you to retrieve pick pack history for a selected order.
getNewReceiptsThe 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.
getReceiptThe 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.
setOrderFieldsThe method allows you to edit selected fields (e.g. address data, notes, etc.) of a specific order. Only the fields that you want to edit should be given, other fields can be omitted in the request.
addOrderProductThe method allows you to add a new product to your order.
setOrderProductFieldsThe method allows you to edit the data of selected items (e.g. prices, quantities etc.) of a specific order. Only the fields that you want to edit should be given, the remaining fields can be omitted in the request.
deleteOrderProductThe method allows you to remove a specific product from the order.
setOrderPaymentThe method allows you to add a payment to the order.
setOrderStatusThe method allows you to change order status.
setOrderStatusesThe method allows you to batch set orders statuses
setOrderReceiptThe method allows you to mark orders with a receipt already issued.
addOrderInvoiceFileThe method allows you to add an external PDF file to an invoice previously issued from BaseLinker. It enables replacing a standard invoice from BaseLinker with an invoice issued e.g. in an ERP program.
addOrderReceiptFileThe method allows you to add an external PDF file to a receipt previously issued from BaseLinker. It enables replacing a standard receipt from BaseLinker with a receipt issued e.g. in an ERP program.
getInvoiceFileThe method allows you to get the invoice file from BaseLinker.
runOrderMacroTriggerThe method allows you to run personal trigger for orders automatic actions.


Courier shipments
createPackageThe method allows you to create a shipment in the system of the selected courier.
createPackageManualThe method allows you to enter the shipping number and the name of the courier to the order (function used only to add shipments created outside BaseLinker)
getCouriersListThe method allows you to retrieve a list of available couriers.
getCourierFieldsThe method allows you to retrieve the form fields for creating shipments for the selected courier.
getCourierServicesThe method allows you to retrieve additional courier services, which depend on other shipment settings. Used only for X-press, BrokerSystem, WysyƂam z Allegro, ErliPRO couriers. Not applicable to other couriers whose forms have fixed options. The details of the package should be sent with the method (the format as in createPackage) in order to receive a list of additional services
getCourierAccountsThe method allows you to retrieve the list of accounts connected to a given courier.
getLabelThe method allows you to download a shipping label (consignment) for a selected shipment.
getProtocolThe method allows you to download a parcel protocol for selected shipments if the protocol is available for chosen courier
getOrderPackagesThe method allows you to download shipments previously created for the selected order.
getCourierPackagesStatusHistoryThe method allows you to retrieve the history of the status list of the given shipments. Maximum 100 shipments at a time
deleteCourierPackageThe method allows you to delete a previously created shipment. The method removes the shipment from the BaseLinker system and from the courier system if the courier API allows it
requestParcelPickupThe method allows you to request a parcel pickup for previously created shipments. The method sends a parcel pickup request to courier API if the courier API allows it
getRequestParcelPickupFieldsThe method allows you to retrieve additional fields for a parcel pickup request.


Products storage [OBSOLETE]

When referring to external warehouses (shop_*, warehouse_*) due to different performance of external warehouses, different integration methods and their specific requirements, the response standard may differ from the one described in the documentation.


getStoragesListThis method allows downloading a list of available storages that can be accessed via API.
addCategoryThe method allows adding a category to the BaseLinker storage. Adding a category with the same ID again, updates the previously saved category.
addProductThe method allows you to add a new product to BaseLinker storage. Entering the product with the ID updates previously saved product.
addProductVariantThe method allows to add a new variant to the product in BaseLinker storage. Providing the variant together with the ID, causes an update of the previously saved variant.
deleteCategoryThe method allows you to remove categories from BaseLinker storage. Along with the category, the products contained therein are removed (however, this does not apply to products in subcategories). The subcategories will be changed to the highest level categories.
deleteProductThe method allows you to remove the product from BaseLinker storage.
deleteProductVariantThe method allows you to remove the product from BaseLinker storage.
getCategoriesThe method allows you to download a list of categories for a BaseLinker storage or a shop storage connected to BaseLinker.
getProductsDataThe method allows to download detailed data of selected products from the BaseLinker storage or a shop/wholesaler storage connected to BaseLinker.
getProductsListThe method allows to download detailed data of selected products from the BaseLinker storage or a shop/wholesaler storage connected to BaseLinker.
getProductsQuantityThe method allows to retrieve stock from the BaseLinker storage or the shop/wholesaler storage connected to BaseLinker.
getProductsPricesThe method allows you to fetch prices of products from the BaseLinker storage or the shop/wholesaler storage connected to BaseLinker.
updateProductsQuantityThe method allows to bulk update the product stock (and/or variants) in BaseLinker storage or in a shop/wholesaler storage connected to BaseLinker. Maximum 1000 products at a time.
updateProductsPricesThe method allows for bulk update of product prices (and/or variants) in BaseLinker storage. Maximum 1000 products at a time.