reports-api-2021-06-30
The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses.
Installing
yarn add @sp-api-sdk/reports-api-2021-06-30
npm install @sp-api-sdk/reports-api-2021-06-30
Getting Started
import {SellingPartnerApiAuth} from '@sp-api-sdk/auth'
import {ReportsApiClient} from '@sp-api-sdk/reports-api-2021-06-30'
const auth = new SellingPartnerApiAuth({
clientId: '',
clientSecret: '',
refreshToken: '',
secretAccessKey: '',
accessKeyId: '',
region: '',
role: {
arn: '',
}
})
const client = new ReportsApiClient({
auth,
region: 'eu'
})
Handle Rate Limiting
If you want to let the SDK retry after each 429 responses, instanciate the client like this:
const client = new ReportsApiClient({
auth,
region: 'eu',
rateLimiting: {
retry: true,
onRetry: (retryInfo) => console.log(retryInfo)
}
})
The SDK gets the rate limits for each routes from the API documentation
API documentation
See here