Your browser is out-of-date!

Update your browser to view this website correctly

×

Getting Started

How do I connect AspDotNetStorefront to API2Cart?

You need to specify store admin username and password, no API key is required.

How to connect Demandware to API2Cart?

First, go to the Account Manager page (https://account.demandware.com/dw/account/Home), generate dw_client_id (Client Id) and dw_api_pass (Api Password).   Then, add permissions for API2Cart API, so that our API could retrieve data from the store. Go to your Admin panel: Administration > Open Commerce API Setting > Select type: Shop & Data > Select context: Global Then, specify client application-specific configurations:            
For Type Shop:Global permissions
{
  "_v":"17.4",
  "clients":[
     {
        "client_id":"YOUR_CLIENT_ID",
        "allowed_origins": [

        ],
        "resources":[
           {
              "resource_id":"http://beta-public.api2cart.com/products/*/prices",
              "methods":["get"],
              "read_attributes":"(**)",
              "write_attributes":"(**)",
              "config":{
                 "product.prices.price_book_ids":"PRICE_BOOK_ID_1,PRICE_BOOK_ID_2,...,PRICE_BOOK_ID_N"
              }
           },
           {
              "resource_id":"http://beta-public.api2cart.com/**",
              "methods":[
                 "put",
                 "get",
                 "post",
                 "patch"
              ],
              "read_attributes":"(**)",
              "write_attributes":"(**)"
           }
        ]
     }
  ]
}
Or per resource permissions
{
  "_v": "17.4",
  "clients": [
    {
      "client_id": "YOUR_CLIENT_ID",
      "allowed_origins": [
        
      ],
      "resources": [
        {
          "resource_id":"http://beta-public.api2cart.com/baskets",
          "methods":["post"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/baskets/*",
          "methods":["get","patch","delete"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/baskets/*/billing_address",
          "methods":["put"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/baskets/*/coupons",
          "methods":["post"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/baskets/*/coupons/*",
          "methods":["delete"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/baskets/*/customer",
          "methods":["put"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/baskets/*/gift_certificate_items",
          "methods":["post"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/baskets/*/items",
          "methods":["post"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/baskets/*/items/*",
          "methods":["patch","delete"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/baskets/*/notes",
          "methods":["post","get"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/baskets/*/payment_instruments",
          "methods":["post"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/baskets/*/payment_instruments/*",
          "methods":["patch","delete"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/baskets/*/payment_methods",
          "methods":["get"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/baskets/*/shipments",
          "methods":["post"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/baskets/*/shipments/*",
          "methods":["patch"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/baskets/*/shipments/*/shipping_address",
          "methods":["put"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/baskets/*/shipments/*/shipping_method",
          "methods":["put"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/baskets/*/shipments/*/shipping_methods",
          "methods":["get"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/baskets/*/submit",
          "methods":["post"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/customers",
          "methods":["post"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/customers/auth",
          "methods":["post"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/customers/password_reset",
          "methods":["post"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/customers/*",
          "methods":["get","patch"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/customers/*/addresses",
          "methods":["get","post"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/customers/*/addresses/*",
          "methods":["get","patch","delete"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/customers/*/baskets",
          "methods":["get"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/customers/*/orders",
          "methods":["get"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/customers/*/password",
          "methods":["put"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/customers/*/payment_instruments",
          "methods":["get","post"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/customers/*/payment_instruments/*",
          "methods":["get","delete"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/orders",
          "methods":["post"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/orders/*",
          "methods":["get","patch"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/orders/*/notes",
          "methods":["get","post"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/orders/*/payment_methods",
          "methods":["get"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/orders/*/payment_instruments",
          "methods":["post"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/order_search",
          "methods":["post"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/products/*",
          "methods":["get"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
           "resource_id": "http://beta-public.api2cart.com/products/*/availability",
           "methods": ["get"],
           "read_attributes": "(**)",
           "write_attributes": "(**)",
           "cache_time": 0
        },
        {
           "resource_id": "http://beta-public.api2cart.com/products/*/prices",
           "methods": ["get"],
           "read_attributes": "(**)",
           "write_attributes": "(**)",
           "cache_time": 0
        },
        {
          "resource_id":"http://beta-public.api2cart.com/site",
          "methods":["get"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        },
        {
          "resource_id":"http://beta-public.api2cart.com/categories/*",
          "methods":["get"],
          "read_attributes":"(**)",
          "write_attributes":"(**)"
        }
      ]
    }
  ]
}
                           
For Type DataGlobal permissions
{
  "_v":"17.4",
  "clients":[
     {
        "client_id":"YOUR_CLIENT_ID",
        "resources":[
           {
              "resource_id":"http://beta-public.api2cart.com/**",
              "methods":[
                 "put",
                 "get",
                 "post",
                 "patch"
              ],
              "read_attributes":"(**)",
              "write_attributes":"(**)"
           }
        ]
     }
  ]
}
Or per resource permissions
{
  "_v": "17.4",
  "clients": [
    {
      "client_id": "YOUR_CLIENT_ID",
      "resources": [
        {
          "resource_id": "http://beta-public.api2cart.com/sites",
          "methods": [
            "get"
          ],
          "read_attributes": "(**)",
          "write_attributes": "(**)"
        },
        {
          "resource_id": "http://beta-public.api2cart.com/sites/**",
          "methods": [
            "get"
          ],
          "read_attributes": "(**)",
          "write_attributes": "(**)"
        },
        {
          "resource_id": "http://beta-public.api2cart.com/catalog_search",
          "methods": [
            "post"
          ],
          "read_attributes": "(**)",
          "write_attributes": "(**)"
        },
        {
          "resource_id": "http://beta-public.api2cart.com/product_search",
          "methods": [
            "post"
          ],
          "read_attributes": "(**)",
          "write_attributes": "(**)"
        },
        {
          "resource_id": "http://beta-public.api2cart.com/products/*",
          "methods": [
            "get",
            "patch"
          ],
          "read_attributes": "(**)",
          "write_attributes": "(**)"
        },
        {
          "resource_id": "http://beta-public.api2cart.com/products/*/variant_search",
          "methods": [
            "post"
          ],
          "read_attributes": "(**)",
          "write_attributes": "(**)"
        },
        {
          "resource_id": "http://beta-public.api2cart.com/products/*/variations",
          "methods": [
            "get"
          ],
          "read_attributes": "(**)",
          "write_attributes": "(**)"
        },
        {
          "resource_id": "http://beta-public.api2cart.com/products/*/variation_attributes",
          "methods": [
            "get"
          ],
          "read_attributes": "(**)",
          "write_attributes": "(**)"
        },
        {
          "resource_id": "http://beta-public.api2cart.com/customer_lists/**",
          "methods": [
            "get",
            "post"
          ],
          "read_attributes": "(**)",
          "write_attributes": "(**)"
        },
        {
          "resource_id": "http://beta-public.api2cart.com/inventory_lists/*",
          "methods": ["patch"],
          "read_attributes": "(**)",
          "write_attributes": "(**)"
        },
        {
          "resource_id": "http://beta-public.api2cart.com/inventory_lists/*/product_inventory_records/*",
          "methods": ["patch", "put", "get"],
          "read_attributes": "(**)",
          "write_attributes": "(**)"
        },
        {
           "resource_id":"http://beta-public.api2cart.com/system_object_definitions/**",
           "methods":["get", "put" , "patch", "post", "delete"],
           "read_attributes":"(**)",
           "write_attributes":"(**)"
        }
      ]
    }
  ]
}
             

How to Install the API2Cart Plugin on different shopping platforms?

WooCommerce Plugin Installation

To add a plugin or an extension on WooCommerce:
  1. Go to your admin panel and click on ‘Plugins” menu -> "Add New"
  2. Choose API2Cart Connector and click “Install Now” button.
  3. After downloading the plugin, click “Activate Plugin” to get it rolling.
The plugin tab should now appear on your admin panel.

Magento Plugin Installation

API2Cart Magento connector belongs to community extensions that means it is free to install. To perform the installation:
  1. Find the API2Cart Connector on Magento Connect and click “Install Now” button.
  2. Check the license agreement box and click “Get Extension Key”.
  3. Copy the “Extension Key” and go to your Magento admin panel.
  4. Navigate to System -> Magento Connect -> Magento Connect Manager.
  5. Enter your Magento credentials (the same you use to access your admin panel) once again.
  6. Enter your “Extension Key” into an appropriate field and click “Install”
  7. After the extension is found - click “Proceed” button.
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.

PrestaShop Plugin Installation

To perform the installation:
  1. Login into your Prestashop admin panel.
  2. Go to the module tab and click “Add a module from my computer”
  3. In “Module file” box click “Browse” button.
  4. Select module *.zip file from your computer.
  5. Complete the process by pressing “Upload this module” button.
The page will reload, and you should see the new module in a list of your modules.

Cs-Cart Plugin Installation

To perform the installation:
  1. Login into your Cs-Cart admin panel.
  2. Click on the navigation "Add-ons" -> "Manage Add-ons".
  3. Click on the "+" button to upload the plugin.
  4. In the dialog box that appears, click on the "Local" option to download the plug-in *.zip file
  5. Click the "Upload & install" to upload the installation.
After a successful installation, in the "Add-ons" page you will see the API2Cart plugin.
Note: After any of these plugins is successfully installed, the store owner needs to give the information on his unique store key to B2B provider for the proper work through the API.

How to connect Ebay to API2Cart?

To connect your eBay account to API2Cart, send cart.create request using POST method (!) from your API2Cart account. This request should contain the following parameters:

  • api_key = YOUR_API_KEY
  • cart_id = EBay
  • verify = true
  • ebay_client_id
  • ebay_client_secret
  • ebay_runame
  • ebay_access_token
  • ebay_refresh_token
  • ebay_site_id
  • ebay_environment = production

FAQ how to add eBay store

How to get parameters marked in red above:

  • ebay_client_id - App ID
  • ebay_client_secret - Cart ID

Go to the eBay developers program page https://developer.ebay.com/my/auth/

Log in to your account or register one. After the successful authentication, you will land on Application Keys page, which looks like this:

 

On the screenshot above we’ve highlighted the keys needed to connect your eBay account to API2Cart: ebay_client_id and ebay_client_secret.

3) ebay_runame:

Go to the User Tokens page: https://developer.ebay.com/my/auth.

   

To get RuName, go to User Tokens tab-> Get a Token from eBay via Your Application -> press Add eBay Redirect URL - there will appear a setting page -> tick the box under OAuth Enabled -> get your parameter RuName (eBay Redirect URL name).

 

4) ebay_access_token:

5) ebay_refresh_token:

On the same page (User Tokens) set up Sign-in settings.

1) 2) Switch on OAuth:

3) Your auth accepted URL - here specify a URL link on which you’ll get the code, which is a very important parameter.

4) Save settings.

Click the link in the field: Your branded eBay Sandbox Sign In (OAuth) - copy this big URL link and paste it into the address bar. There you will see the following page:

   

Sign in to your account, then go to page Grant application access to Token Name: press Agree, then you will be redirected to the page you’ve specified in the field Your auth accepted URL. On that page you will receive data in the following format:

state:null

code:v^1.1#i^1#r^1#p^3#f^0#I^3#t^Ul41Xzg6MDM5RENGM0E3NEIxNTJDQkU5QjQxMDA2MjA5NjRBOTRfMV8xI0VeMTI4NA==


And the last step, use “code” to get access_token and refresh_token.You can do this via POSTMAN.


Send POST request to this link https://api.ebay.com/identity/v1/oauth2/token, specify in Body parameters grant_type, code and redirect_uri, like we did on the screenshot below. Make sure "code" parameter value is not url encoded before passing it as a request parameter



On the Authorization tab choose Type: Basic Auth, and in fields Username and Password paste you client_id and client_secret, as we did in the screenshot below.

 

6) ebay_site_id:

Each eBay site maps to a unique eBay global ID. You can get it from

https://developer.ebay.com/devzone/merchandising/docs/concepts/siteidtoglobalid.html. If you don't set this parameter, it will be 0 (US) by default.


Congrats!

After you press Send, eBay will give you access_token and refresh_token, which are necessary for connecting your eBay account to API2Cart.

The instruction above is based on official eBay documentation:

https://developer.ebay.com/api-docs/static/oauth-qref-auth-code-grant.html

 

How to upload bridge to Magento Commerce stores?

To upload the bridge to Magento Commerce 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: "http://beta-public.api2cart.com/bridge.php"

index:

bridge.php

expires: -1

scripts: true

allow: true

3) Push changes to the repository and merge them to master.

How to connect Amazon to API2Cart?

0) Note: If you are trying to connect another marketplace (not Amazon.ca, Amazon.com, Amazon.com.mx), you must register your developer:

  • 1. Go to the User Permissions page in Seller Central and log into your Amazon seller account as the primary user.
  • 2. In the Amazon MWS Developer Permissions section, click the Register as a developer button.
  • 3. Fill out the Register as a developer form.

Be sure to click the Verify button to verify email addresses that you enter.

  • 4. Click the Sign up button.
  • 5. Your Developer ID appears.
  • 6. Click Your developer credentials.

Your AWS Access Key ID and Secret Key appear.

 

1) The seller goes to the User Permissions page in Seller Central and logs into their Amazon seller account as the primary user.

 

 

2) The seller clicks the Authorize a developer button. In the Developer name text box, the seller enters the name of the developer that they are authorizing. This doesn't need to be the exact name; it is merely for the seller's reference in the future. Example: API2Cart.

 

3) In the Developer ID text box, the seller enters the Developer ID: 0677-7064-4291 (or your Developer ID obtained in paragraph 0) and then clicks the Authorize developer button.

 

 

4) The seller's MWS Auth Token appears.

 

 

5) Add Amazon store in your API2Cart account. (If you were doing the paragraph 0, you need to insert the last two parameters)

 

How can I get additional field that is not specified in the documentation?

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).

How can I get store key from my shopping cart?

This parameter is generated automatically for hosted carts (Shopify, Bigcommerce, Volusion, etc.). If you are working with self-hosted carts (Magento, WooCommerce, OpenCart, etc.) follow these steps:
  • Call cart_bridge method from which you could get store_key.
  • Call bridge_download method and pass store_key which was generated in cart_bridge.
  • Upload the bridge to the root ftp server folder.
  • Call cart_create method and paste previously generated store_url.
All described above is concerned to manual way of bridge upload.

How do I start using the API2Cart on my site?

To start working with the service you have to register an account, sign in and provide the required information (store’s URL, FTP access) and download bridge. Quick Demo tour will provide you with more detailed information on how to start working with the service.

How to add several stores with different table prefixes on a single database?

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 cart.create and define the prefix of your shopping cart with a parameter db_tables_prefix.

How can I get API Key and Token from my API based shopping cart?

3dcart

You need to retrieve API Key from your 3DCart admin account.
  1. Log in to your admin panel and go to Settings -> General -> Store modules.
  2. Go to section API XML Web Service Integration.
  3. Click on Enable Advanced API if it isn't enabled yet. Then copy API User Key.

Bigcommerce

You need to enable the API for a user and API Key.
  1. Log in to store's admin panel and go to Users section.
  2. Edit user for whom you wish to enable the API.
  3. Scroll down to the bottom of the page, and check the box next to Yes, allow this user to use the API.
  4. After that you will get the API URL and Token for the user.
  5. Save the result.

MobiCart

You need to retrieve API Key from your MobiCart admin account.
  1. Sign in to your MobiCart account.
  2. Go to My Account > Accounts Settings.
  3. Select API tab.
  4. Generate API Key or modify existed.

Shopify

You need to provide an API Password from your Shopify admin account.
  1. Log in your store's admin area and go to Apps Menu. Then, click the Private apps button.
  2. Click on the button in the right top corner Create a private App.
  3. Enter the Title of the app and provide your Contact email (optionally). 
  4. Then, you need to grant the Private app with permissions to enable data interaction with your store. To do this, click on all drop-down menus and change permission status from “No access” to “Read and Write” .
  5. After that, click Save app.
  6. API Password will appear right after you save the app.

Volusion

Volusion requires API Key (URL) and Encrypted Password
  1. Login to the Admin Area of your Volusion store.
  2. Click the Inventory tab followed by the Import/Export link at the top, below the Inventory tab.
  3. In the Other Import/Export Features section, click the Volusion API link.
  4. Click the Instant Help link on the upper right hand corner of the page.
  5. Click the Volusion API Integration Help link at the bottom of the page.
  6. Select to view instructions for Generic Orders and expand the URL with Query Stringsection at the bottom. The Encrypted Password can be found in the URL displayed, between the Encrypted Password= and &API_Name.
Please note, you must have a Volusion Gold plan or higher in order to have API access for your store.

How to connect Bigcommerce to API2Cart?

You need to enable the API for a user and API Key.
  1. Log into the store.
  2. Click Settings.
  3. Select Legacy API Accounts.
  4. Click Create a Legacy API Account.
  5. Type the name of the user in the Username box.
  6. There you will find API Path and API Token boxes.
  7. Click the Save button.

How to connect Shopify to API2Cart?

To connect Shopify to API2Cart you will need to provide an API Password from your Shopify admin account. Here is a step-by-step guidance that will help you to retrieve Shopify API Password by your own.

  1. At first, log in your store's admin area and go to Apps Menu. Then, click the Private apps button.
  2. new-shopify-faq-1-smCreate private app.new-shopify-faq-2-sm
  3. Enter the Title of the app and provide your Contact email (optionally).

    Then, you need to grant the Private app with permissions to enable data interaction with your store. To do this, click on all drop-down menus and change permission status from “No access” to “Read and Write” as illustrated on the screenshot below. After that, click Save app. 2016-07-28 (1)

  4. API Password will appear right after you save the app.

How to connect Volusion to API2Cart?

Volusion requires API Key (URL) and Encrypted Password
  1. Login to the Admin Area of your Volusion store.
  2. Click the Inventory tab followed by the Import/Export link at the top, below the Inventory tab.
  3. Click the Volusion API tab.
  4. Point to Get Help in the top right and click Get help with this page.
  5. Click the Volusion API Integration Help link at the bottom of the page.
  6. Select to view instructions for Generic Orders and expand the URL with Query Stringsection at the bottom. The Encrypted Password can be found in the URL displayed, between the Encrypted Password= and &API_Name.
Please note, you must have a Volusion Gold plan or higher in order to have API access for your store.

How to connect 3dcart to API2Cart?

You need to retrieve API Key from your 3DCart admin account.
  1. Log in to your admin panel and go to Settings -> General -> Store Settings.
  2. Go to the Advanced Settings section located at the far bottom of the page.
  3. Click on Change Settings next to API Settings.
  4. Check Enable API if it isn't enabled yet.
  5. Copy API User Key and save changes.

How to add an online store to API2Cart account?

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:

  1. Through the interface in your account. Simply press ‘Add store button’, paste your store’s URL, select type, valid API key and API password. (Read our FAQ on how to get API Key and Token from your API based shopping cart)
  2. By calling cart.create method.  In order to add store correctly, provide all necessary parameters that are described in documentation.
public function apiCreate()
{
  $params = array(
    'cart_id'      => 'BigcommerceApi',
    'store_url'    => 'http://example.com',
    'verify'       => 'false',//set this param=false for test only
    'store_key'    => 'ab37fc230bc5df63a5be1b11220949be',//for self-hosted cart only
    'AdminAccount' => 'admin',
    'ApiPath'      => 'http://example.com/api/v1',
    'ApiKey'       => '6b89704cd75738cb0f9f6468d5462aba',
  );

  return $api->request('cart.create', $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:

  1. Through the interface in your account. Simply press ‘Add store button’, paste your store’s URL, select type, download bridge and paste it to your store’s root folder via FTP client. (Read our FAQ on what is the connection bridge and why do you need it)
  2. By calling these methods:
  • Call cart.bridge method from which you could get store_key.
  • Call bridge.download method and pass store_key which was generated in cart_bridge.
  • Upload the bridge to the root ftp server folder.
  • Call cart.create method and paste previously generated store_url.

How to work with the products?

Product API methods allow you to manage products in the store. It is possible to:

  • Create - add products
  • Read - retrieve list, info, find
  • Update - update
  • Delete - delete

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.option.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.

How to work with orders?

Order API methods allow you to manage orders in the store. It is possible to:

  • Create - add orders
  • Read - retrieve list, info, find
  • Update - update
  • Delete - delete

Run order.add method to add orders to the store, and provide all necessary parameters.

public function apiAdd($params)
{
  $params = array(
    'customer_email'         => 'mail@gmail.com',
    '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.

How to work with customers?

Customer API methods allow you to manage customers in the store. It is possible to:

  • Create - add customers
  • Read - retrieve list, info, find
  • Update - update
  • Delete - delete

Run customer.add method, to add customers to the store, and provide all necessary parameters.

public function apiAdd($params)
{
  $params = array(
    'email'      => 'mail@mail.com',
    '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.

How to work with categories?

Categories API methods allow you to manage categories in the store. It is possible to:

  • Create - add categories
  • Read - retrieve list, info, find
  • Update - update
  • Delete - delete

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.

What information should I provide to start working with API2Cart?

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.

Where can I get my API key?

API key is a code that consists of 32 characters and is generated by API2Cart for each user individually. In order to get it, you need to register your account first. After that service will automatically provide you with API key. You can find it on the page with your stores list. FAQ  

Why do I need API Key?

API key is a code generated by API2Cart for each user individually. It provides you with access rights on the API. You will use your API key to establish connection between service and stores you are going to work with. Personal API Key helps us to identify users who perform API requests, allows to track and control API usage.

What do I need to connect my store to API2Cart?

In order to integrate your client’s store with your business system via API2Cart you will have to:
    • provide API Key/Token and password if it is a hosted platform
    • or use bridge files to establish connection to other carts.

See the full list below (in alphabetic order):

 
3dcartAPI Key
AmazonMWS Auth Token, Seller ID, Marketplace IDs
AceShopbridge files uploaded to store folder
AspDotNetStorefrontAdmin User and password
BigcommerceAPI Path, User Name and API Key / OAuth
CS-Cartbridge files uploaded to store folder / plugin
CubeCartbridge files uploaded to store folder
DemandwareAPI Client ID
EbayApp ID, Cert ID, RuName, Access Token OAuth Refresh Token
EtsyKeyString, Shared Secret, Access Token, Secret Token
Gambiobridge files uploaded to store folder
InterspireBridge files uploaded to store folder
JooCartBridge files uploaded to store folder
LemonstandBridge files uploaded to store folder
Loaded CommerceBridge files uploaded to store folder
MagentoBridge files uploaded to store folder / plugin
MijoShopBridge files uploaded to store folder
MobiCartUser Name and API Key
OpenCartBridge files uploaded to store folder
osCMaxBridge files uploaded to store folder
osCommerceBridge files uploaded to store folder
OxidBridge files uploaded to store folder
Pinnacle CartBridge files uploaded to store folder
PrestaShopBridge files uploaded to store folder / plugin
Shop-Script PremiumBridge files uploaded to store folder
ShopifyAPI Key and API Password / OAuth
ShopwareBridge files uploaded to store folder
TomatoCartBridge files uploaded to store folder
UbercartBridge files uploaded to store folder
VirtueMartBridge files uploaded to store folder
VolusionLogin and encryptedPassword
WooCommerceBridge files uploaded to store folder / plugin
WebAsyst Shop-ScriptBridge files uploaded to store folder
WPEcommerceBridge files uploaded to store folder
XCartBridge files uploaded to store folder
XtcommerceBridge files uploaded to store folder
Xtcommerce VeytonBridge files uploaded to store folder
ZencartBridge files uploaded to store folder

For more information about how to get your API Key/Token follow this link.

Need help or advice?

Schedule a call