@congminh1254/shopee-sdk 0.10.0 → 1.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/README.md +172 -36
- package/lib/fetch.js +13 -0
- package/lib/fetch.js.map +1 -1
- package/lib/managers/add-on-deal.manager.d.ts +140 -0
- package/lib/managers/add-on-deal.manager.js +240 -0
- package/lib/managers/add-on-deal.manager.js.map +1 -0
- package/lib/managers/ads.manager.d.ts +217 -1
- package/lib/managers/ads.manager.js +312 -0
- package/lib/managers/ads.manager.js.map +1 -1
- package/lib/managers/bundle-deal.manager.d.ts +106 -0
- package/lib/managers/bundle-deal.manager.js +178 -0
- package/lib/managers/bundle-deal.manager.js.map +1 -0
- package/lib/managers/discount.manager.d.ts +102 -0
- package/lib/managers/discount.manager.js +167 -0
- package/lib/managers/discount.manager.js.map +1 -0
- package/lib/managers/fbs.manager.d.ts +115 -0
- package/lib/managers/fbs.manager.js +145 -0
- package/lib/managers/fbs.manager.js.map +1 -0
- package/lib/managers/first-mile.manager.d.ts +150 -0
- package/lib/managers/first-mile.manager.js +264 -0
- package/lib/managers/first-mile.manager.js.map +1 -0
- package/lib/managers/follow-prize.manager.d.ts +108 -0
- package/lib/managers/follow-prize.manager.js +152 -0
- package/lib/managers/follow-prize.manager.js.map +1 -0
- package/lib/managers/global-product.manager.d.ts +664 -0
- package/lib/managers/global-product.manager.js +904 -0
- package/lib/managers/global-product.manager.js.map +1 -0
- package/lib/managers/index.d.ts +17 -1
- package/lib/managers/index.js +17 -1
- package/lib/managers/index.js.map +1 -1
- package/lib/managers/livestream.manager.d.ts +377 -0
- package/lib/managers/livestream.manager.js +529 -0
- package/lib/managers/livestream.manager.js.map +1 -0
- package/lib/managers/logistics.manager.d.ts +267 -1
- package/lib/managers/logistics.manager.js +544 -0
- package/lib/managers/logistics.manager.js.map +1 -1
- package/lib/managers/media-space.manager.d.ts +179 -0
- package/lib/managers/media-space.manager.js +220 -0
- package/lib/managers/media-space.manager.js.map +1 -0
- package/lib/managers/media.manager.d.ts +226 -0
- package/lib/managers/media.manager.js +274 -0
- package/lib/managers/media.manager.js.map +1 -0
- package/lib/managers/merchant.manager.d.ts +100 -0
- package/lib/managers/merchant.manager.js +144 -0
- package/lib/managers/merchant.manager.js.map +1 -0
- package/lib/managers/order.manager.d.ts +213 -1
- package/lib/managers/order.manager.js +305 -0
- package/lib/managers/order.manager.js.map +1 -1
- package/lib/managers/payment.manager.d.ts +186 -1
- package/lib/managers/payment.manager.js +288 -0
- package/lib/managers/payment.manager.js.map +1 -1
- package/lib/managers/returns.manager.d.ts +200 -0
- package/lib/managers/returns.manager.js +300 -0
- package/lib/managers/returns.manager.js.map +1 -0
- package/lib/managers/sbs.manager.d.ts +112 -0
- package/lib/managers/sbs.manager.js +149 -0
- package/lib/managers/sbs.manager.js.map +1 -0
- package/lib/managers/shop-category.manager.d.ts +207 -0
- package/lib/managers/shop-category.manager.js +258 -0
- package/lib/managers/shop-category.manager.js.map +1 -0
- package/lib/managers/shop-flash-sale.manager.d.ts +242 -0
- package/lib/managers/shop-flash-sale.manager.js +321 -0
- package/lib/managers/shop-flash-sale.manager.js.map +1 -0
- package/lib/managers/shop.manager.d.ts +173 -0
- package/lib/managers/shop.manager.js +217 -0
- package/lib/managers/shop.manager.js.map +1 -0
- package/lib/managers/top-picks.manager.d.ts +62 -0
- package/lib/managers/top-picks.manager.js +91 -0
- package/lib/managers/top-picks.manager.js.map +1 -0
- package/lib/schemas/add-on-deal.d.ts +390 -0
- package/lib/schemas/add-on-deal.js +45 -0
- package/lib/schemas/add-on-deal.js.map +1 -0
- package/lib/schemas/ads.d.ts +437 -0
- package/lib/schemas/bundle-deal.d.ts +300 -0
- package/lib/schemas/bundle-deal.js +27 -0
- package/lib/schemas/bundle-deal.js.map +1 -0
- package/lib/schemas/discount.d.ts +334 -0
- package/lib/schemas/discount.js +15 -0
- package/lib/schemas/discount.js.map +1 -0
- package/lib/schemas/fbs.d.ts +117 -0
- package/lib/schemas/fbs.js +2 -0
- package/lib/schemas/fbs.js.map +1 -0
- package/lib/schemas/first-mile.d.ts +551 -0
- package/lib/schemas/first-mile.js +2 -0
- package/lib/schemas/first-mile.js.map +1 -0
- package/lib/schemas/follow-prize.d.ts +198 -0
- package/lib/schemas/follow-prize.js +27 -0
- package/lib/schemas/follow-prize.js.map +1 -0
- package/lib/schemas/global-product.d.ts +1127 -0
- package/lib/schemas/global-product.js +2 -0
- package/lib/schemas/global-product.js.map +1 -0
- package/lib/schemas/index.d.ts +13 -0
- package/lib/schemas/index.js +17 -0
- package/lib/schemas/index.js.map +1 -1
- package/lib/schemas/livestream.d.ts +649 -0
- package/lib/schemas/livestream.js +2 -0
- package/lib/schemas/livestream.js.map +1 -0
- package/lib/schemas/logistics.d.ts +979 -0
- package/lib/schemas/logistics.js +13 -0
- package/lib/schemas/logistics.js.map +1 -1
- package/lib/schemas/media-space.d.ts +189 -0
- package/lib/schemas/media-space.js +2 -0
- package/lib/schemas/media-space.js.map +1 -0
- package/lib/schemas/media.d.ts +230 -0
- package/lib/schemas/media.js +2 -0
- package/lib/schemas/media.js.map +1 -0
- package/lib/schemas/merchant.d.ts +236 -0
- package/lib/schemas/merchant.js +2 -0
- package/lib/schemas/merchant.js.map +1 -0
- package/lib/schemas/order.d.ts +431 -0
- package/lib/schemas/payment.d.ts +397 -0
- package/lib/schemas/returns.d.ts +632 -0
- package/lib/schemas/returns.js +63 -0
- package/lib/schemas/returns.js.map +1 -0
- package/lib/schemas/sbs.d.ts +484 -0
- package/lib/schemas/sbs.js +2 -0
- package/lib/schemas/sbs.js.map +1 -0
- package/lib/schemas/shop-category.d.ts +176 -0
- package/lib/schemas/shop-category.js +2 -0
- package/lib/schemas/shop-category.js.map +1 -0
- package/lib/schemas/shop-flash-sale.d.ts +473 -0
- package/lib/schemas/shop-flash-sale.js +43 -0
- package/lib/schemas/shop-flash-sale.js.map +1 -0
- package/lib/schemas/shop.d.ts +250 -0
- package/lib/schemas/shop.js +2 -0
- package/lib/schemas/shop.js.map +1 -0
- package/lib/schemas/top-picks.d.ts +99 -0
- package/lib/schemas/top-picks.js +2 -0
- package/lib/schemas/top-picks.js.map +1 -0
- package/lib/sdk.d.ts +34 -0
- package/lib/sdk.js +34 -0
- package/lib/sdk.js.map +1 -1
- package/package.json +2 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ShopeeConfig } from "../sdk.js";
|
|
2
2
|
import { BaseManager } from "./base.manager.js";
|
|
3
|
-
import { GetEscrowDetailParams, GetEscrowDetailResponse } from "../schemas/payment.js";
|
|
3
|
+
import { GetEscrowDetailParams, GetEscrowDetailResponse, GetEscrowListParams, GetEscrowListResponse, GetEscrowDetailBatchParams, GetEscrowDetailBatchResponse, GetWalletTransactionListParams, GetWalletTransactionListResponse, GetPaymentMethodListResponse, GetShopInstallmentStatusResponse, SetShopInstallmentStatusParams, SetShopInstallmentStatusResponse, GetItemInstallmentStatusParams, GetItemInstallmentStatusResponse, SetItemInstallmentStatusParams, SetItemInstallmentStatusResponse, GenerateIncomeReportParams, GenerateIncomeReportResponse, GetIncomeReportParams, GetIncomeReportResponse, GenerateIncomeStatementParams, GenerateIncomeStatementResponse, GetIncomeStatementParams, GetIncomeStatementResponse, GetBillingTransactionInfoParams, GetBillingTransactionInfoResponse, GetPayoutDetailParams, GetPayoutDetailResponse, GetPayoutInfoParams, GetPayoutInfoResponse } from "../schemas/payment.js";
|
|
4
4
|
export declare class PaymentManager extends BaseManager {
|
|
5
5
|
constructor(config: ShopeeConfig);
|
|
6
6
|
/**
|
|
@@ -27,4 +27,189 @@ export declare class PaymentManager extends BaseManager {
|
|
|
27
27
|
* - error_not_found: Order income details not found
|
|
28
28
|
*/
|
|
29
29
|
getEscrowDetail(params: GetEscrowDetailParams): Promise<GetEscrowDetailResponse>;
|
|
30
|
+
/**
|
|
31
|
+
* Use this API to fetch the accounting list of order.
|
|
32
|
+
*
|
|
33
|
+
* @param params - Parameters for getting escrow list
|
|
34
|
+
* @param params.release_time_from - Query start time (timestamp)
|
|
35
|
+
* @param params.release_time_to - Query end time (timestamp)
|
|
36
|
+
* @param params.page_size - Number of pages returned, max: 100, default: 40
|
|
37
|
+
* @param params.page_no - The page number, min: 1, default: 1
|
|
38
|
+
*
|
|
39
|
+
* @returns A promise that resolves to the escrow list response containing:
|
|
40
|
+
* - escrow_list: List of escrow orders with order_sn, payout_amount, and escrow_release_time
|
|
41
|
+
* - more: Indicates whether there are more pages
|
|
42
|
+
*
|
|
43
|
+
* @throws {Error} When the API request fails or returns an error
|
|
44
|
+
*/
|
|
45
|
+
getEscrowList(params: GetEscrowListParams): Promise<GetEscrowListResponse>;
|
|
46
|
+
/**
|
|
47
|
+
* Use this API to fetch the details of order income by batch.
|
|
48
|
+
*
|
|
49
|
+
* @param params - Parameters for getting escrow detail batch
|
|
50
|
+
* @param params.order_sn_list - List of order SNs, limit [1,50]. Recommended 1-20 orders per request
|
|
51
|
+
*
|
|
52
|
+
* @returns A promise that resolves to the escrow detail batch response
|
|
53
|
+
*
|
|
54
|
+
* @throws {Error} When the API request fails or returns an error
|
|
55
|
+
*/
|
|
56
|
+
getEscrowDetailBatch(params: GetEscrowDetailBatchParams): Promise<GetEscrowDetailBatchResponse>;
|
|
57
|
+
/**
|
|
58
|
+
* Use this API to get the transaction records of wallet. Only applicable for local shops.
|
|
59
|
+
*
|
|
60
|
+
* @param params - Parameters for getting wallet transaction list
|
|
61
|
+
* @param params.create_time_from - The start time of the query (timestamp)
|
|
62
|
+
* @param params.create_time_to - The end time of the query (timestamp)
|
|
63
|
+
* @param params.page_no - Offset for pagination, start from 0
|
|
64
|
+
* @param params.page_size - The number of records returned per page, min 1, max 100, default 40
|
|
65
|
+
* @param params.transaction_type - Transaction types filter
|
|
66
|
+
*
|
|
67
|
+
* @returns A promise that resolves to the wallet transaction list response
|
|
68
|
+
*
|
|
69
|
+
* @throws {Error} When the API request fails or returns an error
|
|
70
|
+
*/
|
|
71
|
+
getWalletTransactionList(params: GetWalletTransactionListParams): Promise<GetWalletTransactionListResponse>;
|
|
72
|
+
/**
|
|
73
|
+
* Obtain payment method (no authentication required).
|
|
74
|
+
*
|
|
75
|
+
* @returns A promise that resolves to the payment method list response
|
|
76
|
+
*
|
|
77
|
+
* @throws {Error} When the API request fails or returns an error
|
|
78
|
+
*/
|
|
79
|
+
getPaymentMethodList(): Promise<GetPaymentMethodListResponse>;
|
|
80
|
+
/**
|
|
81
|
+
* Get the installment state of shop.
|
|
82
|
+
*
|
|
83
|
+
* @returns A promise that resolves to the shop installment status response
|
|
84
|
+
*
|
|
85
|
+
* @throws {Error} When the API request fails or returns an error
|
|
86
|
+
*/
|
|
87
|
+
getShopInstallmentStatus(): Promise<GetShopInstallmentStatusResponse>;
|
|
88
|
+
/**
|
|
89
|
+
* Sets the staging capability of shop level.
|
|
90
|
+
*
|
|
91
|
+
* @param params - Parameters for setting shop installment status
|
|
92
|
+
* @param params.installment_enabled - Whether to enable installment for shop
|
|
93
|
+
* @param params.tenure_list - List of tenure months to enable
|
|
94
|
+
*
|
|
95
|
+
* @returns A promise that resolves to the set shop installment status response
|
|
96
|
+
*
|
|
97
|
+
* @throws {Error} When the API request fails or returns an error
|
|
98
|
+
*/
|
|
99
|
+
setShopInstallmentStatus(params: SetShopInstallmentStatusParams): Promise<SetShopInstallmentStatusResponse>;
|
|
100
|
+
/**
|
|
101
|
+
* Get item installment tenures. Only for TH、TW.
|
|
102
|
+
*
|
|
103
|
+
* @param params - Parameters for getting item installment status
|
|
104
|
+
* @param params.item_id - Item ID
|
|
105
|
+
*
|
|
106
|
+
* @returns A promise that resolves to the item installment status response
|
|
107
|
+
*
|
|
108
|
+
* @throws {Error} When the API request fails or returns an error
|
|
109
|
+
*/
|
|
110
|
+
getItemInstallmentStatus(params: GetItemInstallmentStatusParams): Promise<GetItemInstallmentStatusResponse>;
|
|
111
|
+
/**
|
|
112
|
+
* Set item installment. Only for TH、TW.
|
|
113
|
+
*
|
|
114
|
+
* @param params - Parameters for setting item installment status
|
|
115
|
+
* @param params.item_id - Item ID
|
|
116
|
+
* @param params.tenure_list - List of tenure months to enable
|
|
117
|
+
*
|
|
118
|
+
* @returns A promise that resolves to the set item installment status response
|
|
119
|
+
*
|
|
120
|
+
* @throws {Error} When the API request fails or returns an error
|
|
121
|
+
*/
|
|
122
|
+
setItemInstallmentStatus(params: SetItemInstallmentStatusParams): Promise<SetItemInstallmentStatusResponse>;
|
|
123
|
+
/**
|
|
124
|
+
* Trigger income report generation.
|
|
125
|
+
*
|
|
126
|
+
* @param params - Parameters for generating income report
|
|
127
|
+
* @param params.start_time - Start time for the report (timestamp)
|
|
128
|
+
* @param params.end_time - End time for the report (timestamp)
|
|
129
|
+
* @param params.currency - Currency for the report
|
|
130
|
+
*
|
|
131
|
+
* @returns A promise that resolves to the generate income report response
|
|
132
|
+
*
|
|
133
|
+
* @throws {Error} When the API request fails or returns an error
|
|
134
|
+
*/
|
|
135
|
+
generateIncomeReport(params: GenerateIncomeReportParams): Promise<GenerateIncomeReportResponse>;
|
|
136
|
+
/**
|
|
137
|
+
* To query income report status and provide file link if the income report is ready to be downloaded.
|
|
138
|
+
*
|
|
139
|
+
* @param params - Parameters for getting income report
|
|
140
|
+
* @param params.income_report_id - Income report ID
|
|
141
|
+
*
|
|
142
|
+
* @returns A promise that resolves to the get income report response
|
|
143
|
+
*
|
|
144
|
+
* @throws {Error} When the API request fails or returns an error
|
|
145
|
+
*/
|
|
146
|
+
getIncomeReport(params: GetIncomeReportParams): Promise<GetIncomeReportResponse>;
|
|
147
|
+
/**
|
|
148
|
+
* Trigger income statement generation.
|
|
149
|
+
*
|
|
150
|
+
* @param params - Parameters for generating income statement
|
|
151
|
+
* @param params.start_time - Start time for the statement (timestamp)
|
|
152
|
+
* @param params.end_time - End time for the statement (timestamp)
|
|
153
|
+
*
|
|
154
|
+
* @returns A promise that resolves to the generate income statement response
|
|
155
|
+
*
|
|
156
|
+
* @throws {Error} When the API request fails or returns an error
|
|
157
|
+
*/
|
|
158
|
+
generateIncomeStatement(params: GenerateIncomeStatementParams): Promise<GenerateIncomeStatementResponse>;
|
|
159
|
+
/**
|
|
160
|
+
* To query income statement status and provide file link if the income statement is ready to be downloaded.
|
|
161
|
+
*
|
|
162
|
+
* @param params - Parameters for getting income statement
|
|
163
|
+
* @param params.income_statement_id - Income statement ID
|
|
164
|
+
*
|
|
165
|
+
* @returns A promise that resolves to the get income statement response
|
|
166
|
+
*
|
|
167
|
+
* @throws {Error} When the API request fails or returns an error
|
|
168
|
+
*/
|
|
169
|
+
getIncomeStatement(params: GetIncomeStatementParams): Promise<GetIncomeStatementResponse>;
|
|
170
|
+
/**
|
|
171
|
+
* This API is applicable for Cross Border (CB) sellers only to get the detailed payout transaction data,
|
|
172
|
+
* both released and to-be released transaction can be found in here.
|
|
173
|
+
*
|
|
174
|
+
* @param params - Parameters for getting billing transaction info
|
|
175
|
+
* @param params.transaction_time_from - Transaction time from (timestamp)
|
|
176
|
+
* @param params.transaction_time_to - Transaction time to (timestamp)
|
|
177
|
+
* @param params.page_no - Page number, default 1
|
|
178
|
+
* @param params.page_size - Page size, max 100, default 40
|
|
179
|
+
*
|
|
180
|
+
* @returns A promise that resolves to the billing transaction info response
|
|
181
|
+
*
|
|
182
|
+
* @throws {Error} When the API request fails or returns an error
|
|
183
|
+
*/
|
|
184
|
+
getBillingTransactionInfo(params: GetBillingTransactionInfoParams): Promise<GetBillingTransactionInfoResponse>;
|
|
185
|
+
/**
|
|
186
|
+
* This API is applicable for Cross Border (CB) sellers only to get the shop's payout data.
|
|
187
|
+
* @deprecated Use getPayoutInfo instead
|
|
188
|
+
*
|
|
189
|
+
* @param params - Parameters for getting payout detail
|
|
190
|
+
* @param params.payout_time_from - Payout time from (timestamp)
|
|
191
|
+
* @param params.payout_time_to - Payout time to (timestamp)
|
|
192
|
+
* @param params.page_no - Page number, default 1
|
|
193
|
+
* @param params.page_size - Page size, max 100, default 40
|
|
194
|
+
*
|
|
195
|
+
* @returns A promise that resolves to the payout detail response
|
|
196
|
+
*
|
|
197
|
+
* @throws {Error} When the API request fails or returns an error
|
|
198
|
+
*/
|
|
199
|
+
getPayoutDetail(params: GetPayoutDetailParams): Promise<GetPayoutDetailResponse>;
|
|
200
|
+
/**
|
|
201
|
+
* This is a new API which applicable for Cross Border (CB) sellers only to get the shop's payout data,
|
|
202
|
+
* will be used for the original API v2.get_payout_details replacement.
|
|
203
|
+
*
|
|
204
|
+
* @param params - Parameters for getting payout info
|
|
205
|
+
* @param params.payout_time_from - Payout time from (timestamp)
|
|
206
|
+
* @param params.payout_time_to - Payout time to (timestamp)
|
|
207
|
+
* @param params.page_no - Page number, default 1
|
|
208
|
+
* @param params.page_size - Page size, max 100, default 40
|
|
209
|
+
*
|
|
210
|
+
* @returns A promise that resolves to the payout info response
|
|
211
|
+
*
|
|
212
|
+
* @throws {Error} When the API request fails or returns an error
|
|
213
|
+
*/
|
|
214
|
+
getPayoutInfo(params: GetPayoutInfoParams): Promise<GetPayoutInfoResponse>;
|
|
30
215
|
}
|
|
@@ -35,5 +35,293 @@ export class PaymentManager extends BaseManager {
|
|
|
35
35
|
});
|
|
36
36
|
return response;
|
|
37
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Use this API to fetch the accounting list of order.
|
|
40
|
+
*
|
|
41
|
+
* @param params - Parameters for getting escrow list
|
|
42
|
+
* @param params.release_time_from - Query start time (timestamp)
|
|
43
|
+
* @param params.release_time_to - Query end time (timestamp)
|
|
44
|
+
* @param params.page_size - Number of pages returned, max: 100, default: 40
|
|
45
|
+
* @param params.page_no - The page number, min: 1, default: 1
|
|
46
|
+
*
|
|
47
|
+
* @returns A promise that resolves to the escrow list response containing:
|
|
48
|
+
* - escrow_list: List of escrow orders with order_sn, payout_amount, and escrow_release_time
|
|
49
|
+
* - more: Indicates whether there are more pages
|
|
50
|
+
*
|
|
51
|
+
* @throws {Error} When the API request fails or returns an error
|
|
52
|
+
*/
|
|
53
|
+
async getEscrowList(params) {
|
|
54
|
+
const response = await ShopeeFetch.fetch(this.config, "/payment/get_escrow_list", {
|
|
55
|
+
method: "POST",
|
|
56
|
+
auth: true,
|
|
57
|
+
body: params,
|
|
58
|
+
});
|
|
59
|
+
return response;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Use this API to fetch the details of order income by batch.
|
|
63
|
+
*
|
|
64
|
+
* @param params - Parameters for getting escrow detail batch
|
|
65
|
+
* @param params.order_sn_list - List of order SNs, limit [1,50]. Recommended 1-20 orders per request
|
|
66
|
+
*
|
|
67
|
+
* @returns A promise that resolves to the escrow detail batch response
|
|
68
|
+
*
|
|
69
|
+
* @throws {Error} When the API request fails or returns an error
|
|
70
|
+
*/
|
|
71
|
+
async getEscrowDetailBatch(params) {
|
|
72
|
+
const response = await ShopeeFetch.fetch(this.config, "/payment/get_escrow_detail_batch", {
|
|
73
|
+
method: "GET",
|
|
74
|
+
auth: true,
|
|
75
|
+
params,
|
|
76
|
+
});
|
|
77
|
+
return response;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Use this API to get the transaction records of wallet. Only applicable for local shops.
|
|
81
|
+
*
|
|
82
|
+
* @param params - Parameters for getting wallet transaction list
|
|
83
|
+
* @param params.create_time_from - The start time of the query (timestamp)
|
|
84
|
+
* @param params.create_time_to - The end time of the query (timestamp)
|
|
85
|
+
* @param params.page_no - Offset for pagination, start from 0
|
|
86
|
+
* @param params.page_size - The number of records returned per page, min 1, max 100, default 40
|
|
87
|
+
* @param params.transaction_type - Transaction types filter
|
|
88
|
+
*
|
|
89
|
+
* @returns A promise that resolves to the wallet transaction list response
|
|
90
|
+
*
|
|
91
|
+
* @throws {Error} When the API request fails or returns an error
|
|
92
|
+
*/
|
|
93
|
+
async getWalletTransactionList(params) {
|
|
94
|
+
const response = await ShopeeFetch.fetch(this.config, "/payment/get_wallet_transaction_list", {
|
|
95
|
+
method: "POST",
|
|
96
|
+
auth: true,
|
|
97
|
+
body: params,
|
|
98
|
+
});
|
|
99
|
+
return response;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Obtain payment method (no authentication required).
|
|
103
|
+
*
|
|
104
|
+
* @returns A promise that resolves to the payment method list response
|
|
105
|
+
*
|
|
106
|
+
* @throws {Error} When the API request fails or returns an error
|
|
107
|
+
*/
|
|
108
|
+
async getPaymentMethodList() {
|
|
109
|
+
const response = await ShopeeFetch.fetch(this.config, "/payment/get_payment_method_list", {
|
|
110
|
+
method: "POST",
|
|
111
|
+
auth: false,
|
|
112
|
+
});
|
|
113
|
+
return response;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Get the installment state of shop.
|
|
117
|
+
*
|
|
118
|
+
* @returns A promise that resolves to the shop installment status response
|
|
119
|
+
*
|
|
120
|
+
* @throws {Error} When the API request fails or returns an error
|
|
121
|
+
*/
|
|
122
|
+
async getShopInstallmentStatus() {
|
|
123
|
+
const response = await ShopeeFetch.fetch(this.config, "/payment/get_shop_installment_status", {
|
|
124
|
+
method: "POST",
|
|
125
|
+
auth: true,
|
|
126
|
+
});
|
|
127
|
+
return response;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Sets the staging capability of shop level.
|
|
131
|
+
*
|
|
132
|
+
* @param params - Parameters for setting shop installment status
|
|
133
|
+
* @param params.installment_enabled - Whether to enable installment for shop
|
|
134
|
+
* @param params.tenure_list - List of tenure months to enable
|
|
135
|
+
*
|
|
136
|
+
* @returns A promise that resolves to the set shop installment status response
|
|
137
|
+
*
|
|
138
|
+
* @throws {Error} When the API request fails or returns an error
|
|
139
|
+
*/
|
|
140
|
+
async setShopInstallmentStatus(params) {
|
|
141
|
+
const response = await ShopeeFetch.fetch(this.config, "/payment/set_shop_installment_status", {
|
|
142
|
+
method: "GET",
|
|
143
|
+
auth: true,
|
|
144
|
+
params,
|
|
145
|
+
});
|
|
146
|
+
return response;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Get item installment tenures. Only for TH、TW.
|
|
150
|
+
*
|
|
151
|
+
* @param params - Parameters for getting item installment status
|
|
152
|
+
* @param params.item_id - Item ID
|
|
153
|
+
*
|
|
154
|
+
* @returns A promise that resolves to the item installment status response
|
|
155
|
+
*
|
|
156
|
+
* @throws {Error} When the API request fails or returns an error
|
|
157
|
+
*/
|
|
158
|
+
async getItemInstallmentStatus(params) {
|
|
159
|
+
const response = await ShopeeFetch.fetch(this.config, "/payment/get_item_installment_status", {
|
|
160
|
+
method: "GET",
|
|
161
|
+
auth: true,
|
|
162
|
+
params,
|
|
163
|
+
});
|
|
164
|
+
return response;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Set item installment. Only for TH、TW.
|
|
168
|
+
*
|
|
169
|
+
* @param params - Parameters for setting item installment status
|
|
170
|
+
* @param params.item_id - Item ID
|
|
171
|
+
* @param params.tenure_list - List of tenure months to enable
|
|
172
|
+
*
|
|
173
|
+
* @returns A promise that resolves to the set item installment status response
|
|
174
|
+
*
|
|
175
|
+
* @throws {Error} When the API request fails or returns an error
|
|
176
|
+
*/
|
|
177
|
+
async setItemInstallmentStatus(params) {
|
|
178
|
+
const response = await ShopeeFetch.fetch(this.config, "/payment/set_item_installment_status", {
|
|
179
|
+
method: "GET",
|
|
180
|
+
auth: true,
|
|
181
|
+
params,
|
|
182
|
+
});
|
|
183
|
+
return response;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Trigger income report generation.
|
|
187
|
+
*
|
|
188
|
+
* @param params - Parameters for generating income report
|
|
189
|
+
* @param params.start_time - Start time for the report (timestamp)
|
|
190
|
+
* @param params.end_time - End time for the report (timestamp)
|
|
191
|
+
* @param params.currency - Currency for the report
|
|
192
|
+
*
|
|
193
|
+
* @returns A promise that resolves to the generate income report response
|
|
194
|
+
*
|
|
195
|
+
* @throws {Error} When the API request fails or returns an error
|
|
196
|
+
*/
|
|
197
|
+
async generateIncomeReport(params) {
|
|
198
|
+
const response = await ShopeeFetch.fetch(this.config, "/payment/generate_income_report", {
|
|
199
|
+
method: "POST",
|
|
200
|
+
auth: true,
|
|
201
|
+
body: params,
|
|
202
|
+
});
|
|
203
|
+
return response;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* To query income report status and provide file link if the income report is ready to be downloaded.
|
|
207
|
+
*
|
|
208
|
+
* @param params - Parameters for getting income report
|
|
209
|
+
* @param params.income_report_id - Income report ID
|
|
210
|
+
*
|
|
211
|
+
* @returns A promise that resolves to the get income report response
|
|
212
|
+
*
|
|
213
|
+
* @throws {Error} When the API request fails or returns an error
|
|
214
|
+
*/
|
|
215
|
+
async getIncomeReport(params) {
|
|
216
|
+
const response = await ShopeeFetch.fetch(this.config, "/payment/get_income_report", {
|
|
217
|
+
method: "POST",
|
|
218
|
+
auth: true,
|
|
219
|
+
body: params,
|
|
220
|
+
});
|
|
221
|
+
return response;
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Trigger income statement generation.
|
|
225
|
+
*
|
|
226
|
+
* @param params - Parameters for generating income statement
|
|
227
|
+
* @param params.start_time - Start time for the statement (timestamp)
|
|
228
|
+
* @param params.end_time - End time for the statement (timestamp)
|
|
229
|
+
*
|
|
230
|
+
* @returns A promise that resolves to the generate income statement response
|
|
231
|
+
*
|
|
232
|
+
* @throws {Error} When the API request fails or returns an error
|
|
233
|
+
*/
|
|
234
|
+
async generateIncomeStatement(params) {
|
|
235
|
+
const response = await ShopeeFetch.fetch(this.config, "/payment/generate_income_statement", {
|
|
236
|
+
method: "POST",
|
|
237
|
+
auth: true,
|
|
238
|
+
body: params,
|
|
239
|
+
});
|
|
240
|
+
return response;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* To query income statement status and provide file link if the income statement is ready to be downloaded.
|
|
244
|
+
*
|
|
245
|
+
* @param params - Parameters for getting income statement
|
|
246
|
+
* @param params.income_statement_id - Income statement ID
|
|
247
|
+
*
|
|
248
|
+
* @returns A promise that resolves to the get income statement response
|
|
249
|
+
*
|
|
250
|
+
* @throws {Error} When the API request fails or returns an error
|
|
251
|
+
*/
|
|
252
|
+
async getIncomeStatement(params) {
|
|
253
|
+
const response = await ShopeeFetch.fetch(this.config, "/payment/get_income_statement", {
|
|
254
|
+
method: "POST",
|
|
255
|
+
auth: true,
|
|
256
|
+
body: params,
|
|
257
|
+
});
|
|
258
|
+
return response;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* This API is applicable for Cross Border (CB) sellers only to get the detailed payout transaction data,
|
|
262
|
+
* both released and to-be released transaction can be found in here.
|
|
263
|
+
*
|
|
264
|
+
* @param params - Parameters for getting billing transaction info
|
|
265
|
+
* @param params.transaction_time_from - Transaction time from (timestamp)
|
|
266
|
+
* @param params.transaction_time_to - Transaction time to (timestamp)
|
|
267
|
+
* @param params.page_no - Page number, default 1
|
|
268
|
+
* @param params.page_size - Page size, max 100, default 40
|
|
269
|
+
*
|
|
270
|
+
* @returns A promise that resolves to the billing transaction info response
|
|
271
|
+
*
|
|
272
|
+
* @throws {Error} When the API request fails or returns an error
|
|
273
|
+
*/
|
|
274
|
+
async getBillingTransactionInfo(params) {
|
|
275
|
+
const response = await ShopeeFetch.fetch(this.config, "/payment/get_billing_transaction_info", {
|
|
276
|
+
method: "GET",
|
|
277
|
+
auth: true,
|
|
278
|
+
params,
|
|
279
|
+
});
|
|
280
|
+
return response;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* This API is applicable for Cross Border (CB) sellers only to get the shop's payout data.
|
|
284
|
+
* @deprecated Use getPayoutInfo instead
|
|
285
|
+
*
|
|
286
|
+
* @param params - Parameters for getting payout detail
|
|
287
|
+
* @param params.payout_time_from - Payout time from (timestamp)
|
|
288
|
+
* @param params.payout_time_to - Payout time to (timestamp)
|
|
289
|
+
* @param params.page_no - Page number, default 1
|
|
290
|
+
* @param params.page_size - Page size, max 100, default 40
|
|
291
|
+
*
|
|
292
|
+
* @returns A promise that resolves to the payout detail response
|
|
293
|
+
*
|
|
294
|
+
* @throws {Error} When the API request fails or returns an error
|
|
295
|
+
*/
|
|
296
|
+
async getPayoutDetail(params) {
|
|
297
|
+
const response = await ShopeeFetch.fetch(this.config, "/payment/get_payout_detail", {
|
|
298
|
+
method: "POST",
|
|
299
|
+
auth: true,
|
|
300
|
+
body: params,
|
|
301
|
+
});
|
|
302
|
+
return response;
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* This is a new API which applicable for Cross Border (CB) sellers only to get the shop's payout data,
|
|
306
|
+
* will be used for the original API v2.get_payout_details replacement.
|
|
307
|
+
*
|
|
308
|
+
* @param params - Parameters for getting payout info
|
|
309
|
+
* @param params.payout_time_from - Payout time from (timestamp)
|
|
310
|
+
* @param params.payout_time_to - Payout time to (timestamp)
|
|
311
|
+
* @param params.page_no - Page number, default 1
|
|
312
|
+
* @param params.page_size - Page size, max 100, default 40
|
|
313
|
+
*
|
|
314
|
+
* @returns A promise that resolves to the payout info response
|
|
315
|
+
*
|
|
316
|
+
* @throws {Error} When the API request fails or returns an error
|
|
317
|
+
*/
|
|
318
|
+
async getPayoutInfo(params) {
|
|
319
|
+
const response = await ShopeeFetch.fetch(this.config, "/payment/get_payout_info", {
|
|
320
|
+
method: "POST",
|
|
321
|
+
auth: true,
|
|
322
|
+
body: params,
|
|
323
|
+
});
|
|
324
|
+
return response;
|
|
325
|
+
}
|
|
38
326
|
}
|
|
39
327
|
//# sourceMappingURL=payment.manager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment.manager.js","sourceRoot":"","sources":["../../src/managers/payment.manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"payment.manager.js","sourceRoot":"","sources":["../../src/managers/payment.manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAiChD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,OAAO,cAAe,SAAQ,WAAW;IAC7C,YAAY,MAAo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