The product import API allows an external system (for example, a warehouse management system) to add and modify products on bindCommerce, in order to subsequently be sent to the sales channels.

Connector configuration on bindCommerce

To allow the API management system to create and update products on bindCommerce it will be necessary to create a specific configuration and the relative connector.api product import config 

 api product import info

To create the configuration go to the menu:

API >> Product iport configuration

Click on Add and fill in the fields as follows:

  • Configuration Name: Choose the name you think is most appropriate
  • Action type: you can choose between - Creation - Creation and update - Update
  • Information to consider: Title - Description - Short description - Manufacturer - Supplier - Dimensions and weight - Quantity - Attributes - Tags - Prices - Alternatives - Images - Categories
  • Elimination of data not transmitted: Barcode - Images - Products
  • Calculate quantity of parent product from the sum of the variants ?: option that allows you to determine if the parent products should have the quantity calculated based on the sum of the stock of the individual variants
  • Calculate parent price from the minimum of variants ?: option that allows you to determine if the parent products should have the price calculated based on the lowest price of the individual variants

Click on SAVE AND CLOSE.

To create the connector that will allow you to import products from the API management to bindCommerce you need to go to the menu:

Process >> Connectors

Click on Add and fill in the fields as follows:

  • Connector Name: Use whatever name you prefer
  • Node Type (Technology): API
  • Node: the node created earlier
  • Connector type: API [import products]

By clicking on SAVE AND CONTINUE you will have access to the additional fields to be filled in.

  • The calling system must use the following string: copy the URL in this field and paste it in the appropriate field on the management control panel
  • Connector Configuration: Select the configuration created earlier
  • Product filter: to create a product filter, please follow the instructions given in the product Filters guide

Click on SAVE AND CLOSE.

Call and authentication

The call is made to the URL generated by bindCommerce for the specific connector (to be configured in advance through the bindCommerce interface).
Authentication occurs through tokens assigned for the API node. The parameter is passed into the request header.

Example PHP script to make the call

<?php
ini_set('display_errors', true);
error_reporting(E_ALL);


$strXml = file_get_contents(__DIR__.'/Products.xml');

$curl = curl_init();
curl_setopt_array($curl, array(


CURLOPT_URL => "https://miohost.bindcommerce.cloud/integrator-tool/api/products.php?connector=N",
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_VERBOSE => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => $strXml,
CURLOPT_HTTPHEADER => array(

"cache-control: no-cache",

"content-type: text/xml",

"token: 0435a03b361d7cc24fc1acacdeaae1d7"

),
));

$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}

This call returns a json so formed: 

[
'status' => success || error
'message' => String with the description of the connector log
'code' => a numerical code that expresses success or failure
'id_exec' => optional - id exec, provided if needed to check the call status (see the STATUS CHECK CALL section)
'id_procedure' => optional -  id procedure, provided if needed to check the call status ((see the STATUS CHECK CALL section))
]

Product files

Example file

<?xml version="1.0" encoding="UTF-8"?>

<bindCommerceProducts Mode="full">

