How to connect AmeriCommerce to API2Cart?
This guide will show how to connect the AmeriCommerce platform to API2Cart. You need to log in to your AmeriCommerce store (or register). You can also create a 14-day trial store.
Creating a New App in AmeriCommerce
From the main menu, go to Tools → Apps & Addons and select API Token Manager:
Next, click the button to add a new app:
Set the app name and description:
Authorization Types
AmeriCommerce supports two types of authorization:
- Single Token Flow — generates a non-expiring
access_token. - OAuth2 Flow — the token is obtained via OAuth authorization. Authentication Documentation
1. Simple Authorization (Single Token Flow)
Step 1: Choose Single Token Flow
Step 2: Select Scopes
It is recommended to select all available scopes, or at least those required for your integration. The system scope is mandatory as API2Cart needs store information. It is also recommended to select settings — provides warehouse, shipping, payment, and delivery method data.
Step 3: Get Access Token
After saving, you will immediately receive an Access Token:
Step 4: Using the Token in API2Cart
This token should be used in Credential Set 1:
- americommerce_access_token — the obtained Access Token
2. Authorization via OAuth2 Flow
OAuth2 Flow works by redirecting the user to a confirmation page where the store grants API access to your app.
Step 1: Choose OAuth2 Flow
Step 2: Get Client ID and Client Secret
Step 3: Form OAuth Authorization Link
https://[store].americommerce.com/api/oauth?client_id=[client_id]&scope=people,orders,catalog,content,marketing,system,settings&redirect_uri=[redirect_url]
Where:
- [store] — your store domain
- [client_id] — your app’s Client ID
- [redirect_url] — URL where AmeriCommerce will return
codeandauth_id - scope — the scopes granted for access
Available scopes are described here: Scopes Documentation
Step 4: Confirm Access
Step 5: Get code and auth_id at the redirect URL
Step 6: Generate Signature
Example PHP code:
$appSecret = "APP_SECRET";
$appId = "APP_ID";
$code = "OAUTH_CODE";
$scope = "people,orders,catalog,content,marketing,system,settings";
$redirectUri = "https://example.com/callback/";
$data = $appSecret . $code . $appId . $scope . $redirectUri;
$signature = hash('sha256', $data);
echo "Signature: " . $signature;
Note:
- The redirect_url must end with a slash /.
- Use the same scopes selected during app authorization.
Step 7: Obtain access_token via API
Execute the request:
curl --location 'https://yourstore.americommerce.com/api/oauth/access_token' \
--data-urlencode 'client_id=APP_ID' \
--data-urlencode 'auth_id=AUTH_ID' \
--data-urlencode 'signature=GENERATED_SIGNATURE'
Step 8: Using refresh_token in API2Cart
If the signature is generated correctly, the response will return a refresh_token.
It should be used in Credential Set 0:
- americommerce_app_id — your app’s App ID
- americommerce_app_secret — your app’s Client Secret
- americommerce_refresh_token — obtained refresh_token
After this, your AmeriCommerce store will be successfully connected to API2Cart.
Table of Required AmeriCommerce App Scopes for our API Methods:
| Method | Scopes |
|---|---|
| account.cart.add | system |
| account.config.update | system |
| cart.validate | system |
| cart.delete | system |
| cart.info | system, settings |
| product.list | read_catalog |
| product.count | read_catalog |
| product.info | read_catalog |
| product.child_item.list | read_catalog |
| product.child_item.info | read_catalog |
| product.add | catalog |
| product.update | catalog |
| product.delete | catalog |
| product.image.add | catalog, system (upload) |
| product.image.update | catalog |
| product.image.delete | catalog |
| product.brand.list | read_catalog |
| product.variant.add | catalog |
| product.variant.update | catalog |
| product.variant.delete | catalog |
| category.list | read_catalog |
| category.count | read_catalog |
| category.info | read_catalog |
| order.count | read_orders |
| order.list | read_orders |
| order.info | read_orders |
| order.status.list | read_orders |
| order.shipment.list | read_orders |
| order.shipment.info | read_orders |
| order.shipment.add | orders |
| order.shipment.update | orders |
| order.shipment.delete | orders |
| order.add | orders |
| order.update | orders |
| customer.list | read_people |
| customer.count | read_people |
| customer.info | read_people |
| customer.add | people |
| customer.update | people |
| customer.address.add | people |
| customer.delete | people |