Got questions? Leave your message here or Schedule a quick call with our manager now

How to connect Amazon SP-API to API2Cart?

In order to connect Amazon SP-API to API2Cart account, you need to fill out the credentials, which is shown in the screenshot below: Amazon SP API credentials The seller account that is planned to be connected to API2Cart must have an active "Professional" selling plan at Amazon.

We recommend reading the original guide from the Amazon Selling Partner API Developer Guide.

1. amazon_seller_id - can be seen in Sellercentral -> Settings -> Account Info -> Business Information -> Merchant Token. Direct link: https://sellercentral.amazon.com/sw/AccountInfo/MerchantToken/step/MerchantToken How to connect Amazon SP-API to API2Cart? 2. In order to make calls to the Amazon SP API, you must have an AWS account. If you do not have it, then you can register it here - AWS Free Tier. If you already have an AWS account, you can proceed to the stage of obtaining the following credentials:

  • amazon_sp_aws_user_key_id
  • amazon_sp_aws_user_secret
  • amazon_sp_aws_region
  • amazon_sp_aws_role_arn
3. Create an IAM user Go to https://console.aws.amazon.com/iam/home#/users and follow the steps as shown below: Add new user Specify user details Permissions tab Review and create tab

Click on the newly created user.

Users grid Create access key Access key best practices tab Optional description Save access keys 4. Create an IAM policy Create policy Select the JSON tab, and insert the following code:
{
   "Version":"2012-10-17",
   "Statement":[
      {
         "Effect":"Allow",
         "Action":"execute-api:Invoke",
         "Resource":"arn:aws:execute-api:*:*:*"
      }
   ]
}
Create policy Review and create 5. Create an IAM role

Go to https://console.aws.amazon.com/iam/home#/roles

Create role Select trusted entity Select the policy Enter a role name

Open the newly created role and save Role ARN.

Copy the role ARN 6. Add an AWS Security Token Service policy to your IAM user

Go to https://console.aws.amazon.com/iam/home#/users

Select the user Create inline policy Create STS policy step 0 Create STS policy step 1 Create STS policy step 2 Create STS policy step 3 7. To determine which value should be substituted into amazon_sp_aws_region you need to use the table Selling Partner API endpoints.
Selling region Endpoint AWS Region
North America (Canada, US, Mexico, and Brazil marketplaces) https://sellingpartnerapi-na.amazon.com us-east-1
Europe (Spain, UK, France, Netherlands, Germany, Italy, Sweden, Poland, Turkey, U.A.E, and India marketplaces) https://sellingpartnerapi-eu.amazon.com eu-west-1
Far East (Singapore, Australia, and Japan marketplaces) https://sellingpartnerapi-fe.amazon.com us-west-2
For example, if the seller sells in the US, you must select us-east-1.

8. To get amazon_sp_client_id and amazon_sp_client_secret you need to go to an Amazon seller account registered as a developer. If there is no such an account, you have to register a seller account, and then register in it as a developer here - Register as a developer.

Go to Developer Central and add a new client.

Develop Apps Add new client create APP

Click “View” to see amazon_sp_client_id and amazon_sp_client_secret.

Save credentials

Please note that the lifetime of amazon_sp_client_id and amazon_sp_client_secret credentials is limited to 180 days. Therefore, you should periodically update them in the "Amazon developer console" and then in our system using the account.config.update method.

9. To get the last parameter - amazon_sp_refresh_token you need to implement OAuth authentication in one of the following ways:
  1. Website workflow
  2. Marketplace Appstore workflow
  3. Self authorization

Let's consider the 3rd way, it is the most convenient when you need to quickly get an amazon_sp_refresh_token to test the work.

Autorize app Copy the refresh token 10. Now, when you have all the necessary credentials, you can add a store in API2Cart. Add store form Important details:
  • Amazon restricts API access to personally identifiable information (PII), such as addresses in orders. If your app requires this data, you need to get access to it. To do this, you need to select the “Direct-to-Consumer Shipping” role and fill out the application form on Amazon Developer Profile https://sellercentral.amazon.com/developer/register

  • We do not have our app with access to personal data, and we do not plan to do so because, in this case, we would be forced to place our app on the Amazon marketplace. That will cause a white label will be impossible, and sellers must install the API2Cart app instead of your app.

  • Sometimes you may get the API2Cart response with an error "Report is not ready yet, please try again later (report_request_id=XXXXXXXXXXXX)". This is because the Amazon API, in many cases, does not provide real-time data, so API2Cart is forced to work through the Reports API. For example, when requesting "product.list" or "product.info", API2Cart requests a report and waits for its result, the maximum waiting time is 15 seconds, and if the report information is not ready during this time, the above error text will be returned. When receiving this error, you need to wait 1-5 minutes and try to repeat the request with the same parameters. Reports are cached on our side for 15 minutes. If you pass the parameter disable_report_cache=true, the cache is not used.

Posted in: Getting Started