{"id":26718,"library":"amazon-sp-api","title":"Amazon SP-API Client","description":"A comprehensive client library for the Amazon Selling Partner API (SP-API). Current version 1.2.1 provides automatic access token management, rate limiting, report downloading, feed uploading, and full TypeScript support. It replaces the legacy Amazon MWS API with modern authentication and endpoints. The library handles throttling internally and offers sandbox mode for testing. Release cadence is periodic, with breaking changes notable when upgrading from v0.x to v1.x.","status":"active","version":"1.2.1","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/jrl84/amazon-sp-api","tags":["javascript","amazon","sellingpartner","sp","sellercentral","amazon sellingpartner api","amazon sp api","selling partner","amazon sp api client","typescript"],"install":[{"cmd":"npm install amazon-sp-api","lang":"bash","label":"npm"},{"cmd":"yarn add amazon-sp-api","lang":"bash","label":"yarn"},{"cmd":"pnpm add amazon-sp-api","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM default import. Use 'SellingPartner' (note uncommon capitalization) as the constructor.","wrong":"const SellingPartner = require('amazon-sp-api')","symbol":"default","correct":"import SellingPartner from 'amazon-sp-api'"},{"note":"This is a default export, not a named export. Named import will fail.","wrong":"import { SellingPartner } from 'amazon-sp-api'","symbol":"SellingPartner","correct":"import SellingPartner from 'amazon-sp-api'"},{"note":"The main export is the SellingPartner class, not a factory function. Use 'new SellingPartner()'.","wrong":"import { createClient } from 'amazon-sp-api'","symbol":"createClient","correct":"import SellingPartner from 'amazon-sp-api'"}],"quickstart":{"code":"import SellingPartner from 'amazon-sp-api';\n\nconst sp = new SellingPartner({\n  region: 'EU',\n  refreshToken: process.env.REFRESH_TOKEN ?? '',\n  credentials: {\n    SELLING_PARTNER_APP_CLIENT_ID: process.env.CLIENT_ID ?? '',\n    SELLING_PARTNER_APP_CLIENT_SECRET: process.env.CLIENT_SECRET ?? ''\n  }\n});\n\nconst res = await sp.callAPI({\n  operation: 'getMarketplaceParticipations',\n  endpoint: 'sellers'\n});\n\nconsole.log(res);","lang":"typescript","description":"Initializes the client with credentials and region, then calls the getMarketplaceParticipations operation on the Sellers endpoint."},"warnings":[{"fix":"Upgrade to 1.x and update code per the migration guide.","message":"Version 1.x introduces breaking changes from 0.x. See the breaking changes documentation in the GitHub repo.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Migrate from MWS to SP-API.","message":"The legacy MWS API endpoint is replaced by SP-API. Ensure you are using the new Selling Partner API.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Use the correct class name: SellingPartner.","message":"Class name is 'SellingPartner' with uppercase 'P', not 'Sellingpartner' or 'SellingPartnerApi'.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Let the library handle token refresh automatically via refreshToken.","message":"Access tokens are automatically managed; do not manually set access tokens.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Set grantless: true for operations that don't require a refresh token.","message":"Some operations may require grantless access; use the 'grantless' option in callAPI.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Monitor library updates for changes to restore rate functionality.","message":"The 'restore_rate' feature is experimental and may change in future versions.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Enable rate limit retry in config to have the library automatically wait and retry on throttled requests.","message":"Rate limit headers are read automatically; you may still encounter throttling if limits are exceeded.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install amazon-sp-api' and ensure the import statement is correct: import SellingPartner from 'amazon-sp-api'","cause":"Package not installed or import path wrong.","error":"Error: Cannot find module 'amazon-sp-api'"},{"fix":"Use: import SellingPartner from 'amazon-sp-api' (no curly braces)","cause":"Incorrect import: trying to import a named export instead of default.","error":"TypeError: SellingPartner is not a constructor"},{"fix":"Set REFRESH_TOKEN environment variable or pass refreshToken in the config object. For grantless operations, set grantless: true.","cause":"Refresh token not provided in constructor config or environment variable.","error":"Error: Missing required parameter 'refreshToken'"},{"fix":"Use one of: 'NA', 'EU', 'FE' (case-sensitive).","cause":"Region code provided is not valid.","error":"Error: Invalid region. Supported regions: NA, EU, FE"},{"fix":"Check the list of supported endpoints and their exact names. Use the endpoint name as defined by Amazon SP-API, e.g., 'sellers', 'catalogItems'.","cause":"The API endpoint name is misspelled or unsupported.","error":"Error: Endpoint 'xxx' not found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}