Amazon Business API sandbox
The Amazon Business API provides a static sandbox environment that allows you, Amazon Business developers, to test your applications without affecting production data. The static sandbox uses pattern matching to return static, mocked responses when the required parameters are present in the API request. Unlike a production API call, a sandbox API call does not trigger any real-world events.
You can call the sandbox API endpoints as soon as you’ve created a Solution Provider Portal (SPP) account and while you’re waiting for developer profile approval. By using the sandbox, you can explore API usage and begin crafting the code you will use to build your integration.
The following Amazon Business APIs currently support the static sandbox:
Accessing the Amazon Business API sandbox environment
Prerequisites
Before accessing the sandbox environment, make sure you have:
- An Amazon Business account
- An SPP account
To create an Amazon Business and SPP account, complete steps 1 and 2 of Onboarding Step 1: Register as a developer.
Step 1. Create sandbox app client

- Complete Onboarding Step 2: Create app client in SPP and select Sandbox for App Type.

- Select View sandbox credentials. Your client ID and client secret credentials appear. You’ll need these details to generate an API access token.
Step 2. Generate sandbox refresh token
- Visit SPP.

- In the Action column for your sandbox app client, select Create token from the list.

- Select Create token. The new sandbox refresh token displays. You’ll need this token to generate an API access token.
Step 3. Generate access token
- In the terminal of your choice, use this Login With Amazon (LWA) cURL command to retrieve the access token for calling the sandbox API. In the cURL command, add the sandbox refresh token from Step 2 and the client ID and client shared secret from Step 1.
curl -k -X POST -H 'Content-Type: application/x-www-form-urlencoded' -d 'grant_type=refresh_token&refresh_token=sandbox_refresh_token_from_step2&client_id=clientid_from_step1&client_secret=secret_from_step1' 'https://api.amazon.com/auth/O2/token'
- This command returns a response in JSON format. Use the
access_token
to call static sandbox APIs.
{
"access_token": "Atza|IwEBIAKwOSmd0nO9ppdBXPU9TS2PUUEEIi4usMSH3J0BrEsJ0vZcpnRH9WnM7HD6N6DmxyimyGLo0jj7jTarXnV3OqnSfCtG8T7zBDy7qJSpfcUreEjmv2UYlNIi4Id0_88TkyWhmqessiBX_H_JobMWK9EaUJPY06NLfiiZmYWwy3wCLmxlEDOxmJhgZv1ORlDu-LKsZNN7iO_kR_cWSLXux2WITan_9VcP4BrEYCio1ZiEylSus1KYq4wnGoD5meESZVf1G1XNrgcu41fe5bx9ifW81Y6Q4uGJANGYYb9yFsVJc7L7J8Xt_9NXX779axj9Td1xRwJJ-mXxj9rc3ZsOz6Vi",
"refresh_token": "Atzr|IwABICB2BIhMNgyTBE9lPOInsQFY9OaKnvy771vKwuUejCZr-MtDmUbDxPJ_ji-LBV40H4O6kfMtc1iO4EY9ECN9Esp-LzHl-CGExQ5hAXxrNGK9JOqeNMPpBOz_W4EGZyjsclo6AaGzIDCqvAP8DD6l-GdAWhMnubUzQXSJlCrjfmSJT6KTcCdsBDUTzQTTDmXTDKKg0g6sET_SgD8c9cCpmlEuiPqRerdYgNTVdgoLVwd0yDouC7VQb9hvBDgYm3bpA5GVSDPc1gbgzLHUYKbDlRRKpC2l7cULWh_FFshM_jll_Q_4CzqMz_YnM_B0txkQRhY",
"token_type": "bearer",
"expires_in": 3600
}
One-hour validity
The sandbox access token is valid only for one hour. The LWA Authorization Server returns the sandbox refresh token. Save the sandbox refresh token to generate access tokens for subsequent Amazon Business API calls. Use the same access token for multiple API calls until it expires.
Making sandbox API calls
Once you have generated a sandbox API access token, you can make calls to the sandbox API. Making calls to the Amazon Business API static sandbox is identical to making production calls, except you direct the calls to the Amazon Business API sandbox endpoints and provide the required sandbox parameters in the request.
Follow these steps to call the sandbox API:
- View the sandbox guide for the API you want to call to view the required sandbox request parameters:
- Direct your calls to the appropriate Amazon Business API sandbox endpoint for your region.
Amazon Business API sandbox endpoints
Amazon Business marketplaces | Endpoint |
---|---|
North America (Canada and US) | https://sandbox.na.business-api.amazon.com |
Europe (Spain, UK, France, Germany, Italy) | https://sandbox.eu.business-api.amazon.com |
Far East (Japan) | https://sandbox.jp.business-api.amazon.com |
Updated 2 months ago