<Products>

          <Product>

         <Language>IT</Language>

         <Code>3410116</Code>

         <Barcode>8001066510405</Barcode>

         <BarcodeKind>EAN</BarcodeKind>

         <Title>6 MATITE PER FALEGNAMI 18CM.</Title>

         <DescriptionHtml>6 MATITE PER FALEGNAMI 18CM. COLORE ROSSO</DescriptionHtml>

         <ShortDescription></ShortDescription>

         <Notes />

         <Categories>

                  <Category>Scarpe|Donna|Scarpe da ginnastica</Category>

                  <Category>Promo</Category>

         </Categories>

         <Alternatives>

                  <Alternative>

                           <Language>IT</Language>

                           <Title></Title>

                           <DescriptionHtml></DescriptionHtml>

                           <ShortDescription></ShortDescription>

                           <Notes />

                  </Alternative>

         </Alternatives>

         <Prices>

                  <Price>

                           <ListCode>Public</ListCode>

                           <ListName>Prezzo pubblico</ListName>

                           <Currency>EUR</Currency>

                           <Vat>0.22</Vat>

                           <NetPrice>1.0820</NetPrice>

                           <GrossPrice>1.32</GrossPrice>

                           <OverridePrice>0</OverridePrice>

                           <Override>0</Override>

                  </Price>

                  <Price>

                            <ListCode>00045</ListCode>

                            <Currency>EUR</Currency>

                            <Vat>0.22</Vat>

                            <NetPrice>0.3200</NetPrice>

                            <GrossPrice>1.3904</GrossPrice>

                            <OverridePrice>0</OverridePrice>

                           <Override>0</Override>

                  </Price>                

                  <Price>

                            <ListCode>Quantity discount</ListCode>

                            <Currency>EUR</Currency>

                            <Vat>0.22</Vat>

                            <NetPrice>0.3200</NetPrice>

                            <GrossPrice>1.3904</GrossPrice>

                            <OverridePrice>0</OverridePrice>

                           <Override>0</Override>

                           <PriceQuantityStart>1</PriceQuantityStart>

                           <PriceQuantityEnd>5</PriceQuantityEnd>

                  </Price>

                  <Price>

                            <ListCode>Quantity discount</ListCode>

                            <Currency>EUR</Currency>

                            <Vat>0.22</Vat>

                            <NetPrice>0.3200</NetPrice>

                            <GrossPrice>1.3904</GrossPrice>

                            <OverridePrice>0</OverridePrice>

                           <Override>0</Override>

                           <PriceQuantityStart>6</PriceQuantityStart>

                           <PriceQuantityEnd>999</PriceQuantityEnd>

                  </Price>

                  <Price>

                           <ListName>Listino 46</ListName>

                           <Currency>EUR</Currency>

                           <Vat>0.22</Vat>

                           <NetPrice>0.3200</NetPrice>

                           <GrossPrice>1.3904</GrossPrice>

                           <OverridePrice>0</OverridePrice>

                           <Override>0</Override>

                  </Price>

         </Prices>

         <Manufacturer>METRICA</Manufacturer>

         <MPN />

         <Supplier>GLP</Supplier>

         <Dimensions>

                  <Weight>0.50</Weight>

                  <WeightUom>kg</WeightUom>

                  <WeightVolume />

                  <LwhUom>cm</LwhUom>

                  <Length>20.00</Length>

                  <Width>20.00</Width>

                  <Height>10.00</Height>

         </Dimensions>

         <Qty>1</Qty>

         <Pictures>

                  <Picture>

                           <URL>http://miosito.com/shop/images/341011.jpg</URL>

                  </Picture>

                  <Picture tags=”scarpe,sport,estate”>

                           <URL>http://miosito.com/shop/images/3410116.jpg</URL>

                  </Picture>

                  <Picture>

                           <URL>http://miosito.com/shop/images/3410116.jpg</URL>

                  </Picture>

         </Pictures>

         <Attributes>

                  <Attribute lang=”it”>

                           <Name>Materiale</Name>

                           <Value>Gomma</Value>

                  </Attribute>

                  <Attribute  lang=”it”>

                           <Name>Colore</Name>

                           <Value>Rosso</Value>

                  </Attribute>

                  <Attribute  lang=”en”>

                           <Name>Color</Name>

                           <Value>Red</Value>

                  </Attribute>

         </Attributes>

         <Warehouses>

                  <Warehouse>

                           <WarehouseKey>Magazzino Roma</WarehouseKey>

                           <Qty>8</Qty>

                  </Warehouse>

                  <Warehouse>

                           <WarehouseKey>Magazzino Milano</WarehouseKey>

                           <Qty>13</Qty>

                  </Warehouse>

         </Warehouses>

         <Variants>

                  <Variant>

                           <Code>100383----F254/701/-</Code>

                           <Barcode>8033766128031</Barcode>

                           <BarcodeKind>EAN</BarcodeKind>

                           <Title>BRIKO Maschera sci discesa snowboard unisex S3 nero bianco 100383[701]</Title>

                           <Qty>1</Qty>

                           <Pictures>

                                  <Picture>

                                         <URL>http://miosito.com/shop/images/341011.jpg</URL>

                                 </Picture>

                                 <Picture tags=”scarpe,sport,estate”>

                                        <URL>http://miosito.com/shop/images/3410116.jpg</URL>

                                 </Picture>

                                 <Picture>

                                       <URL>http://miosito.com/shop/images/3410116.jpg</URL>

                                 </Picture>

                           </Pictures>

 

                           <Attributes>

                                    <Attribute>

                                             <Name />

                                             <Value />

                                   </Attribute>

                           </Attributes>

                           <Prices>

                                    <Price>

                                             <ListName>Prezzo pubblico</ListName>

                                             <Vat>22.0000</Vat>

                                             <NetPrice>1.0820</NetPrice>

                                             <GrossPrice>1.32</GrossPrice>

                                             <OverridePrice>0</OverridePrice>

                                             <Override>0</Override>

                                    </Price>

                           </Prices>

                           <Warehouses>

                                    <Warehouse>

                                             <WarehouseKey>Magazzino Roma</WarehouseKey>

                                             <Qty>8</Qty>

                                    </Warehouse>

                                    <Warehouse>

                                             <WarehouseKey>Magazzino Milano</WarehouseKey>

                                             <Qty>13</Qty>

                                    </Warehouse>

                           </Warehouses>

                  </Variant>

         </Variants>

         <Derivatives>

                  <Derivate>

                           <Title>Confezione 60 MATITE PER FALEGNAMI 18CM.</Title>

                           <Code>3410116A</Code>

                           <Barcode>8001066510405A</Barcode>

                           <BarcodeKind>EAN</BarcodeKind>

                           <PackageQty>6</PackageQty>

                           <PriceMultiplied>9</PriceMultiplied>

                  </Derivate>

         </Derivatives>

         </Product>

         <Product>

         ….

         </Product>

