Have questions? Leave your message here or Schedule a quick call with our manager now
To upload the bridge to Magento Commerce cloud stores and make it available on the URL, the store developer should do the following steps:
1) Add the bridge folder to the project root directory via GIT:
2) Edit the file .magento.app.yaml:
Add the following configurations:
"/bridge2cart":
root: "/"
passthru: "/bridge.php"
index:
bridge.php
expires: -1
scripts: true
allow: true
3) Push changes to the repository and merge them to master.
The installation process will begin and show a message when it’s finished. You can optionally click on “Refresh” button to see whether the extension is installed or not.
The page will reload, and you should see the new module in a list of your modules.
After a successful installation, in the "Add-ons" page you will see the API2Cart plugin.
First, you must ensure that the WooCommerce REST API is working. The following conditions must be met:
Next, you need to create API keys:
The following fields must be filled in:
In the User field, you need to specify a user who has the Administrator role. The Permissions field must be Read/Write
As a result, we will get Consumer key and Consumer secret, which are needed to add a store to the API2Cart:
To add a store in the API2Cart admin panel, fill in the fields as follows:
If you receive the following message while adding a store:
First of all, you need to check whether you have specified the correct store_url, wc_consumer_key and wc_consumer_secret.
If all the fields are correct, another reason can be that your server may be configured in such a way that it does not accept authorization tokens in request headers. You need to add the following line to the .htaccess file in the folder with the woocommerce project:
RewriteRule ^index\.php$ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
You can find additional information in the Woocommerce guide.
Parameters supported in the product.add method for Amazon SP-API
asin, ean, gtin, upc parameters are identifiers that identify a product in the Amazon catalog. Every product that is in the Amazon catalog has a unique asin.
To add a product that already exists in the Amazon catalog, you only need to provide the SKU, the product identifier, and the price and quantity. The quantity can be zero. Only integer values are supported. After a while, the product will appear in the seller's catalog and will have the properties of the product that was assigned to the identifier (name, description, attributes, images, etc.) as well as the seller's offer (offer), which is determined by the price and quantity.
Adding a new product that does not exist in the Amazon catalog is a more complex process, as Amazon requires filling out a large number of attributes to create a new product with an indication of the category in which the product will be placed.
Therefore, when creating a product through product.add, if the product identifier that does not yet exist in the Amazon catalog is specified, one of the parameters must be specified: category_id or product_type
To work with Amazon categories, we have added support for the category.count\list\info\find methods.
In the response of the category.list\info methods, the product_types field is displayed in additional_fields. If it contains any data, the ID of this category can be passed in the category_id parameter. Instead of the category_id parameter, you can use the product_type parameter, specifying the value of the additional_fields.product_types field (if the additional_fields.product_types field contains several values, separated by commas, then one of them).
Once one of the category_id or product_type parameters has been defined, you need to pass the attributes of the new product that is being created in the Amazon catalog. For a list of mandatory requirements for a certain product type (product_type) in Amazon, there is a JSON-schema. This JSON-schema is displayed in the category.info method in the additional_fields.category_options field (category.list this field is not displayed to save requests to Amazon).
As you can see from the image, the additional_fields.category_options object contains a WASHER object with the corresponding JSON-schema. If additional_fields.product_types contains multiple values, then JSON-schemas for all product types will be displayed.
The data from the JSON-schema fields is passed in the marketplace_item_properties parameter. This parameter is validated both on the Api2Cart side
and on the Amazon side.
The corresponding errors that will be displayed in an unsuccessful attempt of the product.add method.
If all the required properties for a certain product type are passed, the product will be created in the Amazon catalog.
Even if we received a response with return_code: 0 for the product.add method on Amazon SP-API, this does not mean that Amazon will immediately place the product in its catalog and the seller's catalog among its offers. This product may require additional adjustments in the seller's admin panel. Such products are located in the Catalog > Complete Your Drafts menu section.
which will contain product drafts and Amazon's appropriate troubleshooting guidelines for their listing of these products.
In order to see all additional parameters that are unique for your shopping cart, call product.list API method with the params=force_all
parameter. Or set the necessary fields separated by comma in parameter "params" (params=length,depth
).
In most cases the system automatically defines the prefix of specific shopping cart and uses it. However if you have several shopping carts of one type, the automatic defining will not work. In this case you should use the method account.cart.add and define the prefix of your shopping cart with a parameter db_tables_prefix.
The process of connecting the store to API2Cart depends on the type of shopping cart. There are two major types: Hosted (3dcart, Volusion, Shopify) and Open-source (PrestaShop, WooCommerce, OpenCart, etc.) Get the type of carts here.
For Hosted Carts
You are able to add your stores in 2 ways:
public function apiCreate()
{
$params = array(
'cart_id' => 'BigcommerceApi',
'store_url' => 'https://example.com',
'verify' => 'false',//set this param=false for test only
'store_key' => 'ab37fc230bc5df63a5be1b11220949be',//for self-hosted cart only
'AdminAccount' => 'admin',
'ApiPath' => 'https://example.com/api/v1',
'ApiKey' => '6b89704cd75738cb0f9f6468d5462aba',
);
return $api->request('account.cart.add', $params);
}
Note: Store key is generated automatically for hosted carts (Shopify, Bigcommerce, Volusion, etc.)
For Open-source Carts.
When talking about Open-source platforms, it’s worth mentioning that API2Cart connects to such type of solutions through connection bridge.
You are able to add your stores in 2 ways:
Product API methods allow you to manage products in the store. It is possible to:
Run product.add method, in order to add new products to the store, and provide all necessary parameters.
public function apiAdd($params)
{
$params = array(
'name' => 'Bag',
'model' => 'bag_01',
'description' => 'This is new product',
'price' => 99.9,
'quantity' => 12,
'manufacturer'=> 'Test',
);
return $api->request('product.add', $params);
}
Note: You may add image, tax, manufacturer, option, variant or other info to the product by calling these methods: product.image.add, product.variant.add, product.manufacturer.add, product.tax.add, product.option.add, product.option.value.add, product.option.assign, product.option.value.assign
For more methods jump into documentation.
If you want to update the product, call product.list method to retrieve product id.
public function apiList($params)
{
$params = array(
'start' => 0,
'count' => 50,
'params' => 'id,name,price',
);
return $api->request('product.list', $params);
}
When you get product id, you are able to update price and inventory(quantity) for this product, simply calling product.update method.
public function apiUpdate($params)
{
$params = array(
'id' => 69,
'price' => 89,
);
return $api->request('product.update', $params);
}
Note: You may update variant, image and product option value by calling the following methods: product.variant.update, product.image.update, product.option.value.update
For more API methods visit our documentation.
Order API methods allow you to manage orders in the store. It is possible to:
Run order.add method to add orders to the store, and provide all necessary parameters.
public function apiAdd($params)
{
$params = array(
'customer_email' => '[email protected]',
'order_status' => 'Complete',
'bill_first_name' => 'Adam',
'bill_last_name' => 'Smith',
'bill_address_1' => 'Green str. 35',
'bill_city' => 'Chicago',
'bill_postcode' => '12345',
'bill_state' => 'IL',
'bill_country' => 'US',
'total_price' => '23.56',
'order_item_id_1' => 8,
'order_item_name_1' => 'Bag',
'order_item_model_1' => 'bag_01',
'order_item_price_1' => 89,
'order_item_quantity_1' => 3,
);
return = $api->request('order.add', $params);
}
If you want to update an order, call order.list method to get order id.
public function apiList($params)
{
$params = array(
'start' => 0,
'count' => 5,
'params' => 'id,customer,status'
);
return $api->request('order.list', $params);
}
When you get your order id, you are able to update comment and order status by calling order.update method
public function apiUpdate($params)
{
$params = array(
'order_id' => 11,
'order_status' => 'Pending',
'comment' => 'Order comment'
);
return $api->request('order.update', $params);//returns the number of updated orders
}
Note: You are able to count orders in the store by calling order.count method.
For more methods jump into documentation.
Customer API methods allow you to manage customers in the store. It is possible to:
Run customer.add method, to add customers to the store, and provide all necessary parameters.
public function apiAdd($params)
{
$params = array(
'email' => '[email protected]',
'first_name' => 'John',
'last_name' => 'Smith',
);
return $api->request('customer.add', $params);
}
If you want to update the customer, call customer.list method to retrieve customer id.
public function apiList($params)
{
$params = array(
'start' => 0,
'count' => 5
);
return $api->request('customer.list', $params);
}
When you get your customer id, you are able to perform customer.update method.
public function apiUpdate($params)
{
$params = array(
'id' => 11,
'first_name' => 'Jack',
'last_name' => 'Smith',
);
return $api->request('customer.update', $params);
}
For more methods jump into documentation.
Categories API methods allow you to manage categories in the store. It is possible to:
Run category.add method, to add customers to the store, and provide all necessary parameters.
public function apiAdd($params)
{
$params = array(
'name' => 'Shoes'
);
return $api->request('category.add', $params);
}
If you want to update the category, call category.list method to get category id.
public function apiList($params)
{
$params = array(
'start' => 2,
'count' => 2,
);
return $api->request('category.list', $params);
}
When you get your category id, you are able to perform category.update method.
public function apiUpdate($params)
{
$params = array(
'id' => 20,
'avail' => 'false',
'meta_title' => 'meta title for category'
);
return $api->request('category.update', $params);
}
If you want to assign your product to some category, simply call product.list method and category.list method to get product id and category id.
After that, run category.assign method.
public function apiAssign($params)
{
$params = array(
'product_id' => 69,
'category_id' => 20,
);
return $api->request('category.assign', $params);
}
For more methods jump into documentation.
When signing up for API2Cart account, you are asked to provide name, e-mail address, password.
When adding a new store, you are asked to provide API key and store URLs. You may also be asked to provide your direct database connection to speed up the process. We take appropriate security measures to protect your information. Find out more about our Privacy Policy.
See the full list below (in alphabetic order):
3dcart | API Key |
Amazon | MWS Auth Token, Seller ID, Marketplace IDs, Secret Key, Access Key ID |
AceShop | Bridge files uploaded to store folder |
AspDotNetStorefront | Admin User and Password |
Bigcommerce | Client ID, Access Token, Context |
CS-Cart | Bridge files uploaded to store folder / plugin |
CubeCart | Bridge files uploaded to store folder |
Demandware | API Client ID, API Password, User Name, User Password, Environment Type |
Ebay | App ID, Shared Secret, Refreshed Token, Environment, Global ID |
Ecwid | Store ID, Access Token |
Etsy | KeyString, Shared Secret, Access Token, Secret Token |
Gambio | Bridge files uploaded to store folder |
Hybris | Client ID, Client Secret, User Name, User Password |
Interspire | Bridge files uploaded to store folder |
JooCart | Bridge files uploaded to store folder |
LightSpeed eCommerce | API Key, API Secret |
Loaded Commerce | Bridge files uploaded to store folder |
Magento | Bridge files uploaded to store folder / plugin |
MijoShop | Bridge files uploaded to store folder |
Neto | API Key, User Name |
OpenCart | Bridge files uploaded to store folder |
osCMax | Bridge files uploaded to store folder |
osCommerce | Bridge files uploaded to store folder |
Oxid | Bridge files uploaded to store folder |
Pinnacle Cart | Bridge files uploaded to store folder |
PrestaShop | Bridge files uploaded to store folder / plugin |
Shop-Script Premium | Bridge files uploaded to store folder |
Shopify | API Key, API Password, Access Token, Shared Secret |
Shopware | Bridge files uploaded to store folder |
Squarespace | API Key |
TomatoCart | Bridge files uploaded to store folder |
Ubercart | Bridge files uploaded to store folder |
VirtueMart | Bridge files uploaded to store folder |
Volusion | Login and API Password |
Walmart | Client ID, Client Secret |
WooCommerce | Bridge files uploaded to store folder / plugin |
WebAsyst Shop-Script | Bridge files uploaded to store folder |
WPEcommerce | Bridge files uploaded to store folder |
XCart | Bridge files uploaded to store folder |
Xtcommerce | Bridge files uploaded to store folder |
Xtcommerce Veyton | Bridge files uploaded to store folder |
Zencart | Bridge files uploaded to store folder |
For more information about how to get your API Key/Token follow this link.
Discover how API2Cart can ease your eCommerce integrations with a personalized demo. See how seamlessly our solution can connect your software with over 40 eCommerce platforms.
Don't miss out! This is an exclusive one-time offer. Secure your additional trial period by booking your demo now.