messaging-api-v1
With the Messaging API you can build applications that send messages to buyers. You can get a list of message types that are available for an order that you specify, then call an operation that sends a message to the buyer for that order. The Messaging API returns responses that are formed according to the <a href=https://tools.ietf.org/html/draft-kelly-json-hal-08>JSON Hypertext Application Language (HAL) standard.
Installing
yarn add @sp-api-sdk/messaging-api-v1
npm install @sp-api-sdk/messaging-api-v1
Getting Started
import {SellingPartnerApiAuth} from '@sp-api-sdk/auth'
import {MessagingApiClient} from '@sp-api-sdk/messaging-api-v1'
const auth = new SellingPartnerApiAuth({
clientId: '',
clientSecret: '',
refreshToken: '',
secretAccessKey: '',
accessKeyId: '',
region: '',
role: {
arn: '',
}
})
const client = new MessagingApiClient({
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 MessagingApiClient({
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