</Products>

<Delete>

         <sku>SKUTEST123</sku>

         <sku>SKUTEST456</sku>

</Delete>

</bindCommerceProducts>

File fields

GENERAL STATEMENTS

Field

Description

Mode

Sending type:

  • full = send complete
  • incremental = send incremental (partial)

Products

Contains one or more <Product> tags

PRODUCT INFORMATION

Field

Description

Language

Language in which the product is described in ISO 639-1 format (e.g. IT)

Code

Product code / SKU (e.g. 3410116)

Barcode

Bar code (e.g. 8001066510405)

BarcodeKind

Barcode type (e.g. EAN, UPS, ISBN)

Title

Product title

DescriptionHtml

Full description in HTML

ShortDescription

Short description

Notes

Notes

Categories

Group containing categories

Alternatives

Group containing alternative descriptions

Prices

Group containing prices

Manufacturer

Manufacturer or Brand (e.g. Adidas)

MPN

Manufacturer Product Number, or original manufacturer code (e.g. PERT-G-8678)

Supplier

Supplier (e.g. Rossi Distribuzioni S.p.A.)

Dimensions

Group containing dimensions

Qty

Quantity in stock. Both integer and decimal values (with separator.) Are accepted, e.g. 1 or 55.31
If a product is structured by variants, updating the variant stock will automatically calculate the stock of the relevant parent product as the sum of the variant stock.

MetaTitle
Meta Title
MetaDescription
Meta Description
MetaKeywords
Meta Keywords

Warehouses

Group containing availability on alternative warehouses

Pictures

Group containing the images

Attributes

Group containing the attributes

Variants

Group containing the variants

CATEGORY (CONTAINED IN THE < CATEGORY > TAG)

Field

Description

Category

Category tree with pipe separator
Example: Shoes | Woman | Sneakers

If you want to match multiple category trees to a product, you can add multiple Category tags

ALTERNATIVE (CONTAINED IN THE < ALTERNATIVE > TAG)

Field

Description

Language

Language in which the product alternative is described in ISO 639-1 format (e.g. EN)

Title

Title translation

DescriptionHtml

Translation of the HTML description

ShortDescription

Translation of the short description

Notes

Translation of the notes

