@amazon-sp-api-release/amazon-sp-api-sdk-js 1.1.0 → 1.2.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/README.md +2 -3
- package/helper/DefaultRateLimitMap.mjs +13 -1
- package/index.js +1 -0
- package/package.json +1 -1
- package/src/apluscontent_v2020_11_01/ApiClient.js +5 -1
- package/src/appintegrations_v2024_04_01/ApiClient.js +5 -1
- package/src/applications_v2023_11_30/ApiClient.js +5 -1
- package/src/awd_v2024_05_09/ApiClient.js +5 -1
- package/src/catalogitems_v2022_04_01/ApiClient.js +5 -1
- package/src/datakiosk_v2023_11_15/ApiClient.js +5 -1
- package/src/easyship_v2022_03_23/ApiClient.js +5 -1
- package/src/fbaeligibility_v1/ApiClient.js +5 -1
- package/src/fbainventory_v1/ApiClient.js +5 -1
- package/src/feeds_v2021_06_30/ApiClient.js +5 -1
- package/src/finances_v0/ApiClient.js +5 -1
- package/src/fulfillmentinbound_v0/ApiClient.js +5 -1
- package/src/fulfillmentinbound_v2024_03_20/ApiClient.js +5 -1
- package/src/fulfillmentoutbound_v2020_07_01/ApiClient.js +5 -1
- package/src/invoices_v2024_06_19/ApiClient.js +5 -1
- package/src/invoicing_v0/ApiClient.js +5 -1
- package/src/listingsitems_v2021_08_01/ApiClient.js +5 -1
- package/src/listingsitems_v2021_08_01/api/ListingsApi.js +6 -6
- package/src/listingsitems_v2021_08_01/model/FulfillmentAvailability.js +2 -2
- package/src/listingsitems_v2021_08_01/model/Issue.js +2 -2
- package/src/listingsitems_v2021_08_01/model/IssueExemption.js +1 -1
- package/src/listingsitems_v2021_08_01/model/ItemRelationship.js +1 -1
- package/src/listingsitems_v2021_08_01/model/ItemSearchResults.js +2 -2
- package/src/listingsitems_v2021_08_01/model/Pagination.js +1 -1
- package/src/listingsitems_v2021_08_01/model/PatchOperation.js +9 -3
- package/src/listingsrestrictions_v2021_08_01/ApiClient.js +5 -1
- package/src/merchantfulfillment_v0/ApiClient.js +5 -1
- package/src/messaging_v1/ApiClient.js +5 -1
- package/src/notifications_v1/ApiClient.js +5 -1
- package/src/orders_v0/ApiClient.js +5 -1
- package/src/orders_v0/api/OrdersV0Api.js +26 -26
- package/src/orders_v0/api/ShipmentApi.js +2 -2
- package/src/orders_v0/index.js +0 -7
- package/src/orders_v0/model/AmazonPrograms.js +3 -3
- package/src/orders_v0/model/OrderItem.js +0 -7
- package/src/orders_v0/model/OrdersList.js +1 -1
- package/src/orders_v0/model/PackageDetail.js +1 -1
- package/src/pricing_v0/ApiClient.js +5 -1
- package/src/pricing_v2022_05_01/ApiClient.js +5 -1
- package/src/pricing_v2022_05_01/model/CompetitiveSummaryRequest.js +2 -2
- package/src/pricing_v2022_05_01/model/CompetitiveSummaryResponseBody.js +2 -2
- package/src/pricing_v2022_05_01/model/FeaturedOfferExpectedPriceRequest.js +3 -3
- package/src/pricing_v2022_05_01/model/FeaturedOfferExpectedPriceRequestParams.js +2 -2
- package/src/pricing_v2022_05_01/model/FeaturedOfferSegment.js +7 -1
- package/src/pricing_v2022_05_01/model/LowestPricedOffersInput.js +2 -2
- package/src/pricing_v2022_05_01/model/OfferIdentifier.js +2 -2
- package/src/pricing_v2022_05_01/model/ReferencePrice.js +2 -2
- package/src/productfees_v0/ApiClient.js +5 -1
- package/src/producttypedefinitions_v2020_09_01/ApiClient.js +5 -1
- package/src/replenishment_v2022_11_07/ApiClient.js +5 -1
- package/src/reports_v2021_06_30/ApiClient.js +5 -1
- package/src/sales_v1/ApiClient.js +5 -1
- package/src/sales_v1/api/SalesApi.js +4 -1
- package/src/sellerWallet_2024_03_01/ApiClient.js +827 -0
- package/src/sellerWallet_2024_03_01/api/AccountsApi.js +212 -0
- package/src/sellerWallet_2024_03_01/api/TransactionsApi.js +233 -0
- package/src/sellerWallet_2024_03_01/api/TransferPreviewApi.js +144 -0
- package/src/sellerWallet_2024_03_01/api/TransferScheduleApi.js +347 -0
- package/src/sellerWallet_2024_03_01/index.js +322 -0
- package/src/sellerWallet_2024_03_01/model/AccountHolderAddress.js +114 -0
- package/src/sellerWallet_2024_03_01/model/Balance.js +98 -0
- package/src/sellerWallet_2024_03_01/model/BalanceListing.js +63 -0
- package/src/sellerWallet_2024_03_01/model/BalanceType.js +54 -0
- package/src/sellerWallet_2024_03_01/model/BankAccount.js +148 -0
- package/src/sellerWallet_2024_03_01/model/BankAccountHolderStatus.js +54 -0
- package/src/sellerWallet_2024_03_01/model/BankAccountListing.js +65 -0
- package/src/sellerWallet_2024_03_01/model/BankAccountNumberFormat.js +42 -0
- package/src/sellerWallet_2024_03_01/model/BankAccountOwnershipType.js +48 -0
- package/src/sellerWallet_2024_03_01/model/BankNumberFormat.js +42 -0
- package/src/sellerWallet_2024_03_01/model/Currency.js +69 -0
- package/src/sellerWallet_2024_03_01/model/DeleteTransferSchedule.js +80 -0
- package/src/sellerWallet_2024_03_01/model/Error.js +80 -0
- package/src/sellerWallet_2024_03_01/model/ErrorList.js +65 -0
- package/src/sellerWallet_2024_03_01/model/Fee.js +91 -0
- package/src/sellerWallet_2024_03_01/model/FeeType.js +48 -0
- package/src/sellerWallet_2024_03_01/model/FxRateDetails.js +91 -0
- package/src/sellerWallet_2024_03_01/model/PaymentPreference.js +73 -0
- package/src/sellerWallet_2024_03_01/model/PaymentPreferencePaymentType.js +42 -0
- package/src/sellerWallet_2024_03_01/model/RateDirection.js +42 -0
- package/src/sellerWallet_2024_03_01/model/RecurringFrequency.js +54 -0
- package/src/sellerWallet_2024_03_01/model/ScheduleExpression.js +71 -0
- package/src/sellerWallet_2024_03_01/model/ScheduleExpressionType.js +42 -0
- package/src/sellerWallet_2024_03_01/model/ScheduleTransferType.js +36 -0
- package/src/sellerWallet_2024_03_01/model/Transaction.js +187 -0
- package/src/sellerWallet_2024_03_01/model/TransactionAccount.js +112 -0
- package/src/sellerWallet_2024_03_01/model/TransactionInitiationRequest.js +121 -0
- package/src/sellerWallet_2024_03_01/model/TransactionInstrumentDetails.js +73 -0
- package/src/sellerWallet_2024_03_01/model/TransactionListing.js +72 -0
- package/src/sellerWallet_2024_03_01/model/TransactionStatus.js +66 -0
- package/src/sellerWallet_2024_03_01/model/TransactionType.js +42 -0
- package/src/sellerWallet_2024_03_01/model/TransferRatePreview.js +91 -0
- package/src/sellerWallet_2024_03_01/model/TransferSchedule.js +123 -0
- package/src/sellerWallet_2024_03_01/model/TransferScheduleFailures.js +73 -0
- package/src/sellerWallet_2024_03_01/model/TransferScheduleInformation.js +83 -0
- package/src/sellerWallet_2024_03_01/model/TransferScheduleListing.js +72 -0
- package/src/sellerWallet_2024_03_01/model/TransferScheduleRequest.js +125 -0
- package/src/sellerWallet_2024_03_01/model/TransferScheduleStatus.js +54 -0
- package/src/sellers_v1/ApiClient.js +5 -1
- package/src/services_v1/ApiClient.js +5 -1
- package/src/shipping_v2/ApiClient.js +5 -1
- package/src/solicitations_v1/ApiClient.js +5 -1
- package/src/supplysources_v2020_07_01/ApiClient.js +5 -1
- package/src/tokens_v2021_03_01/ApiClient.js +5 -1
- package/src/transfers_v2024_06_01/ApiClient.js +5 -1
- package/src/uploads_v2020_11_01/ApiClient.js +5 -1
- package/src/vehicles_v2024_11_01/ApiClient.js +5 -1
- package/src/vendordfinventory_v1/ApiClient.js +5 -1
- package/src/vendordforders_v2021_12_28/ApiClient.js +5 -1
- package/src/vendordfpayments_v1/ApiClient.js +5 -1
- package/src/vendordfshipping_v2021_12_28/ApiClient.js +5 -1
- package/src/vendordftransactions_v2021_12_28/ApiClient.js +5 -1
- package/src/vendorinvoices_v1/ApiClient.js +5 -1
- package/src/vendororders_v1/ApiClient.js +5 -1
- package/src/vendorshipments_v1/ApiClient.js +5 -1
- package/src/vendorshipments_v1/api/VendorShippingApi.js +2 -2
- package/src/vendorshipments_v1/model/Shipment.js +3 -3
- package/src/vendortransactionstatus_v1/ApiClient.js +5 -1
- package/src/orders_v0/model/ExportInfo.js +0 -69
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Selling Partner API for Amazon Seller Wallet Open Banking API
|
|
3
|
+
* The Selling Partner API for Seller Wallet (Seller Wallet API) provides financial information that is relevant to a seller's Seller Wallet account. You can obtain financial events, balances, and transfer schedules for Seller Wallet accounts. You can also schedule and initiate transactions.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 2024-03-01
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { ApiClient } from '../ApiClient.js'
|
|
15
|
+
import { BalanceListing } from '../model/BalanceListing.js'
|
|
16
|
+
import { BankAccount } from '../model/BankAccount.js'
|
|
17
|
+
import { BankAccountListing } from '../model/BankAccountListing.js'
|
|
18
|
+
import { ErrorList } from '../model/ErrorList.js'
|
|
19
|
+
import { SuperagentRateLimiter } from '../../../helper/SuperagentRateLimiter.mjs'
|
|
20
|
+
import { DefaultRateLimitFetcher } from '../../../helper/DefaultRateLimitFetcher.mjs'
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Accounts service.
|
|
24
|
+
* @module sellerWallet_2024_03_01/api/AccountsApi
|
|
25
|
+
* @version 2024-03-01
|
|
26
|
+
*/
|
|
27
|
+
export class AccountsApi {
|
|
28
|
+
// Private memeber stores the default rate limiters
|
|
29
|
+
#defaultRateLimiterMap
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Constructs a new AccountsApi.
|
|
33
|
+
* @alias module:sellerWallet_2024_03_01/api/AccountsApi
|
|
34
|
+
* @class
|
|
35
|
+
* @param {module:sellerWallet_2024_03_01/ApiClient} [apiClient] Optional API client implementation to use,
|
|
36
|
+
* default to {@link module:sellerWallet_2024_03_01/ApiClient#instance} if unspecified.
|
|
37
|
+
*/
|
|
38
|
+
constructor (apiClient) {
|
|
39
|
+
this.apiClient = apiClient || ApiClient.instance
|
|
40
|
+
this.initializeDefaultRateLimiterMap()
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Initialize rate limiters for API operations
|
|
45
|
+
*/
|
|
46
|
+
initializeDefaultRateLimiterMap () {
|
|
47
|
+
this.#defaultRateLimiterMap = new Map()
|
|
48
|
+
const defaultRateLimitFetcher = new DefaultRateLimitFetcher()
|
|
49
|
+
const operations = [
|
|
50
|
+
'AccountsApi-getAccount',
|
|
51
|
+
'AccountsApi-listAccountBalances',
|
|
52
|
+
'AccountsApi-listAccounts'
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
for (const operation of operations) {
|
|
56
|
+
const config = defaultRateLimitFetcher.getLimit(operation)
|
|
57
|
+
this.#defaultRateLimiterMap.set(operation, new SuperagentRateLimiter(config))
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Get rate limiter for a specific operation
|
|
63
|
+
* @param {String} operation name
|
|
64
|
+
*/
|
|
65
|
+
getRateLimiter (operation) {
|
|
66
|
+
return this.#defaultRateLimiterMap.get(operation)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Find particular Amazon Seller Wallet account by Amazon account identifier
|
|
71
|
+
* Retrieve an Amazon Seller Wallet bank account by Amazon account identifier.
|
|
72
|
+
* @param {String} accountId The ID of the Amazon Seller Wallet account.
|
|
73
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:sellerWallet_2024_03_01/model/BankAccount} and HTTP response
|
|
74
|
+
*/
|
|
75
|
+
getAccountWithHttpInfo (accountId) {
|
|
76
|
+
const postBody = null
|
|
77
|
+
|
|
78
|
+
// verify the required parameter 'accountId' is set
|
|
79
|
+
if (accountId === undefined || accountId === null) {
|
|
80
|
+
throw new Error("Missing the required parameter 'accountId' when calling getAccount")
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const pathParams = {
|
|
84
|
+
accountId
|
|
85
|
+
}
|
|
86
|
+
const queryParams = {
|
|
87
|
+
}
|
|
88
|
+
const headerParams = {
|
|
89
|
+
}
|
|
90
|
+
const formParams = {
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const contentTypes = []
|
|
94
|
+
const accepts = ['application/json']
|
|
95
|
+
const returnType = BankAccount
|
|
96
|
+
|
|
97
|
+
return this.apiClient.callApi('AccountsApi-getAccount',
|
|
98
|
+
'/finances/transfers/wallet/2024-03-01/accounts/{accountId}', 'GET',
|
|
99
|
+
pathParams, queryParams, headerParams, formParams, postBody,
|
|
100
|
+
contentTypes, accepts, returnType, this.getRateLimiter('AccountsApi-getAccount')
|
|
101
|
+
)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Find particular Amazon Seller Wallet account by Amazon account identifier
|
|
106
|
+
* Retrieve an Amazon Seller Wallet bank account by Amazon account identifier.
|
|
107
|
+
* @param {String} accountId The ID of the Amazon Seller Wallet account.
|
|
108
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:sellerWallet_2024_03_01/model/BankAccount}
|
|
109
|
+
*/
|
|
110
|
+
getAccount (accountId) {
|
|
111
|
+
return this.getAccountWithHttpInfo(accountId)
|
|
112
|
+
.then(function (response_and_data) {
|
|
113
|
+
return response_and_data.data
|
|
114
|
+
})
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Find balance in particular Amazon Seller Wallet account by Amazon account identifier
|
|
119
|
+
* Retrieve the balance in a given Amazon Seller Wallet bank account.
|
|
120
|
+
* @param {String} accountId The ID of the Amazon Seller Wallet account.
|
|
121
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:sellerWallet_2024_03_01/model/BalanceListing} and HTTP response
|
|
122
|
+
*/
|
|
123
|
+
listAccountBalancesWithHttpInfo (accountId) {
|
|
124
|
+
const postBody = null
|
|
125
|
+
|
|
126
|
+
// verify the required parameter 'accountId' is set
|
|
127
|
+
if (accountId === undefined || accountId === null) {
|
|
128
|
+
throw new Error("Missing the required parameter 'accountId' when calling listAccountBalances")
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const pathParams = {
|
|
132
|
+
accountId
|
|
133
|
+
}
|
|
134
|
+
const queryParams = {
|
|
135
|
+
}
|
|
136
|
+
const headerParams = {
|
|
137
|
+
}
|
|
138
|
+
const formParams = {
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const contentTypes = []
|
|
142
|
+
const accepts = ['application/json']
|
|
143
|
+
const returnType = BalanceListing
|
|
144
|
+
|
|
145
|
+
return this.apiClient.callApi('AccountsApi-listAccountBalances',
|
|
146
|
+
'/finances/transfers/wallet/2024-03-01/accounts/{accountId}/balance', 'GET',
|
|
147
|
+
pathParams, queryParams, headerParams, formParams, postBody,
|
|
148
|
+
contentTypes, accepts, returnType, this.getRateLimiter('AccountsApi-listAccountBalances')
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Find balance in particular Amazon Seller Wallet account by Amazon account identifier
|
|
154
|
+
* Retrieve the balance in a given Amazon Seller Wallet bank account.
|
|
155
|
+
* @param {String} accountId The ID of the Amazon Seller Wallet account.
|
|
156
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:sellerWallet_2024_03_01/model/BalanceListing}
|
|
157
|
+
*/
|
|
158
|
+
listAccountBalances (accountId) {
|
|
159
|
+
return this.listAccountBalancesWithHttpInfo(accountId)
|
|
160
|
+
.then(function (response_and_data) {
|
|
161
|
+
return response_and_data.data
|
|
162
|
+
})
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Get all Amazon Seller Wallet accounts for the seller
|
|
167
|
+
* Get all Seller Wallet accounts for a given seller.
|
|
168
|
+
* @param {String} marketplaceId The marketplace for which items are returned. The marketplace ID is the globally unique identifier of a marketplace. To find the ID for your marketplace, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
|
|
169
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:sellerWallet_2024_03_01/model/BankAccountListing} and HTTP response
|
|
170
|
+
*/
|
|
171
|
+
listAccountsWithHttpInfo (marketplaceId) {
|
|
172
|
+
const postBody = null
|
|
173
|
+
|
|
174
|
+
// verify the required parameter 'marketplaceId' is set
|
|
175
|
+
if (marketplaceId === undefined || marketplaceId === null) {
|
|
176
|
+
throw new Error("Missing the required parameter 'marketplaceId' when calling listAccounts")
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const pathParams = {
|
|
180
|
+
}
|
|
181
|
+
const queryParams = {
|
|
182
|
+
marketplaceId
|
|
183
|
+
}
|
|
184
|
+
const headerParams = {
|
|
185
|
+
}
|
|
186
|
+
const formParams = {
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const contentTypes = []
|
|
190
|
+
const accepts = ['application/json']
|
|
191
|
+
const returnType = BankAccountListing
|
|
192
|
+
|
|
193
|
+
return this.apiClient.callApi('AccountsApi-listAccounts',
|
|
194
|
+
'/finances/transfers/wallet/2024-03-01/accounts', 'GET',
|
|
195
|
+
pathParams, queryParams, headerParams, formParams, postBody,
|
|
196
|
+
contentTypes, accepts, returnType, this.getRateLimiter('AccountsApi-listAccounts')
|
|
197
|
+
)
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Get all Amazon Seller Wallet accounts for the seller
|
|
202
|
+
* Get all Seller Wallet accounts for a given seller.
|
|
203
|
+
* @param {String} marketplaceId The marketplace for which items are returned. The marketplace ID is the globally unique identifier of a marketplace. To find the ID for your marketplace, refer to [Marketplace IDs](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids).
|
|
204
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:sellerWallet_2024_03_01/model/BankAccountListing}
|
|
205
|
+
*/
|
|
206
|
+
listAccounts (marketplaceId) {
|
|
207
|
+
return this.listAccountsWithHttpInfo(marketplaceId)
|
|
208
|
+
.then(function (response_and_data) {
|
|
209
|
+
return response_and_data.data
|
|
210
|
+
})
|
|
211
|
+
}
|
|
212
|
+
}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Selling Partner API for Amazon Seller Wallet Open Banking API
|
|
3
|
+
* The Selling Partner API for Seller Wallet (Seller Wallet API) provides financial information that is relevant to a seller's Seller Wallet account. You can obtain financial events, balances, and transfer schedules for Seller Wallet accounts. You can also schedule and initiate transactions.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 2024-03-01
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { ApiClient } from '../ApiClient.js'
|
|
15
|
+
import { ErrorList } from '../model/ErrorList.js'
|
|
16
|
+
import { Transaction } from '../model/Transaction.js'
|
|
17
|
+
import { TransactionInitiationRequest } from '../model/TransactionInitiationRequest.js'
|
|
18
|
+
import { TransactionListing } from '../model/TransactionListing.js'
|
|
19
|
+
import { SuperagentRateLimiter } from '../../../helper/SuperagentRateLimiter.mjs'
|
|
20
|
+
import { DefaultRateLimitFetcher } from '../../../helper/DefaultRateLimitFetcher.mjs'
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Transactions service.
|
|
24
|
+
* @module sellerWallet_2024_03_01/api/TransactionsApi
|
|
25
|
+
* @version 2024-03-01
|
|
26
|
+
*/
|
|
27
|
+
export class TransactionsApi {
|
|
28
|
+
// Private memeber stores the default rate limiters
|
|
29
|
+
#defaultRateLimiterMap
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Constructs a new TransactionsApi.
|
|
33
|
+
* @alias module:sellerWallet_2024_03_01/api/TransactionsApi
|
|
34
|
+
* @class
|
|
35
|
+
* @param {module:sellerWallet_2024_03_01/ApiClient} [apiClient] Optional API client implementation to use,
|
|
36
|
+
* default to {@link module:sellerWallet_2024_03_01/ApiClient#instance} if unspecified.
|
|
37
|
+
*/
|
|
38
|
+
constructor (apiClient) {
|
|
39
|
+
this.apiClient = apiClient || ApiClient.instance
|
|
40
|
+
this.initializeDefaultRateLimiterMap()
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Initialize rate limiters for API operations
|
|
45
|
+
*/
|
|
46
|
+
initializeDefaultRateLimiterMap () {
|
|
47
|
+
this.#defaultRateLimiterMap = new Map()
|
|
48
|
+
const defaultRateLimitFetcher = new DefaultRateLimitFetcher()
|
|
49
|
+
const operations = [
|
|
50
|
+
'TransactionsApi-createTransaction',
|
|
51
|
+
'TransactionsApi-getTransaction',
|
|
52
|
+
'TransactionsApi-listAccountTransactions'
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
for (const operation of operations) {
|
|
56
|
+
const config = defaultRateLimitFetcher.getLimit(operation)
|
|
57
|
+
this.#defaultRateLimiterMap.set(operation, new SuperagentRateLimiter(config))
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Get rate limiter for a specific operation
|
|
63
|
+
* @param {String} operation name
|
|
64
|
+
*/
|
|
65
|
+
getRateLimiter (operation) {
|
|
66
|
+
return this.#defaultRateLimiterMap.get(operation)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Create a transaction request from Amazon Seller Wallet account to another customer-provided account
|
|
71
|
+
* Create a transaction request from an Amazon Seller Wallet account to another customer-provided account.
|
|
72
|
+
* @param {String} destAccountDigitalSignature Digital signature for the destination bank account details.
|
|
73
|
+
* @param {String} amountDigitalSignature Digital signature for the source currency transaction amount.
|
|
74
|
+
* @param {module:sellerWallet_2024_03_01/model/TransactionInitiationRequest} body The payload of the request
|
|
75
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:sellerWallet_2024_03_01/model/Transaction} and HTTP response
|
|
76
|
+
*/
|
|
77
|
+
createTransactionWithHttpInfo (destAccountDigitalSignature, amountDigitalSignature, body) {
|
|
78
|
+
const postBody = body
|
|
79
|
+
|
|
80
|
+
// verify the required parameter 'destAccountDigitalSignature' is set
|
|
81
|
+
if (destAccountDigitalSignature === undefined || destAccountDigitalSignature === null) {
|
|
82
|
+
throw new Error("Missing the required parameter 'destAccountDigitalSignature' when calling createTransaction")
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// verify the required parameter 'amountDigitalSignature' is set
|
|
86
|
+
if (amountDigitalSignature === undefined || amountDigitalSignature === null) {
|
|
87
|
+
throw new Error("Missing the required parameter 'amountDigitalSignature' when calling createTransaction")
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// verify the required parameter 'body' is set
|
|
91
|
+
if (body === undefined || body === null) {
|
|
92
|
+
throw new Error("Missing the required parameter 'body' when calling createTransaction")
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const pathParams = {
|
|
96
|
+
}
|
|
97
|
+
const queryParams = {
|
|
98
|
+
}
|
|
99
|
+
const headerParams = {
|
|
100
|
+
destAccountDigitalSignature,
|
|
101
|
+
amountDigitalSignature
|
|
102
|
+
}
|
|
103
|
+
const formParams = {
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const contentTypes = ['application/json']
|
|
107
|
+
const accepts = ['application/json']
|
|
108
|
+
const returnType = Transaction
|
|
109
|
+
|
|
110
|
+
return this.apiClient.callApi('TransactionsApi-createTransaction',
|
|
111
|
+
'/finances/transfers/wallet/2024-03-01/transactions', 'POST',
|
|
112
|
+
pathParams, queryParams, headerParams, formParams, postBody,
|
|
113
|
+
contentTypes, accepts, returnType, this.getRateLimiter('TransactionsApi-createTransaction')
|
|
114
|
+
)
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Create a transaction request from Amazon Seller Wallet account to another customer-provided account
|
|
119
|
+
* Create a transaction request from an Amazon Seller Wallet account to another customer-provided account.
|
|
120
|
+
* @param {String} destAccountDigitalSignature Digital signature for the destination bank account details.
|
|
121
|
+
* @param {String} amountDigitalSignature Digital signature for the source currency transaction amount.
|
|
122
|
+
* @param {module:sellerWallet_2024_03_01/model/TransactionInitiationRequest} body The payload of the request
|
|
123
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:sellerWallet_2024_03_01/model/Transaction}
|
|
124
|
+
*/
|
|
125
|
+
createTransaction (destAccountDigitalSignature, amountDigitalSignature, body) {
|
|
126
|
+
return this.createTransactionWithHttpInfo(destAccountDigitalSignature, amountDigitalSignature, body)
|
|
127
|
+
.then(function (response_and_data) {
|
|
128
|
+
return response_and_data.data
|
|
129
|
+
})
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Find particular Amazon Seller Wallet account transaction by Amazon transaction identifier
|
|
134
|
+
* Find a transaction by the Amazon transaction identifier.
|
|
135
|
+
* @param {String} transactionId The ID of the Amazon Seller Wallet transaction.
|
|
136
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:sellerWallet_2024_03_01/model/Transaction} and HTTP response
|
|
137
|
+
*/
|
|
138
|
+
getTransactionWithHttpInfo (transactionId) {
|
|
139
|
+
const postBody = null
|
|
140
|
+
|
|
141
|
+
// verify the required parameter 'transactionId' is set
|
|
142
|
+
if (transactionId === undefined || transactionId === null) {
|
|
143
|
+
throw new Error("Missing the required parameter 'transactionId' when calling getTransaction")
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const pathParams = {
|
|
147
|
+
transactionId
|
|
148
|
+
}
|
|
149
|
+
const queryParams = {
|
|
150
|
+
}
|
|
151
|
+
const headerParams = {
|
|
152
|
+
}
|
|
153
|
+
const formParams = {
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const contentTypes = []
|
|
157
|
+
const accepts = ['application/json']
|
|
158
|
+
const returnType = Transaction
|
|
159
|
+
|
|
160
|
+
return this.apiClient.callApi('TransactionsApi-getTransaction',
|
|
161
|
+
'/finances/transfers/wallet/2024-03-01/transactions/{transactionId}', 'GET',
|
|
162
|
+
pathParams, queryParams, headerParams, formParams, postBody,
|
|
163
|
+
contentTypes, accepts, returnType, this.getRateLimiter('TransactionsApi-getTransaction')
|
|
164
|
+
)
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Find particular Amazon Seller Wallet account transaction by Amazon transaction identifier
|
|
169
|
+
* Find a transaction by the Amazon transaction identifier.
|
|
170
|
+
* @param {String} transactionId The ID of the Amazon Seller Wallet transaction.
|
|
171
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:sellerWallet_2024_03_01/model/Transaction}
|
|
172
|
+
*/
|
|
173
|
+
getTransaction (transactionId) {
|
|
174
|
+
return this.getTransactionWithHttpInfo(transactionId)
|
|
175
|
+
.then(function (response_and_data) {
|
|
176
|
+
return response_and_data.data
|
|
177
|
+
})
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* The API will return all the transactions for a given Amazon Seller Wallet account sorted by the transaction request date
|
|
182
|
+
* Retrieve a list of transactions for a given Amazon Seller Wallet bank account.
|
|
183
|
+
* @param {String} accountId The ID of the Amazon Seller Wallet account.
|
|
184
|
+
* @param {Object} opts Optional parameters
|
|
185
|
+
* @param {String} opts.nextPageToken A token that you use to retrieve the next page of results. The response includes `nextPageToken` when the number of results exceeds 100. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until `nextPageToken` is null. Note that this operation can return empty pages.
|
|
186
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:sellerWallet_2024_03_01/model/TransactionListing} and HTTP response
|
|
187
|
+
*/
|
|
188
|
+
listAccountTransactionsWithHttpInfo (accountId, opts) {
|
|
189
|
+
opts = opts || {}
|
|
190
|
+
const postBody = null
|
|
191
|
+
|
|
192
|
+
// verify the required parameter 'accountId' is set
|
|
193
|
+
if (accountId === undefined || accountId === null) {
|
|
194
|
+
throw new Error("Missing the required parameter 'accountId' when calling listAccountTransactions")
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
const pathParams = {
|
|
198
|
+
}
|
|
199
|
+
const queryParams = {
|
|
200
|
+
accountId,
|
|
201
|
+
nextPageToken: opts.nextPageToken
|
|
202
|
+
}
|
|
203
|
+
const headerParams = {
|
|
204
|
+
}
|
|
205
|
+
const formParams = {
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
const contentTypes = []
|
|
209
|
+
const accepts = ['application/json']
|
|
210
|
+
const returnType = TransactionListing
|
|
211
|
+
|
|
212
|
+
return this.apiClient.callApi('TransactionsApi-listAccountTransactions',
|
|
213
|
+
'/finances/transfers/wallet/2024-03-01/transactions', 'GET',
|
|
214
|
+
pathParams, queryParams, headerParams, formParams, postBody,
|
|
215
|
+
contentTypes, accepts, returnType, this.getRateLimiter('TransactionsApi-listAccountTransactions')
|
|
216
|
+
)
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* The API will return all the transactions for a given Amazon Seller Wallet account sorted by the transaction request date
|
|
221
|
+
* Retrieve a list of transactions for a given Amazon Seller Wallet bank account.
|
|
222
|
+
* @param {String} accountId The ID of the Amazon Seller Wallet account.
|
|
223
|
+
* @param {Object} opts Optional parameters
|
|
224
|
+
* @param {String} opts.nextPageToken A token that you use to retrieve the next page of results. The response includes `nextPageToken` when the number of results exceeds 100. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until `nextPageToken` is null. Note that this operation can return empty pages.
|
|
225
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:sellerWallet_2024_03_01/model/TransactionListing}
|
|
226
|
+
*/
|
|
227
|
+
listAccountTransactions (accountId, opts) {
|
|
228
|
+
return this.listAccountTransactionsWithHttpInfo(accountId, opts)
|
|
229
|
+
.then(function (response_and_data) {
|
|
230
|
+
return response_and_data.data
|
|
231
|
+
})
|
|
232
|
+
}
|
|
233
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Selling Partner API for Amazon Seller Wallet Open Banking API
|
|
3
|
+
* The Selling Partner API for Seller Wallet (Seller Wallet API) provides financial information that is relevant to a seller's Seller Wallet account. You can obtain financial events, balances, and transfer schedules for Seller Wallet accounts. You can also schedule and initiate transactions.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 2024-03-01
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { ApiClient } from '../ApiClient.js'
|
|
15
|
+
import { ErrorList } from '../model/ErrorList.js'
|
|
16
|
+
import { TransferRatePreview } from '../model/TransferRatePreview.js'
|
|
17
|
+
import { SuperagentRateLimiter } from '../../../helper/SuperagentRateLimiter.mjs'
|
|
18
|
+
import { DefaultRateLimitFetcher } from '../../../helper/DefaultRateLimitFetcher.mjs'
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* TransferPreview service.
|
|
22
|
+
* @module sellerWallet_2024_03_01/api/TransferPreviewApi
|
|
23
|
+
* @version 2024-03-01
|
|
24
|
+
*/
|
|
25
|
+
export class TransferPreviewApi {
|
|
26
|
+
// Private memeber stores the default rate limiters
|
|
27
|
+
#defaultRateLimiterMap
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Constructs a new TransferPreviewApi.
|
|
31
|
+
* @alias module:sellerWallet_2024_03_01/api/TransferPreviewApi
|
|
32
|
+
* @class
|
|
33
|
+
* @param {module:sellerWallet_2024_03_01/ApiClient} [apiClient] Optional API client implementation to use,
|
|
34
|
+
* default to {@link module:sellerWallet_2024_03_01/ApiClient#instance} if unspecified.
|
|
35
|
+
*/
|
|
36
|
+
constructor (apiClient) {
|
|
37
|
+
this.apiClient = apiClient || ApiClient.instance
|
|
38
|
+
this.initializeDefaultRateLimiterMap()
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Initialize rate limiters for API operations
|
|
43
|
+
*/
|
|
44
|
+
initializeDefaultRateLimiterMap () {
|
|
45
|
+
this.#defaultRateLimiterMap = new Map()
|
|
46
|
+
const defaultRateLimitFetcher = new DefaultRateLimitFetcher()
|
|
47
|
+
const operations = [
|
|
48
|
+
'TransferPreviewApi-getTransferPreview'
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
for (const operation of operations) {
|
|
52
|
+
const config = defaultRateLimitFetcher.getLimit(operation)
|
|
53
|
+
this.#defaultRateLimiterMap.set(operation, new SuperagentRateLimiter(config))
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Get rate limiter for a specific operation
|
|
59
|
+
* @param {String} operation name
|
|
60
|
+
*/
|
|
61
|
+
getRateLimiter (operation) {
|
|
62
|
+
return this.#defaultRateLimiterMap.get(operation)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Fetch potential fees that could be applied on a transaction on the basis of the source and destination country currency code
|
|
67
|
+
* Retrieve a list of potential fees on a transaction.
|
|
68
|
+
* @param {String} sourceCountryCode Country code of the source transaction account in ISO 3166 format.
|
|
69
|
+
* @param {String} sourceCurrencyCode Currency code of the source transaction country in ISO 4217 format.
|
|
70
|
+
* @param {String} destinationCountryCode Country code of the destination transaction account in ISO 3166 format.
|
|
71
|
+
* @param {String} destinationCurrencyCode Currency code of the destination transaction country in ISO 4217 format.
|
|
72
|
+
* @param {Number} baseAmount The base transaction amount without any markup fees.
|
|
73
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:sellerWallet_2024_03_01/model/TransferRatePreview} and HTTP response
|
|
74
|
+
*/
|
|
75
|
+
getTransferPreviewWithHttpInfo (sourceCountryCode, sourceCurrencyCode, destinationCountryCode, destinationCurrencyCode, baseAmount) {
|
|
76
|
+
const postBody = null
|
|
77
|
+
|
|
78
|
+
// verify the required parameter 'sourceCountryCode' is set
|
|
79
|
+
if (sourceCountryCode === undefined || sourceCountryCode === null) {
|
|
80
|
+
throw new Error("Missing the required parameter 'sourceCountryCode' when calling getTransferPreview")
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// verify the required parameter 'sourceCurrencyCode' is set
|
|
84
|
+
if (sourceCurrencyCode === undefined || sourceCurrencyCode === null) {
|
|
85
|
+
throw new Error("Missing the required parameter 'sourceCurrencyCode' when calling getTransferPreview")
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// verify the required parameter 'destinationCountryCode' is set
|
|
89
|
+
if (destinationCountryCode === undefined || destinationCountryCode === null) {
|
|
90
|
+
throw new Error("Missing the required parameter 'destinationCountryCode' when calling getTransferPreview")
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// verify the required parameter 'destinationCurrencyCode' is set
|
|
94
|
+
if (destinationCurrencyCode === undefined || destinationCurrencyCode === null) {
|
|
95
|
+
throw new Error("Missing the required parameter 'destinationCurrencyCode' when calling getTransferPreview")
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// verify the required parameter 'baseAmount' is set
|
|
99
|
+
if (baseAmount === undefined || baseAmount === null) {
|
|
100
|
+
throw new Error("Missing the required parameter 'baseAmount' when calling getTransferPreview")
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const pathParams = {
|
|
104
|
+
}
|
|
105
|
+
const queryParams = {
|
|
106
|
+
sourceCountryCode,
|
|
107
|
+
sourceCurrencyCode,
|
|
108
|
+
destinationCountryCode,
|
|
109
|
+
destinationCurrencyCode,
|
|
110
|
+
baseAmount
|
|
111
|
+
}
|
|
112
|
+
const headerParams = {
|
|
113
|
+
}
|
|
114
|
+
const formParams = {
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const contentTypes = []
|
|
118
|
+
const accepts = ['application/json']
|
|
119
|
+
const returnType = TransferRatePreview
|
|
120
|
+
|
|
121
|
+
return this.apiClient.callApi('TransferPreviewApi-getTransferPreview',
|
|
122
|
+
'/finances/transfers/wallet/2024-03-01/transferPreview', 'GET',
|
|
123
|
+
pathParams, queryParams, headerParams, formParams, postBody,
|
|
124
|
+
contentTypes, accepts, returnType, this.getRateLimiter('TransferPreviewApi-getTransferPreview')
|
|
125
|
+
)
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Fetch potential fees that could be applied on a transaction on the basis of the source and destination country currency code
|
|
130
|
+
* Retrieve a list of potential fees on a transaction.
|
|
131
|
+
* @param {String} sourceCountryCode Country code of the source transaction account in ISO 3166 format.
|
|
132
|
+
* @param {String} sourceCurrencyCode Currency code of the source transaction country in ISO 4217 format.
|
|
133
|
+
* @param {String} destinationCountryCode Country code of the destination transaction account in ISO 3166 format.
|
|
134
|
+
* @param {String} destinationCurrencyCode Currency code of the destination transaction country in ISO 4217 format.
|
|
135
|
+
* @param {Number} baseAmount The base transaction amount without any markup fees.
|
|
136
|
+
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:sellerWallet_2024_03_01/model/TransferRatePreview}
|
|
137
|
+
*/
|
|
138
|
+
getTransferPreview (sourceCountryCode, sourceCurrencyCode, destinationCountryCode, destinationCurrencyCode, baseAmount) {
|
|
139
|
+
return this.getTransferPreviewWithHttpInfo(sourceCountryCode, sourceCurrencyCode, destinationCountryCode, destinationCurrencyCode, baseAmount)
|
|
140
|
+
.then(function (response_and_data) {
|
|
141
|
+
return response_and_data.data
|
|
142
|
+
})
|
|
143
|
+
}
|
|
144
|
+
}
|