@lorenstuff/amazon-selling-partner-api
Version:
A package for interacting with the Amazon Selling Partner API.
27 lines • 967 B
JavaScript
//
// Imports
//
import { AmazonSellingPartnerAPIError } from "./AmazonSellingPartnerAPIError.js";
//
// Class
//
/** A client for v2021-03-01 of the Tokens endpoints of the Amazon Selling Partner API. */
export class AmazonSellingPartnerTokensAPIClient {
amazonSellingPartnerApiClient;
constructor(amazonSellingPartnerApiClient) {
this.amazonSellingPartnerApiClient = amazonSellingPartnerApiClient;
}
async createRestrictedDataToken(body) {
const response = await this.amazonSellingPartnerApiClient.request({
method: "POST",
path: "/tokens/2021-03-01/restrictedDataToken",
body: JSON.stringify(body),
});
const responseData = await response.json();
if ("errors" in responseData) {
throw new AmazonSellingPartnerAPIError(response, responseData.errors);
}
return responseData;
}
}
//# sourceMappingURL=AmazonSellingPartnerTokensAPIClient.js.map