PRICE (CONTAINED IN THE < PRICE > TAG)

Field

Description

ListCode

Price list identification code (eg Public01) corresponding to the price list key "Key Gest (Management price list and API)"

ListName

Identification name of the price list (eg Public Discounted)

Currency

Currency

Vat

VAT rate (e.g. 0.2200)

NetPrice

Price excluding VAT (e.g. 1.08200)

GrossPrice

Price including VAT (e.g. 1.32000)

OverridePrice

Discounted price (e.g. 0)

Override

Discounted price application
Allowed values:
0 = discounted price disabled
1 = discounted price enabled (consider VAT included)
-1 = discounted price enabled (consider VAT excluded)
It is advisable to use the values 0 and 1 (the case -1 is difficult to apply to the sales channels)

PriceQuantityStart

Lower quantity limit

PriceQuantityEnd

Upper quantity limit

The need to populate both NetPrice and GrossPrice is justified by the certainty of rounding the values. In the event that one of the 2 values should not be completed (not recommended), it will still be possible to have it calculated by bindCommerce at the end of the import.
If a product is structured by variants, updating the price of the variant will automatically calculate the relative price of the parent product as a minimum of the prices of the variants.
With regard to the identification of the price lists, the following rules apply:

  • If only the ListCode is present in the XML file, the list key is used to identify it and match it to the existing ones, or possibly create a new one if no match is found (in this case the list code will also be used as its name)
  • If only ListName is present in the XML file, the name of the price list is used to identify it and match it to the existing ones, or if necessary create a new one (without key, only with the name) if no matching is found
  • If both ListCode and ListName are in the XML file, only ListCode is considered for comparison

DIMENSIONS (CONTAINED IN THE < DIMENSIONS > TAG)

Field

Description

Weight

Weight (e.g. 0.50)

WeightUom

Weight measurement unit (e.g. Kg)

WeightVolume

Volumetric weight (e.g. 0.67).
This value is used in rare processing

LwhUom

Linear unit of measure (e.g. cm)

Length

Length (e.g. 15.12)

Width

Base (e.g. 32.00)

Height

Height (e.g. 5.00)

WAREHOUSES (CONTAINED IN THE < WAREHOUSE > TAG)

Field

Description

WarehouseKey

A unique identifier to associate with the warehouse. Automatically, the API call assigns the following name which can be viewed (and changed) in the binding interface. Example if the key is "Milan warehouse" the name will be->
Milan warehouse created by API

Qty

The quantity of product present in the warehouse with the key "WarehouseKey"
If a product is structured by variants, updating the variant stock will automatically calculate the stock of the relevant parent product as the sum of the variant stock.

IMAGES (CONTAINED IN THE < PICTURE > TAG)

Field

Description

URL

Absolute URL of the image to be imported.
The main image is identified by the order in which they are sent. The first is the main one.

The import order (which determines the export order) is determined by the order of the tags in the XML file, except for the main image, which will always appear first).
Each image can contain comma separated tags which must be passed in the following way:
<Picture tags = "tag1, tag2, tag3"> ... </Picture>

ATTRIBUTE (CONTAINED IN THE < ATTRIBUTE > TAG)

Field

Description

Name

Name of the attribute
The name will be compared with the "Management attribute key" present in the attribute form

Value

Value of the attribute

In order to create a new attribute, the <Attribute lang = "it"> tag must be complete with the language

VARIANT (CONTAINED IN THE < VARIANT > TAG)

Field

Description

Code

SKU code of the variant

Barcode

Barcode of the variant

BarcodeKind

Barcode type of the variant

Title

Variant title

Qty

Stock quantity of the variant

Attributes

Group containing the attributes

Prices

Group containing prices

Warehouses

Group containing availability on alternative warehouses

DERIVATIVE PRODUCTS (CONTAINED IN THE < DERIVATIVES > TAG)

Field

Description

Code

SKU code of the derivative product

Barcode

Bar code of the derivative product

BarcodeKind

Barcode type

Title

Variant title

PackageQty

Necessary quantities of the original product

MultiplierPrice

Price

