Authentication

API2Cart allows to work with shopping carts through two types of authentication, Basic access authentication and OAuth.

Basic access authentication requires passing a username and password when making a request. To see what other credentials you might need to add a store depending on the shopping cart, visit our FAQ.

OAuth does not require username/password details but wants access tokens instead. It is currently supported for Bigcommerce and Shopify only.

For Bigcommerce, you need to specify the accessToken that you can get in the store, client_id and the context. Here is an example request:
http://api.api2cart.com/v1.1/account.cart.add.json?cart_id=BigcommerceApi&store_url=https://store-hwd69x9.mybigcommerce.com/&api_key=1111&context=stores/hwd69x9&accessToken=d4dc123qdasd1pdasdd7&client_id=1fdc123qwesd1pdasd31

Note
Customers, who already work with Bigcommerce may now get the following message "X-Auth-Client and X-Auth-Token headers are required" with the code"107". In that case, you need to do either of the following:
  • Use account.config.update method, specifying the client ID of the requesting app in the _client_id_ parameter.
  • Re-add Bigcommerce to your account, using account.cart.add method.

For Shopify, you need to specify only the accessToken (API token) generated in the store. Here is an example request:
http://api.api2cart.com/v1.1/account.cart.add.json?cart_id=Shopify&store_url=https://nztest.myshopify.com&api_key=1111&accessToken=5f51d1e784wqeabc15e32qe