@scaleleap/selling-partner-api-sdk
Version:
📦 A fully typed TypeScript and Node.js SDK library for Amazon Selling Partner API
207 lines • 16.1 kB
JavaScript
;
/* tslint:disable */
/* eslint-disable */
/**
* The Selling Partner API for Transfers.
* The Selling Partner API for Transfers enables selling partners to retrieve payment methods and initiate payouts for their seller accounts. This API supports the following marketplaces: DE, FR, IT, ES, SE, NL, PL, and BE.
*
* The version of the OpenAPI document: 2024-06-01
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DefaultApi = exports.DefaultApiFactory = exports.DefaultApiFp = exports.DefaultApiAxiosParamCreator = exports.PaymentMethodType = exports.AssignmentType = void 0;
const axios_1 = __importDefault(require("axios"));
// Some imports not used depending on template conditions
// @ts-ignore
const common_1 = require("./common");
// @ts-ignore
const base_1 = require("./base");
/**
* The default payment method type.
* @export
* @enum {string}
*/
var AssignmentType;
(function (AssignmentType) {
AssignmentType["DefaultDepositMethod"] = "DEFAULT_DEPOSIT_METHOD";
})(AssignmentType || (exports.AssignmentType = AssignmentType = {}));
/**
* The type of payment method.
* @export
* @enum {string}
*/
var PaymentMethodType;
(function (PaymentMethodType) {
PaymentMethodType["BankAccount"] = "BANK_ACCOUNT";
PaymentMethodType["Card"] = "CARD";
PaymentMethodType["SellerWallet"] = "SELLER_WALLET";
})(PaymentMethodType || (exports.PaymentMethodType = PaymentMethodType = {}));
/**
* DefaultApi - axios parameter creator
* @export
*/
const DefaultApiAxiosParamCreator = function (configuration) {
return {
/**
* Returns the list of payment methods for the seller, which can be filtered by method type. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | .5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
* @param {string} marketplaceId The identifier of the marketplace from which you want to retrieve payment methods. For the list of possible marketplace identifiers, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
* @param {Array<'BANK_ACCOUNT' | 'CARD' | 'SELLER_WALLET'>} [paymentMethodTypes] A comma-separated list of the payment method types you want to include in the response.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getPaymentMethods: async (marketplaceId, paymentMethodTypes, options = {}) => {
// verify required parameter 'marketplaceId' is not null or undefined
(0, common_1.assertParamExists)('getPaymentMethods', 'marketplaceId', marketplaceId);
const localVarPath = `/finances/transfers/2024-06-01/paymentMethods`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
if (marketplaceId !== undefined) {
localVarQueryParameter['marketplaceId'] = marketplaceId;
}
if (paymentMethodTypes) {
localVarQueryParameter['paymentMethodTypes'] = paymentMethodTypes.join(base_1.COLLECTION_FORMATS.csv);
}
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* Initiates an on-demand payout to the seller\'s default deposit method in Seller Central for the given `marketplaceId` and `accountType`, if eligible. You can only initiate one on-demand payout for each marketplace and account type within a 24-hour period. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.017 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
* @param {InitiatePayoutRequest} body The request body for the `initiatePayout` operation.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
initiatePayout: async (body, options = {}) => {
// verify required parameter 'body' is not null or undefined
(0, common_1.assertParamExists)('initiatePayout', 'body', body);
const localVarPath = `/finances/transfers/2024-06-01/payouts`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
const localVarHeaderParameter = {};
const localVarQueryParameter = {};
localVarHeaderParameter['Content-Type'] = 'application/json';
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration);
return {
url: (0, common_1.toPathString)(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};
exports.DefaultApiAxiosParamCreator = DefaultApiAxiosParamCreator;
/**
* DefaultApi - functional programming interface
* @export
*/
const DefaultApiFp = function (configuration) {
const localVarAxiosParamCreator = (0, exports.DefaultApiAxiosParamCreator)(configuration);
return {
/**
* Returns the list of payment methods for the seller, which can be filtered by method type. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | .5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
* @param {string} marketplaceId The identifier of the marketplace from which you want to retrieve payment methods. For the list of possible marketplace identifiers, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
* @param {Array<'BANK_ACCOUNT' | 'CARD' | 'SELLER_WALLET'>} [paymentMethodTypes] A comma-separated list of the payment method types you want to include in the response.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getPaymentMethods(marketplaceId, paymentMethodTypes, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.getPaymentMethods(marketplaceId, paymentMethodTypes, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
/**
* Initiates an on-demand payout to the seller\'s default deposit method in Seller Central for the given `marketplaceId` and `accountType`, if eligible. You can only initiate one on-demand payout for each marketplace and account type within a 24-hour period. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.017 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
* @param {InitiatePayoutRequest} body The request body for the `initiatePayout` operation.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async initiatePayout(body, options) {
const localVarAxiosArgs = await localVarAxiosParamCreator.initiatePayout(body, options);
return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
},
};
};
exports.DefaultApiFp = DefaultApiFp;
/**
* DefaultApi - factory interface
* @export
*/
const DefaultApiFactory = function (configuration, basePath, axios) {
const localVarFp = (0, exports.DefaultApiFp)(configuration);
return {
/**
* Returns the list of payment methods for the seller, which can be filtered by method type. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | .5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
* @param {string} marketplaceId The identifier of the marketplace from which you want to retrieve payment methods. For the list of possible marketplace identifiers, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
* @param {Array<'BANK_ACCOUNT' | 'CARD' | 'SELLER_WALLET'>} [paymentMethodTypes] A comma-separated list of the payment method types you want to include in the response.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getPaymentMethods(marketplaceId, paymentMethodTypes, options) {
return localVarFp.getPaymentMethods(marketplaceId, paymentMethodTypes, options).then((request) => request(axios, basePath));
},
/**
* Initiates an on-demand payout to the seller\'s default deposit method in Seller Central for the given `marketplaceId` and `accountType`, if eligible. You can only initiate one on-demand payout for each marketplace and account type within a 24-hour period. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.017 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
* @param {InitiatePayoutRequest} body The request body for the `initiatePayout` operation.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
initiatePayout(body, options) {
return localVarFp.initiatePayout(body, options).then((request) => request(axios, basePath));
},
};
};
exports.DefaultApiFactory = DefaultApiFactory;
/**
* DefaultApi - object-oriented interface
* @export
* @class DefaultApi
* @extends {BaseAPI}
*/
class DefaultApi extends base_1.BaseAPI {
/**
* Returns the list of payment methods for the seller, which can be filtered by method type. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | .5 | 30 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
* @param {DefaultApiGetPaymentMethodsRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof DefaultApi
*/
getPaymentMethods(requestParameters, options) {
return (0, exports.DefaultApiFp)(this.configuration).getPaymentMethods(requestParameters.marketplaceId, requestParameters.paymentMethodTypes, options).then((request) => request(this.axios, this.basePath));
}
/**
* Initiates an on-demand payout to the seller\'s default deposit method in Seller Central for the given `marketplaceId` and `accountType`, if eligible. You can only initiate one on-demand payout for each marketplace and account type within a 24-hour period. **Usage Plan:** | Rate (requests per second) | Burst | | ---- | ---- | | 0.017 | 2 | The `x-amzn-RateLimit-Limit` response header contains the usage plan rate limits for the operation, when available. The preceding table contains the default rate and burst values for this operation. Selling partners whose business demands require higher throughput might have higher rate and burst values than those shown here. For more information, refer to [Usage Plans and Rate Limits](https://developer-docs.amazon.com/sp-api/docs/usage-plans-and-rate-limits-in-the-sp-api).
* @param {DefaultApiInitiatePayoutRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof DefaultApi
*/
initiatePayout(requestParameters, options) {
return (0, exports.DefaultApiFp)(this.configuration).initiatePayout(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
}
}
exports.DefaultApi = DefaultApi;
//# sourceMappingURL=api.js.map