Derived products are composed of other products and in turn generate a product.

SKU RECORDINGS (CONTAINED IN THE < RECODES > TAG)

Field

Description

CodeExt

External code to which you want to combine the product sku

NodeId

BindCommerce node for which you want to recode

eBaySiteId

eBay market id for which you want to recode

AmazonMarket

Amazon market code for which you want to recode (e.g. APJ6JRA9NG5V4)

Every single recoding must be contained in the <Recode> </Recode> tags. The <Recode> tag can have an “action” attribute that can be set with the value “delete” (<Recode action = "delete">) to cancel a specific recoding previously loaded. The pairing is done with the data sent. It is possible, for example, to cancel all the recodings linked to a node by sending only the "NodeId" tag. For this reason, the advice is to be as precise as possible with the sending of the tags, to avoid accidental massive cancellations.

SPECIFIC SKU DELETION (< DELETE > TAG)

Field

Description

Sku

Product sku on bindCommerce to be marked as canceled. Any child products will also be marked as canceled.ou want to combine the product sku

STATUS CHECK CALL

The previous call to import products via API takes delivery of all products and provides a successful result only with regard to taking over, but not with regard to the final import result. This is because it is a batch call which can take several minutes. Instead, to check the result of the import, a new call must be made which provides the execution status log.
The same log can be consulted by clicking on the "Connectors" and "In process" buttons in the bindCommerce interface in the top menu.

api product import buttons

To do it instead programmatically, you can use the following instead using the id of the connector whose status you want to know. N = connector id.

In addition to the id parameter (which is always mandatory) it is possible to use the id_exec and id_procedure parameters as returned by the previous call (see the "Call and authentication" section)

Authentication takes place through the same token assigned for the API node.

PHP script example to check the connector log

<?php

$curl = curl_init();

curl_setopt_array($curl, array(

  CURLOPT_URL => "https://miohost.bindcommerce.cloud/integrator-tool/api/connector_status.php?id=N",

  CURLOPT_RETURNTRANSFER => true,

  CURLOPT_ENCODING => "",

  CURLOPT_MAXREDIRS => 10,

  CURLOPT_TIMEOUT => 30,

  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,

  CURLOPT_CUSTOMREQUEST => "GET",

  CURLOPT_HTTPHEADER => array(

    "cache-control: no-cache",

    "content-type: text/xml",

    "token: 0a09039b989e7b705da2575ec4ae882f"

  ),

));

$response = curl_exec($curl);

$err = curl_error($curl);

curl_close($curl);

if ($err) {

  echo "cURL Error #:" . $err;

} else {

  echo $response;

}

 

This call returns a json so formed:

[
'status' => success || error
'message' => String with the description of the connector log
'code' => a numerical code that expresses success or failure
]

If the id_exec or id_exec and id_procedure parameters are specified, the "message" field will be filled in with the content of the log file in CSV format.

The values of the code parameter are shown below

200 => no connector running

201 => connector running

401 => internal error

402 => the connector is missing

403 => internal error

404 => authentication token is missing

405 => token not configured on the node

406 => failed authentication

407 => connector does not exist

509 => Procedure (procedure id) already running since (date)

 

0 of 5 - 0 votes
Thank you for rating this article.

Tutorials

