@sp-api-sdk/finances-transfers-api-2024-06-01 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +97 -0
- package/dist/cjs/api-model/api/default-api.js +197 -0
- package/dist/cjs/api-model/api.js +30 -0
- package/dist/cjs/api-model/base.js +71 -0
- package/dist/cjs/api-model/common.js +145 -0
- package/dist/cjs/api-model/configuration.js +99 -0
- package/dist/cjs/api-model/index.js +32 -0
- package/dist/cjs/api-model/models/assignment-type.js +24 -0
- package/dist/cjs/api-model/models/error-list.js +15 -0
- package/dist/cjs/api-model/models/expiry-date.js +15 -0
- package/dist/cjs/api-model/models/get-payment-methods-response.js +15 -0
- package/dist/cjs/api-model/models/index.js +25 -0
- package/dist/cjs/api-model/models/initiate-payout-request.js +15 -0
- package/dist/cjs/api-model/models/initiate-payout-response.js +15 -0
- package/dist/cjs/api-model/models/model-error.js +15 -0
- package/dist/cjs/api-model/models/payment-method-details.js +15 -0
- package/dist/cjs/api-model/models/payment-method-type.js +26 -0
- package/dist/cjs/client.js +28 -0
- package/dist/cjs/index.js +19 -0
- package/dist/es/api-model/api/default-api.js +187 -0
- package/dist/es/api-model/api.js +14 -0
- package/dist/es/api-model/base.js +63 -0
- package/dist/es/api-model/common.js +133 -0
- package/dist/es/api-model/configuration.js +95 -0
- package/dist/es/api-model/index.js +16 -0
- package/dist/es/api-model/models/assignment-type.js +21 -0
- package/dist/es/api-model/models/error-list.js +14 -0
- package/dist/es/api-model/models/expiry-date.js +14 -0
- package/dist/es/api-model/models/get-payment-methods-response.js +14 -0
- package/dist/es/api-model/models/index.js +9 -0
- package/dist/es/api-model/models/initiate-payout-request.js +14 -0
- package/dist/es/api-model/models/initiate-payout-response.js +14 -0
- package/dist/es/api-model/models/model-error.js +14 -0
- package/dist/es/api-model/models/payment-method-details.js +14 -0
- package/dist/es/api-model/models/payment-method-type.js +23 -0
- package/dist/es/client.js +24 -0
- package/dist/es/index.js +3 -0
- package/dist/types/api-model/api/default-api.d.ts +145 -0
- package/dist/types/api-model/api.d.ts +12 -0
- package/dist/types/api-model/base.d.ts +66 -0
- package/dist/types/api-model/common.d.ts +65 -0
- package/dist/types/api-model/configuration.d.ts +91 -0
- package/dist/types/api-model/index.d.ts +14 -0
- package/dist/types/api-model/models/assignment-type.d.ts +20 -0
- package/dist/types/api-model/models/error-list.d.ts +24 -0
- package/dist/types/api-model/models/expiry-date.d.ts +30 -0
- package/dist/types/api-model/models/get-payment-methods-response.d.ts +25 -0
- package/dist/types/api-model/models/index.d.ts +9 -0
- package/dist/types/api-model/models/initiate-payout-request.d.ts +30 -0
- package/dist/types/api-model/models/initiate-payout-response.d.ts +24 -0
- package/dist/types/api-model/models/model-error.d.ts +36 -0
- package/dist/types/api-model/models/payment-method-details.d.ts +63 -0
- package/dist/types/api-model/models/payment-method-type.d.ts +22 -0
- package/dist/types/client.d.ts +6 -0
- package/dist/types/index.d.ts +3 -0
- package/package.json +44 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Bizon
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# `finances-transfers-api-2024-06-01`
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@sp-api-sdk/finances-transfers-api-2024-06-01)
|
|
6
|
+
[](https://github.com/xojs/xo)
|
|
7
|
+
|
|
8
|
+
## Documentation
|
|
9
|
+
|
|
10
|
+
Learn more about this Selling Partner API by visiting the [official documentation](https://developer-docs.amazon.com/sp-api/docs).
|
|
11
|
+
|
|
12
|
+
Also, see the [generated documentation](https://bizon.github.io/selling-partner-api-sdk/modules/_sp-api-sdk_finances-transfers-api-2024-06-01.html) for this API client.
|
|
13
|
+
|
|
14
|
+
## Installing
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
npm install @sp-api-sdk/finances-transfers-api-2024-06-01
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Getting Started
|
|
21
|
+
|
|
22
|
+
```javascript
|
|
23
|
+
import {SellingPartnerApiAuth} from '@sp-api-sdk/auth'
|
|
24
|
+
import {FinancesTransfersApiClient} from '@sp-api-sdk/finances-transfers-api-2024-06-01'
|
|
25
|
+
|
|
26
|
+
const auth = new SellingPartnerApiAuth({
|
|
27
|
+
clientId: process.env.LWA_CLIENT_ID,
|
|
28
|
+
clientSecret: process.env.LWA_CLIENT_SECRET,
|
|
29
|
+
refreshToken: 'Atzr|…',
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
const client = new FinancesTransfersApiClient({
|
|
33
|
+
auth,
|
|
34
|
+
region: 'eu',
|
|
35
|
+
})
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Rate Limiting
|
|
39
|
+
|
|
40
|
+
In order to retry rate limited requests (HTTP 429), you can configure the API client as such:
|
|
41
|
+
|
|
42
|
+
```javascript
|
|
43
|
+
const client = new FinancesTransfersApiClient({
|
|
44
|
+
auth,
|
|
45
|
+
region: 'eu',
|
|
46
|
+
rateLimiting: {
|
|
47
|
+
retry: true,
|
|
48
|
+
// Optionally specify a callback that will be called on every retry.
|
|
49
|
+
onRetry: (retryInfo) => {
|
|
50
|
+
console.log(retryInfo)
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
})
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The rate limits used for each route are specified in the [API documentation](https://developer-docs.amazon.com/sp-api/docs).
|
|
57
|
+
|
|
58
|
+
## Logging
|
|
59
|
+
|
|
60
|
+
You can enable logging for both SP-API requests and responses by configuring the `logging.request` and `logging.response` properties.
|
|
61
|
+
|
|
62
|
+
```javascript
|
|
63
|
+
const client = new FinancesTransfersApiClient({
|
|
64
|
+
auth,
|
|
65
|
+
region: 'eu',
|
|
66
|
+
logging: {
|
|
67
|
+
request: {
|
|
68
|
+
logger: console.debug
|
|
69
|
+
},
|
|
70
|
+
response: {
|
|
71
|
+
logger: console.debug
|
|
72
|
+
},
|
|
73
|
+
error: true,
|
|
74
|
+
},
|
|
75
|
+
})
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Specifying `true` will use the default options, specifying an object will allow you to override the default options.
|
|
79
|
+
This uses [axios-logger](https://github.com/hg-pyun/axios-logger) under the hood.
|
|
80
|
+
By default, if enabled, the `request` and `response` loggers will use `console.info` and the `error` logger will use `console.error`.
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
## License
|
|
84
|
+
|
|
85
|
+
MIT
|
|
86
|
+
|
|
87
|
+
## Miscellaneous
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
╚⊙ ⊙╝
|
|
91
|
+
╚═(███)═╝
|
|
92
|
+
╚═(███)═╝
|
|
93
|
+
╚═(███)═╝
|
|
94
|
+
╚═(███)═╝
|
|
95
|
+
╚═(███)═╝
|
|
96
|
+
╚═(███)═╝
|
|
97
|
+
```
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* The Selling Partner API for Transfers.
|
|
6
|
+
* 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.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 2024-06-01
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.GetPaymentMethodsPaymentMethodTypesEnum = exports.DefaultApi = exports.DefaultApiFactory = exports.DefaultApiFp = exports.DefaultApiAxiosParamCreator = void 0;
|
|
20
|
+
const axios_1 = __importDefault(require("axios"));
|
|
21
|
+
// Some imports not used depending on template conditions
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
const common_1 = require("../common");
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
const base_1 = require("../base");
|
|
26
|
+
/**
|
|
27
|
+
* DefaultApi - axios parameter creator
|
|
28
|
+
* @export
|
|
29
|
+
*/
|
|
30
|
+
const DefaultApiAxiosParamCreator = function (configuration) {
|
|
31
|
+
return {
|
|
32
|
+
/**
|
|
33
|
+
* 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).
|
|
34
|
+
* @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).
|
|
35
|
+
* @param {Set<GetPaymentMethodsPaymentMethodTypesEnum>} [paymentMethodTypes] A comma-separated list of the payment method types you want to include in the response.
|
|
36
|
+
* @param {*} [options] Override http request option.
|
|
37
|
+
* @throws {RequiredError}
|
|
38
|
+
*/
|
|
39
|
+
getPaymentMethods: async (marketplaceId, paymentMethodTypes, options = {}) => {
|
|
40
|
+
// verify required parameter 'marketplaceId' is not null or undefined
|
|
41
|
+
(0, common_1.assertParamExists)('getPaymentMethods', 'marketplaceId', marketplaceId);
|
|
42
|
+
const localVarPath = `/finances/transfers/2024-06-01/paymentMethods`;
|
|
43
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
44
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
45
|
+
let baseOptions;
|
|
46
|
+
if (configuration) {
|
|
47
|
+
baseOptions = configuration.baseOptions;
|
|
48
|
+
}
|
|
49
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
|
|
50
|
+
const localVarHeaderParameter = {};
|
|
51
|
+
const localVarQueryParameter = {};
|
|
52
|
+
if (marketplaceId !== undefined) {
|
|
53
|
+
localVarQueryParameter['marketplaceId'] = marketplaceId;
|
|
54
|
+
}
|
|
55
|
+
if (paymentMethodTypes) {
|
|
56
|
+
localVarQueryParameter['paymentMethodTypes'] = Array.from(paymentMethodTypes).join(base_1.COLLECTION_FORMATS.csv);
|
|
57
|
+
}
|
|
58
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
59
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
60
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
61
|
+
return {
|
|
62
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
63
|
+
options: localVarRequestOptions,
|
|
64
|
+
};
|
|
65
|
+
},
|
|
66
|
+
/**
|
|
67
|
+
* 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).
|
|
68
|
+
* @param {InitiatePayoutRequest} body The request body for the `initiatePayout` operation.
|
|
69
|
+
* @param {*} [options] Override http request option.
|
|
70
|
+
* @throws {RequiredError}
|
|
71
|
+
*/
|
|
72
|
+
initiatePayout: async (body, options = {}) => {
|
|
73
|
+
// verify required parameter 'body' is not null or undefined
|
|
74
|
+
(0, common_1.assertParamExists)('initiatePayout', 'body', body);
|
|
75
|
+
const localVarPath = `/finances/transfers/2024-06-01/payouts`;
|
|
76
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
77
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
78
|
+
let baseOptions;
|
|
79
|
+
if (configuration) {
|
|
80
|
+
baseOptions = configuration.baseOptions;
|
|
81
|
+
}
|
|
82
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options };
|
|
83
|
+
const localVarHeaderParameter = {};
|
|
84
|
+
const localVarQueryParameter = {};
|
|
85
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
86
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
87
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
88
|
+
localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers };
|
|
89
|
+
localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration);
|
|
90
|
+
return {
|
|
91
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
92
|
+
options: localVarRequestOptions,
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
exports.DefaultApiAxiosParamCreator = DefaultApiAxiosParamCreator;
|
|
98
|
+
/**
|
|
99
|
+
* DefaultApi - functional programming interface
|
|
100
|
+
* @export
|
|
101
|
+
*/
|
|
102
|
+
const DefaultApiFp = function (configuration) {
|
|
103
|
+
const localVarAxiosParamCreator = (0, exports.DefaultApiAxiosParamCreator)(configuration);
|
|
104
|
+
return {
|
|
105
|
+
/**
|
|
106
|
+
* 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).
|
|
107
|
+
* @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).
|
|
108
|
+
* @param {Set<GetPaymentMethodsPaymentMethodTypesEnum>} [paymentMethodTypes] A comma-separated list of the payment method types you want to include in the response.
|
|
109
|
+
* @param {*} [options] Override http request option.
|
|
110
|
+
* @throws {RequiredError}
|
|
111
|
+
*/
|
|
112
|
+
async getPaymentMethods(marketplaceId, paymentMethodTypes, options) {
|
|
113
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getPaymentMethods(marketplaceId, paymentMethodTypes, options);
|
|
114
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
115
|
+
const localVarOperationServerBasePath = base_1.operationServerMap['DefaultApi.getPaymentMethods']?.[localVarOperationServerIndex]?.url;
|
|
116
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
117
|
+
},
|
|
118
|
+
/**
|
|
119
|
+
* 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).
|
|
120
|
+
* @param {InitiatePayoutRequest} body The request body for the `initiatePayout` operation.
|
|
121
|
+
* @param {*} [options] Override http request option.
|
|
122
|
+
* @throws {RequiredError}
|
|
123
|
+
*/
|
|
124
|
+
async initiatePayout(body, options) {
|
|
125
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.initiatePayout(body, options);
|
|
126
|
+
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
|
|
127
|
+
const localVarOperationServerBasePath = base_1.operationServerMap['DefaultApi.initiatePayout']?.[localVarOperationServerIndex]?.url;
|
|
128
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
exports.DefaultApiFp = DefaultApiFp;
|
|
133
|
+
/**
|
|
134
|
+
* DefaultApi - factory interface
|
|
135
|
+
* @export
|
|
136
|
+
*/
|
|
137
|
+
const DefaultApiFactory = function (configuration, basePath, axios) {
|
|
138
|
+
const localVarFp = (0, exports.DefaultApiFp)(configuration);
|
|
139
|
+
return {
|
|
140
|
+
/**
|
|
141
|
+
* 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).
|
|
142
|
+
* @param {DefaultApiGetPaymentMethodsRequest} requestParameters Request parameters.
|
|
143
|
+
* @param {*} [options] Override http request option.
|
|
144
|
+
* @throws {RequiredError}
|
|
145
|
+
*/
|
|
146
|
+
getPaymentMethods(requestParameters, options) {
|
|
147
|
+
return localVarFp.getPaymentMethods(requestParameters.marketplaceId, requestParameters.paymentMethodTypes, options).then((request) => request(axios, basePath));
|
|
148
|
+
},
|
|
149
|
+
/**
|
|
150
|
+
* 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).
|
|
151
|
+
* @param {DefaultApiInitiatePayoutRequest} requestParameters Request parameters.
|
|
152
|
+
* @param {*} [options] Override http request option.
|
|
153
|
+
* @throws {RequiredError}
|
|
154
|
+
*/
|
|
155
|
+
initiatePayout(requestParameters, options) {
|
|
156
|
+
return localVarFp.initiatePayout(requestParameters.body, options).then((request) => request(axios, basePath));
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
exports.DefaultApiFactory = DefaultApiFactory;
|
|
161
|
+
/**
|
|
162
|
+
* DefaultApi - object-oriented interface
|
|
163
|
+
* @export
|
|
164
|
+
* @class DefaultApi
|
|
165
|
+
* @extends {BaseAPI}
|
|
166
|
+
*/
|
|
167
|
+
class DefaultApi extends base_1.BaseAPI {
|
|
168
|
+
/**
|
|
169
|
+
* 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).
|
|
170
|
+
* @param {DefaultApiGetPaymentMethodsRequest} requestParameters Request parameters.
|
|
171
|
+
* @param {*} [options] Override http request option.
|
|
172
|
+
* @throws {RequiredError}
|
|
173
|
+
* @memberof DefaultApi
|
|
174
|
+
*/
|
|
175
|
+
getPaymentMethods(requestParameters, options) {
|
|
176
|
+
return (0, exports.DefaultApiFp)(this.configuration).getPaymentMethods(requestParameters.marketplaceId, requestParameters.paymentMethodTypes, options).then((request) => request(this.axios, this.basePath));
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* 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).
|
|
180
|
+
* @param {DefaultApiInitiatePayoutRequest} requestParameters Request parameters.
|
|
181
|
+
* @param {*} [options] Override http request option.
|
|
182
|
+
* @throws {RequiredError}
|
|
183
|
+
* @memberof DefaultApi
|
|
184
|
+
*/
|
|
185
|
+
initiatePayout(requestParameters, options) {
|
|
186
|
+
return (0, exports.DefaultApiFp)(this.configuration).initiatePayout(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
exports.DefaultApi = DefaultApi;
|
|
190
|
+
/**
|
|
191
|
+
* @export
|
|
192
|
+
*/
|
|
193
|
+
exports.GetPaymentMethodsPaymentMethodTypesEnum = {
|
|
194
|
+
BankAccount: 'BANK_ACCOUNT',
|
|
195
|
+
Card: 'CARD',
|
|
196
|
+
SellerWallet: 'SELLER_WALLET'
|
|
197
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* The Selling Partner API for Transfers.
|
|
6
|
+
* 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.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 2024-06-01
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
18
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
19
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
20
|
+
}
|
|
21
|
+
Object.defineProperty(o, k2, desc);
|
|
22
|
+
}) : (function(o, m, k, k2) {
|
|
23
|
+
if (k2 === undefined) k2 = k;
|
|
24
|
+
o[k2] = m[k];
|
|
25
|
+
}));
|
|
26
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
27
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
__exportStar(require("./api/default-api"), exports);
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* The Selling Partner API for Transfers.
|
|
6
|
+
* 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.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 2024-06-01
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.operationServerMap = exports.RequiredError = exports.BaseAPI = exports.COLLECTION_FORMATS = exports.BASE_PATH = void 0;
|
|
20
|
+
const axios_1 = __importDefault(require("axios"));
|
|
21
|
+
exports.BASE_PATH = "https://sellingpartnerapi-na.amazon.com".replace(/\/+$/, "");
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @export
|
|
25
|
+
*/
|
|
26
|
+
exports.COLLECTION_FORMATS = {
|
|
27
|
+
csv: ",",
|
|
28
|
+
ssv: " ",
|
|
29
|
+
tsv: "\t",
|
|
30
|
+
pipes: "|",
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @export
|
|
35
|
+
* @class BaseAPI
|
|
36
|
+
*/
|
|
37
|
+
class BaseAPI {
|
|
38
|
+
basePath;
|
|
39
|
+
axios;
|
|
40
|
+
configuration;
|
|
41
|
+
constructor(configuration, basePath = exports.BASE_PATH, axios = axios_1.default) {
|
|
42
|
+
this.basePath = basePath;
|
|
43
|
+
this.axios = axios;
|
|
44
|
+
if (configuration) {
|
|
45
|
+
this.configuration = configuration;
|
|
46
|
+
this.basePath = configuration.basePath ?? basePath;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.BaseAPI = BaseAPI;
|
|
51
|
+
;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @export
|
|
55
|
+
* @class RequiredError
|
|
56
|
+
* @extends {Error}
|
|
57
|
+
*/
|
|
58
|
+
class RequiredError extends Error {
|
|
59
|
+
field;
|
|
60
|
+
constructor(field, msg) {
|
|
61
|
+
super(msg);
|
|
62
|
+
this.field = field;
|
|
63
|
+
this.name = "RequiredError";
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.RequiredError = RequiredError;
|
|
67
|
+
/**
|
|
68
|
+
*
|
|
69
|
+
* @export
|
|
70
|
+
*/
|
|
71
|
+
exports.operationServerMap = {};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* The Selling Partner API for Transfers.
|
|
6
|
+
* 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.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 2024-06-01
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.createRequestFunction = exports.toPathString = exports.serializeDataIfNeeded = exports.setSearchParams = exports.setOAuthToObject = exports.setBearerAuthToObject = exports.setBasicAuthToObject = exports.setApiKeyToObject = exports.assertParamExists = exports.DUMMY_BASE_URL = void 0;
|
|
17
|
+
const base_1 = require("./base");
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @export
|
|
21
|
+
*/
|
|
22
|
+
exports.DUMMY_BASE_URL = 'https://example.com';
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @throws {RequiredError}
|
|
26
|
+
* @export
|
|
27
|
+
*/
|
|
28
|
+
const assertParamExists = function (functionName, paramName, paramValue) {
|
|
29
|
+
if (paramValue === null || paramValue === undefined) {
|
|
30
|
+
throw new base_1.RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
exports.assertParamExists = assertParamExists;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @export
|
|
37
|
+
*/
|
|
38
|
+
const setApiKeyToObject = async function (object, keyParamName, configuration) {
|
|
39
|
+
if (configuration && configuration.apiKey) {
|
|
40
|
+
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
|
|
41
|
+
? await configuration.apiKey(keyParamName)
|
|
42
|
+
: await configuration.apiKey;
|
|
43
|
+
object[keyParamName] = localVarApiKeyValue;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
exports.setApiKeyToObject = setApiKeyToObject;
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* @export
|
|
50
|
+
*/
|
|
51
|
+
const setBasicAuthToObject = function (object, configuration) {
|
|
52
|
+
if (configuration && (configuration.username || configuration.password)) {
|
|
53
|
+
object["auth"] = { username: configuration.username, password: configuration.password };
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
exports.setBasicAuthToObject = setBasicAuthToObject;
|
|
57
|
+
/**
|
|
58
|
+
*
|
|
59
|
+
* @export
|
|
60
|
+
*/
|
|
61
|
+
const setBearerAuthToObject = async function (object, configuration) {
|
|
62
|
+
if (configuration && configuration.accessToken) {
|
|
63
|
+
const accessToken = typeof configuration.accessToken === 'function'
|
|
64
|
+
? await configuration.accessToken()
|
|
65
|
+
: await configuration.accessToken;
|
|
66
|
+
object["Authorization"] = "Bearer " + accessToken;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
exports.setBearerAuthToObject = setBearerAuthToObject;
|
|
70
|
+
/**
|
|
71
|
+
*
|
|
72
|
+
* @export
|
|
73
|
+
*/
|
|
74
|
+
const setOAuthToObject = async function (object, name, scopes, configuration) {
|
|
75
|
+
if (configuration && configuration.accessToken) {
|
|
76
|
+
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
|
|
77
|
+
? await configuration.accessToken(name, scopes)
|
|
78
|
+
: await configuration.accessToken;
|
|
79
|
+
object["Authorization"] = "Bearer " + localVarAccessTokenValue;
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
exports.setOAuthToObject = setOAuthToObject;
|
|
83
|
+
function setFlattenedQueryParams(urlSearchParams, parameter, key = "") {
|
|
84
|
+
if (parameter == null)
|
|
85
|
+
return;
|
|
86
|
+
if (typeof parameter === "object") {
|
|
87
|
+
if (Array.isArray(parameter)) {
|
|
88
|
+
parameter.forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
Object.keys(parameter).forEach(currentKey => setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`));
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
if (urlSearchParams.has(key)) {
|
|
96
|
+
urlSearchParams.append(key, parameter);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
urlSearchParams.set(key, parameter);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
*
|
|
105
|
+
* @export
|
|
106
|
+
*/
|
|
107
|
+
const setSearchParams = function (url, ...objects) {
|
|
108
|
+
const searchParams = new URLSearchParams(url.search);
|
|
109
|
+
setFlattenedQueryParams(searchParams, objects);
|
|
110
|
+
url.search = searchParams.toString();
|
|
111
|
+
};
|
|
112
|
+
exports.setSearchParams = setSearchParams;
|
|
113
|
+
/**
|
|
114
|
+
*
|
|
115
|
+
* @export
|
|
116
|
+
*/
|
|
117
|
+
const serializeDataIfNeeded = function (value, requestOptions, configuration) {
|
|
118
|
+
const nonString = typeof value !== 'string';
|
|
119
|
+
const needsSerialization = nonString && configuration && configuration.isJsonMime
|
|
120
|
+
? configuration.isJsonMime(requestOptions.headers['Content-Type'])
|
|
121
|
+
: nonString;
|
|
122
|
+
return needsSerialization
|
|
123
|
+
? JSON.stringify(value !== undefined ? value : {})
|
|
124
|
+
: (value || "");
|
|
125
|
+
};
|
|
126
|
+
exports.serializeDataIfNeeded = serializeDataIfNeeded;
|
|
127
|
+
/**
|
|
128
|
+
*
|
|
129
|
+
* @export
|
|
130
|
+
*/
|
|
131
|
+
const toPathString = function (url) {
|
|
132
|
+
return url.pathname + url.search + url.hash;
|
|
133
|
+
};
|
|
134
|
+
exports.toPathString = toPathString;
|
|
135
|
+
/**
|
|
136
|
+
*
|
|
137
|
+
* @export
|
|
138
|
+
*/
|
|
139
|
+
const createRequestFunction = function (axiosArgs, globalAxios, BASE_PATH, configuration) {
|
|
140
|
+
return (axios = globalAxios, basePath = BASE_PATH) => {
|
|
141
|
+
const axiosRequestArgs = { ...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url };
|
|
142
|
+
return axios.request(axiosRequestArgs);
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
exports.createRequestFunction = createRequestFunction;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* The Selling Partner API for Transfers.
|
|
6
|
+
* 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.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 2024-06-01
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.Configuration = void 0;
|
|
17
|
+
class Configuration {
|
|
18
|
+
/**
|
|
19
|
+
* parameter for apiKey security
|
|
20
|
+
* @param name security name
|
|
21
|
+
* @memberof Configuration
|
|
22
|
+
*/
|
|
23
|
+
apiKey;
|
|
24
|
+
/**
|
|
25
|
+
* parameter for basic security
|
|
26
|
+
*
|
|
27
|
+
* @type {string}
|
|
28
|
+
* @memberof Configuration
|
|
29
|
+
*/
|
|
30
|
+
username;
|
|
31
|
+
/**
|
|
32
|
+
* parameter for basic security
|
|
33
|
+
*
|
|
34
|
+
* @type {string}
|
|
35
|
+
* @memberof Configuration
|
|
36
|
+
*/
|
|
37
|
+
password;
|
|
38
|
+
/**
|
|
39
|
+
* parameter for oauth2 security
|
|
40
|
+
* @param name security name
|
|
41
|
+
* @param scopes oauth2 scope
|
|
42
|
+
* @memberof Configuration
|
|
43
|
+
*/
|
|
44
|
+
accessToken;
|
|
45
|
+
/**
|
|
46
|
+
* override base path
|
|
47
|
+
*
|
|
48
|
+
* @type {string}
|
|
49
|
+
* @memberof Configuration
|
|
50
|
+
*/
|
|
51
|
+
basePath;
|
|
52
|
+
/**
|
|
53
|
+
* override server index
|
|
54
|
+
*
|
|
55
|
+
* @type {number}
|
|
56
|
+
* @memberof Configuration
|
|
57
|
+
*/
|
|
58
|
+
serverIndex;
|
|
59
|
+
/**
|
|
60
|
+
* base options for axios calls
|
|
61
|
+
*
|
|
62
|
+
* @type {any}
|
|
63
|
+
* @memberof Configuration
|
|
64
|
+
*/
|
|
65
|
+
baseOptions;
|
|
66
|
+
/**
|
|
67
|
+
* The FormData constructor that will be used to create multipart form data
|
|
68
|
+
* requests. You can inject this here so that execution environments that
|
|
69
|
+
* do not support the FormData class can still run the generated client.
|
|
70
|
+
*
|
|
71
|
+
* @type {new () => FormData}
|
|
72
|
+
*/
|
|
73
|
+
formDataCtor;
|
|
74
|
+
constructor(param = {}) {
|
|
75
|
+
this.apiKey = param.apiKey;
|
|
76
|
+
this.username = param.username;
|
|
77
|
+
this.password = param.password;
|
|
78
|
+
this.accessToken = param.accessToken;
|
|
79
|
+
this.basePath = param.basePath;
|
|
80
|
+
this.serverIndex = param.serverIndex;
|
|
81
|
+
this.baseOptions = param.baseOptions;
|
|
82
|
+
this.formDataCtor = param.formDataCtor;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Check if the given MIME is a JSON MIME.
|
|
86
|
+
* JSON MIME examples:
|
|
87
|
+
* application/json
|
|
88
|
+
* application/json; charset=UTF8
|
|
89
|
+
* APPLICATION/JSON
|
|
90
|
+
* application/vnd.company+json
|
|
91
|
+
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
92
|
+
* @return True if the given MIME is JSON, false otherwise.
|
|
93
|
+
*/
|
|
94
|
+
isJsonMime(mime) {
|
|
95
|
+
const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
|
|
96
|
+
return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.Configuration = Configuration;
|