Skip to main content

How to Get Amazon SP-API client_id, client_secret, and refresh_token

Subject: How to Get Amazon SP-API client_id, client_secret, and refresh_token

Step 1: Login and Start App Registration

  • Go to: https://sellercentral.amazon.com.mx
  • Login with your developer/seller account.
  • Navigate to: Apps & Services → Develop Apps → Add new app client . this will redirect you to https://solutionproviderportal.amazon.com/

Step 2: Fill App Information

  • App Name: MagB1 App
  • API Type: SP API
  • Business Entities: Sellers (checked)
  • Roles:
    • Pricing (checked)
    • Amazon Fulfillment (checked)
    • Product Listing (checked)
  • Restricted Data Token:
    • Yes, I will delegate access to another developer's application (selected)
    • Professional Services (checked)
    • Direct-to-Consumer Shipping (checked)
    • Tax Remittance (checked)
    • Tax Invoicing (checked)

Click "Save and exit".

Step 3: View LWA Credentials

  • Go back to the app list under Develop Apps.
  • Under the "LWA credentials" column, click "View".
  • Copy the values for:
    • client_id
    • client_secret
    • Redirect URI

Step 4: Authorize the App to Get the Refresh Token

  • In the app list, click the dropdown next to "Edit App" and choose "Authorize".
  • Login again and approve the permissions.
  • You will be redirected to your Redirect URI with a code like: 
    ?spapi_oauth_code=your_code_here&state=xyz
  • Copy the spapi_oauth_code value.

Step 5: Use Refresh Token to Get New Access Tokens

To refresh the access token:

POST to: https://api.amazon.com/auth/o2/token

With this body:

{
  "grant_type": "refresh_token",
  "refresh_token": "YOUR_REFRESH_TOKEN",
  "client_id": "YOUR_CLIENT_ID",
  "client_secret": "YOUR_CLIENT_SECRET"
}
  

Tags