bindCommerce platform
Nodes
Creating a Web Server node to publish images
Connectors
Procedures
Logs
Products
Categories
Product attributes
Price lists and prices
Manufacturers
Alternative descriptions
Payment and shipping methods
Orders
Customers
Filter setting on products
Filter setting on orders
Multi warehouse
Internal processing
How to use templates
Template gallery
Creation and customization of templates
Responsive photo gallery in eBay description
Creation and activation of a connector to create/update alternative descriptions
Match categories
Update Price List
Dynamic currency conversion
Internal processing script
Attribute enrichment script
Barcode type calculation
Generation of derived products
Order transformation
Quantity rules
Distribution grid
Conversions and normalizations
Conversions
Currency conversion
Order status normalization
SKU recoding
Marketplaces
eBay integration
eBay nodes installation
Matching with eBay categories
Sales terms
Parameters for listing generation
eBay listing generation
Download listings from eBay
Fixed price sale or auction
eBay listing details list
Listing update
Early ending of listings
Relisting
Responses from eBay and related logs
The automated workflow
Download orders from eBay
Download categories from the eBay shop and match with product categories
Matching of eBay categories international markets
Copy Manufacturer and MPN to Attributes
Amazon integration
Amazon node
PRE-SALE ACTIVITIES
Amazon listings and details
Creation and publication of products/offers to Amazon
Set up Amazon shipping templates
Products already on Amazon
Parameters configuration for preparing Amazon offers
Amazon offers generation connector
Creation of products already present on Amazon
New products publishing
Parameters configuration for preparing Amazon offers
Creation of products not present on Amazon
Amazon offers generation connector
Matches with Amazon categories
Selling on Amazon: Attributes tutorial
Clothing category tutorial
Shoes category tutorial
Responses from Amazon and related Logs
AFTER-SALES ACTIVITIES
Download orders from Amazon
Order status update from bindCommerce
Amazon Business integration
PRE-SALES ACTIVITIES
B2B prices
VAT classification
Discounts for quantities
AFTER-SALES ACTIVITIES
Amazon Business order download
Billing management
Upload invoices issued by Danea
Download invoices on Danea
ePrice integration
ePrice listings preparation
ePrice node installation
Sending ePrice listings
Download ePrice orders
Creation of sample product files
Orders update to ePrice
ManoMano integration
ManoMano nodes installation
Send listings to ManoMano
Download orders from ManoMano
cDiscount integration
Category matching
Shipping methods mapping
Cdiscount node
Couriers mapping
Publishing new products on cDiscount
Publication of offers on Cdiscount
Import orders from Cdiscount
Cdiscount problem fixing
Allegro integration
Allegro node installation and configuration
Create Allegro Category Matches
Publishing products on Allegro
Product update on Allegro
Import orders from Allegro
AliExpress integration
AliExpress node installation
AliExpress category matching
Publishing products on AliExpress
Product groups and AliExpress brands
Download orders from AliExpress
Wish integration
Wish node installation
Publishing products on Wish
Carrier mapping for Wish
Download orders from Wish
Order update on Wish
eCommerce
VirtueMart integration
VirtueMart node
Download orders from VirtueMart
Upload orders on Virtuemart
Upload products on VirtueMart
Download products from VirtueMart
Download product link from Virtuemart
WooCommerce integration
WooCommerce node
Download orders from WooCommerce
Download configurations from WooCommerce
Uploading orders on WooCommerce
Product publishing
Import products from Woocommerce
Plugin bindCommerce for WooCommerce
Prestashop integration
Prestashop node installation
Uploading orders on PrestaShop
Download orders from Prestashop
Downloading products from Prestashop
Product publishing on Prestashop
Connector for downloading Prestashop configurations
Magento integration
Magento node
Download orders from Magento
Upload orders on Magento
Product publishing on Magento
Import of Magento products
Shopify integration
Shopify node
Products import from Shopify
Publishing products on Shopify
Download configurations from Shopify
Integration of Mlveda's Multi Country Pricing App
Download orders from Shopify
Upload orders on Shopify
OpenCart integration
OpenCart node installation
Publishing products on OpenCart
Download orders from OpenCart
Import products from OpenCart
Uploading orders on OpenCart
Ads sites
Social Networks
Facebook Catalogue integration
Configuring the Facebook Catalogue feed
Price comparators
Google Shopping integration
Translation and content enrichment
Integration with Google Translate
Integration with Icecat
Payment systems
Integration with PayPal
Import files
File format
Data file import
API for developers
API node
Export Orders
Import Products
Export Products
Documents import
Shipping update (legacy)

bindCommerce

bindCommerce s.r.l.

VAT Number IT07798861212 - SDI M5UXCR1
Registered in Napoli - REA: NA - 910618
Share capital € 20.000,00 fully paid
Tel: +39 011 089 122 0
E-mail: [email protected]

PON 2014>20 Riaccendiamo lo sviluppo