@congminh1254/shopee-sdk 0.6.0 → 0.8.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/lib/managers/account-health.manager.d.ts +208 -0
- package/lib/managers/account-health.manager.js +257 -0
- package/lib/managers/account-health.manager.js.map +1 -0
- package/lib/managers/index.d.ts +1 -0
- package/lib/managers/index.js +1 -0
- package/lib/managers/index.js.map +1 -1
- package/lib/managers/product.manager.d.ts +20 -1
- package/lib/managers/product.manager.js +26 -0
- package/lib/managers/product.manager.js.map +1 -1
- package/lib/schemas/account-health.d.ts +734 -0
- package/lib/schemas/account-health.js +200 -0
- package/lib/schemas/account-health.js.map +1 -0
- package/lib/schemas/index.d.ts +1 -0
- package/lib/schemas/index.js +1 -0
- package/lib/schemas/index.js.map +1 -1
- package/lib/schemas/product.d.ts +151 -0
- package/lib/sdk.d.ts +2 -0
- package/lib/sdk.js +2 -0
- package/lib/sdk.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { ShopeeConfig } from "../sdk.js";
|
|
2
|
+
import { BaseManager } from "./base.manager.js";
|
|
3
|
+
import { GetShopPenaltyResponse, GetShopPerformanceResponse, GetMetricSourceDetailParams, GetMetricSourceDetailResponse, GetPenaltyPointHistoryParams, GetPenaltyPointHistoryResponse, GetPunishmentHistoryParams, GetPunishmentHistoryResponse, GetListingsWithIssuesParams, GetListingsWithIssuesResponse, GetLateOrdersParams, GetLateOrdersResponse } from "../schemas/account-health.js";
|
|
4
|
+
export declare class AccountHealthManager extends BaseManager {
|
|
5
|
+
constructor(config: ShopeeConfig);
|
|
6
|
+
/**
|
|
7
|
+
* Get the information of shop penalty
|
|
8
|
+
* @returns {Promise<GetShopPenaltyResponse>} Response containing penalty points and ongoing punishments
|
|
9
|
+
*
|
|
10
|
+
* This API returns the seller's shop penalty information, including:
|
|
11
|
+
*
|
|
12
|
+
* - Penalty points that remain on record till the end of a quarter (reset on the first Monday of each quarter)
|
|
13
|
+
* - Overall penalty points total
|
|
14
|
+
* - Points from non-fulfillment rate issues
|
|
15
|
+
* - Points from late shipment issues
|
|
16
|
+
* - Points from listing violations
|
|
17
|
+
* - Points from OPFR (Order Pick-up Failure Rate) violations
|
|
18
|
+
* - Points from other violations
|
|
19
|
+
*
|
|
20
|
+
* - List of ongoing punishments with details about:
|
|
21
|
+
* - Punishment tier (1-5)
|
|
22
|
+
* - Days left in the punishment period
|
|
23
|
+
* - Name of the punishment (e.g., "deboost")
|
|
24
|
+
*
|
|
25
|
+
* Use this API to monitor your shop's health status and take proactive measures
|
|
26
|
+
* to address any issues that could affect your shop's performance.
|
|
27
|
+
*/
|
|
28
|
+
getShopPenalty(): Promise<GetShopPenaltyResponse>;
|
|
29
|
+
/**
|
|
30
|
+
* Get data metrics of shop performance
|
|
31
|
+
* @returns {Promise<GetShopPerformanceResponse>} Response containing shop performance metrics
|
|
32
|
+
*
|
|
33
|
+
* This API returns comprehensive data metrics about a shop's performance across three
|
|
34
|
+
* key dimensions:
|
|
35
|
+
*
|
|
36
|
+
* 1. Fulfillment Performance - Metrics related to order processing and logistics:
|
|
37
|
+
* - Late Shipment Rate
|
|
38
|
+
* - Non-Fulfillment Rate
|
|
39
|
+
* - Preparation Time
|
|
40
|
+
* - Fast Handover Rate
|
|
41
|
+
* - Cancellation Rate
|
|
42
|
+
* - Return-refund Rate
|
|
43
|
+
* - On-time Pickup Failure Rate
|
|
44
|
+
*
|
|
45
|
+
* 2. Listing Performance - Metrics related to product listings quality:
|
|
46
|
+
* - Severe Listing Violations (Prohibited, Counterfeit/IP infringement, Spam)
|
|
47
|
+
* - Pre-order Listing percentage and days in violation
|
|
48
|
+
* - Other Listing Violations
|
|
49
|
+
*
|
|
50
|
+
* 3. Customer Service Performance - Metrics related to customer interactions:
|
|
51
|
+
* - Chat Response Rate
|
|
52
|
+
* - Response Time
|
|
53
|
+
* - Shop Rating
|
|
54
|
+
* - Non-Responded Chats
|
|
55
|
+
*
|
|
56
|
+
* The response includes both overall performance ratings and detailed metrics with:
|
|
57
|
+
* - Current and previous period performance values
|
|
58
|
+
* - Target values with comparators (e.g., "<", ">=") to meet performance standards
|
|
59
|
+
* - Units of measurement (percentage, number, days, etc.)
|
|
60
|
+
* - Parent-child relationship between metrics
|
|
61
|
+
*
|
|
62
|
+
* Use this API to gain insights into shop performance and identify areas
|
|
63
|
+
* for improvement to maintain good shop health.
|
|
64
|
+
*/
|
|
65
|
+
getShopPerformance(): Promise<GetShopPerformanceResponse>;
|
|
66
|
+
/**
|
|
67
|
+
* Get the Affected Orders / Relevant Listings / Relevant Violations details of metrics
|
|
68
|
+
* @param {GetMetricSourceDetailParams} params Request parameters
|
|
69
|
+
* @param {number} params.metric_id ID of metric to get details for
|
|
70
|
+
* @param {number} [params.page_no] Page number, starting from 1 (default: 1)
|
|
71
|
+
* @param {number} [params.page_size] Number of items per page, 1-100 (default: 10)
|
|
72
|
+
* @returns {Promise<GetMetricSourceDetailResponse>} Response containing detailed information about the metric
|
|
73
|
+
*
|
|
74
|
+
* This API returns detailed information about specific metrics, including affected orders,
|
|
75
|
+
* relevant listings, or violation details. The response structure varies based on the
|
|
76
|
+
* metric_id provided:
|
|
77
|
+
*
|
|
78
|
+
* - Non-Fulfillment Rate metrics (3, 88): Returns `nfr_order_list` with affected orders
|
|
79
|
+
* - Cancellation Rate metrics (42, 91): Returns `cancellation_order_list` with affected orders
|
|
80
|
+
* - Return-refund Rate metrics (43, 92): Returns `return_refund_order_list` with affected orders
|
|
81
|
+
* - Late Shipment Rate metrics (1, 85): Returns `lsr_order_list` with late shipment details
|
|
82
|
+
* - Fast Handover Rate metrics (25, 2001-2003): Returns `fhr_order_list` with handover details
|
|
83
|
+
* - On-time Pickup Failure Rate (28): Returns `opfr_day_detail_data_list` with daily violation data
|
|
84
|
+
* - Listing Violations (52, 53): Returns `violation_listing_list` with problematic listings
|
|
85
|
+
* - Pre-order Listing Violation (15): Returns `pre_order_listing_violation_data_list` with daily data
|
|
86
|
+
* - Pre-order Listing % (12): Returns `pre_order_listing_list` with pre-order listings
|
|
87
|
+
* - NDD Listings % (97): Returns `ndd_listing_list` with NDD-enabled listings
|
|
88
|
+
*
|
|
89
|
+
* The response is paginated - use page_no and page_size to navigate through the results.
|
|
90
|
+
* The total_count field indicates the total number of items available across all pages.
|
|
91
|
+
*
|
|
92
|
+
* Use this API to identify specific orders or listings that are affecting your shop's
|
|
93
|
+
* performance metrics and take corrective actions.
|
|
94
|
+
*/
|
|
95
|
+
getMetricSourceDetail(params: GetMetricSourceDetailParams): Promise<GetMetricSourceDetailResponse>;
|
|
96
|
+
/**
|
|
97
|
+
* Get the penalty point records generated in the current quarter
|
|
98
|
+
* @param {GetPenaltyPointHistoryParams} [params] Optional request parameters
|
|
99
|
+
* @param {number} [params.page_no] Page number, starting from 1 (default: 1)
|
|
100
|
+
* @param {number} [params.page_size] Number of items per page, 1-100 (default: 10)
|
|
101
|
+
* @param {number} [params.violation_type] Filter by specific violation type (see ViolationType enum)
|
|
102
|
+
* @returns {Promise<GetPenaltyPointHistoryResponse>} Response containing penalty point records
|
|
103
|
+
*
|
|
104
|
+
* This API returns detailed records of penalty points that have been issued to the shop
|
|
105
|
+
* during the current quarter. Each record includes:
|
|
106
|
+
*
|
|
107
|
+
* - The time when the penalty points were issued
|
|
108
|
+
* - The number of points (both original and current after any adjustments via appeals)
|
|
109
|
+
* - A unique reference ID for the penalty
|
|
110
|
+
* - The type of violation that triggered the penalty
|
|
111
|
+
*
|
|
112
|
+
* Use this API to track and analyze penalty points history, which can help in:
|
|
113
|
+
* - Understanding what types of violations are impacting your shop health
|
|
114
|
+
* - Monitoring the effects of appeals on penalty points
|
|
115
|
+
* - Tracking progress over time in reducing violations
|
|
116
|
+
*
|
|
117
|
+
* The response is paginated - use page_no and page_size to navigate through the results.
|
|
118
|
+
* You can also filter by violation_type to focus on specific types of issues.
|
|
119
|
+
*
|
|
120
|
+
* Note: Penalty points reset at the beginning of each quarter (on the first Monday).
|
|
121
|
+
*/
|
|
122
|
+
getPenaltyPointHistory(params?: GetPenaltyPointHistoryParams): Promise<GetPenaltyPointHistoryResponse>;
|
|
123
|
+
/**
|
|
124
|
+
* Get the punishment records generated in the current quarter
|
|
125
|
+
* @param {GetPunishmentHistoryParams} params Request parameters
|
|
126
|
+
* @param {number} params.punishment_status Status of punishments to retrieve (1=Ongoing, 2=Ended)
|
|
127
|
+
* @param {number} [params.page_no] Page number, starting from 1 (default: 1)
|
|
128
|
+
* @param {number} [params.page_size] Number of items per page, 1-100 (default: 10)
|
|
129
|
+
* @returns {Promise<GetPunishmentHistoryResponse>} Response containing punishment records
|
|
130
|
+
*
|
|
131
|
+
* This API returns detailed records of punishments that have been applied to the shop
|
|
132
|
+
* during the current quarter. Each punishment record includes:
|
|
133
|
+
*
|
|
134
|
+
* - The time when the punishment was issued
|
|
135
|
+
* - Start and end times of the punishment period
|
|
136
|
+
* - Type of punishment (e.g., listing restrictions, marketing restrictions)
|
|
137
|
+
* - Reason for the punishment (typically indicates the tier level)
|
|
138
|
+
* - A unique reference ID for the punishment
|
|
139
|
+
* - For listing limit punishments: the specific listing limit value
|
|
140
|
+
* - For order limit punishments: the percentage applied to order limits
|
|
141
|
+
*
|
|
142
|
+
* You can retrieve either ongoing punishments (punishment_status=1) or
|
|
143
|
+
* ended punishments (punishment_status=2).
|
|
144
|
+
*
|
|
145
|
+
* Common punishment types include:
|
|
146
|
+
* - Listings not displayed in search or category browsing
|
|
147
|
+
* - Unable to create or edit listings
|
|
148
|
+
* - Unable to join marketing campaigns
|
|
149
|
+
* - No shipping subsidies
|
|
150
|
+
* - Account suspension
|
|
151
|
+
* - Listing limit reductions
|
|
152
|
+
* - Order limits
|
|
153
|
+
*
|
|
154
|
+
* The response is paginated - use page_no and page_size to navigate through the results.
|
|
155
|
+
*
|
|
156
|
+
* Use this API to understand current restrictions on your shop and when they will expire.
|
|
157
|
+
*/
|
|
158
|
+
getPunishmentHistory(params: GetPunishmentHistoryParams): Promise<GetPunishmentHistoryResponse>;
|
|
159
|
+
/**
|
|
160
|
+
* Get the listings that have issues and need improvement
|
|
161
|
+
* @param {GetListingsWithIssuesParams} [params] Optional request parameters
|
|
162
|
+
* @param {number} [params.page_no] Page number, starting from 1 (default: 1)
|
|
163
|
+
* @param {number} [params.page_size] Number of items per page, 1-100 (default: 10)
|
|
164
|
+
* @returns {Promise<GetListingsWithIssuesResponse>} Response containing listings with issues
|
|
165
|
+
*
|
|
166
|
+
* This API returns details of problematic listings that need improvement. Each listing record includes:
|
|
167
|
+
*
|
|
168
|
+
* - The item ID of the problematic listing
|
|
169
|
+
* - The reason for the issue, with possible values including:
|
|
170
|
+
* - Prohibited (1): Listing violates Shopee's prohibited items policy
|
|
171
|
+
* - Counterfeit (2): Listing is flagged as potentially counterfeit
|
|
172
|
+
* - Spam (3): Listing is identified as spam content
|
|
173
|
+
* - Inappropriate Image (4): Listing contains inappropriate images
|
|
174
|
+
* - Insufficient Info (5): Listing lacks required information
|
|
175
|
+
* - Mall Listing Improvement (6): Mall listing requiring improvement
|
|
176
|
+
* - Other Listing Improvement (7): Other issues requiring attention
|
|
177
|
+
*
|
|
178
|
+
* The response is paginated - use page_no and page_size to navigate through the results.
|
|
179
|
+
* The total_count field indicates the total number of listings with issues across all pages.
|
|
180
|
+
*
|
|
181
|
+
* Use this API to identify listings that need improvement to maintain good shop health
|
|
182
|
+
* and avoid potential penalties or restrictions on your shop.
|
|
183
|
+
*/
|
|
184
|
+
getListingsWithIssues(params?: GetListingsWithIssuesParams): Promise<GetListingsWithIssuesResponse>;
|
|
185
|
+
/**
|
|
186
|
+
* Get the late orders to take action to avoid order cancellation and penalty points
|
|
187
|
+
* @param {GetLateOrdersParams} [params] Optional request parameters
|
|
188
|
+
* @param {number} [params.page_no] Page number, starting from 1 (default: 1)
|
|
189
|
+
* @param {number} [params.page_size] Number of items per page, 1-100 (default: 10)
|
|
190
|
+
* @returns {Promise<GetLateOrdersResponse>} Response containing late orders information
|
|
191
|
+
*
|
|
192
|
+
* This API returns a list of orders that are late for shipping and require immediate
|
|
193
|
+
* attention to avoid potential cancellations and resulting penalty points.
|
|
194
|
+
* Each late order record includes:
|
|
195
|
+
*
|
|
196
|
+
* - The order SN (order number)
|
|
197
|
+
* - The shipping deadline timestamp
|
|
198
|
+
* - The number of days the order is late by
|
|
199
|
+
*
|
|
200
|
+
* The response is paginated - use page_no and page_size to navigate through the results.
|
|
201
|
+
* The total_count field indicates the total number of late orders across all pages.
|
|
202
|
+
*
|
|
203
|
+
* Use this API to prioritize shipping for late orders and take action to minimize
|
|
204
|
+
* late shipment rates, which can affect your shop's performance metrics and potentially
|
|
205
|
+
* result in penalties or restrictions on your shop.
|
|
206
|
+
*/
|
|
207
|
+
getLateOrders(params?: GetLateOrdersParams): Promise<GetLateOrdersResponse>;
|
|
208
|
+
}
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { BaseManager } from "./base.manager.js";
|
|
2
|
+
import { ShopeeFetch } from "../fetch.js";
|
|
3
|
+
export class AccountHealthManager extends BaseManager {
|
|
4
|
+
constructor(config) {
|
|
5
|
+
super(config);
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Get the information of shop penalty
|
|
9
|
+
* @returns {Promise<GetShopPenaltyResponse>} Response containing penalty points and ongoing punishments
|
|
10
|
+
*
|
|
11
|
+
* This API returns the seller's shop penalty information, including:
|
|
12
|
+
*
|
|
13
|
+
* - Penalty points that remain on record till the end of a quarter (reset on the first Monday of each quarter)
|
|
14
|
+
* - Overall penalty points total
|
|
15
|
+
* - Points from non-fulfillment rate issues
|
|
16
|
+
* - Points from late shipment issues
|
|
17
|
+
* - Points from listing violations
|
|
18
|
+
* - Points from OPFR (Order Pick-up Failure Rate) violations
|
|
19
|
+
* - Points from other violations
|
|
20
|
+
*
|
|
21
|
+
* - List of ongoing punishments with details about:
|
|
22
|
+
* - Punishment tier (1-5)
|
|
23
|
+
* - Days left in the punishment period
|
|
24
|
+
* - Name of the punishment (e.g., "deboost")
|
|
25
|
+
*
|
|
26
|
+
* Use this API to monitor your shop's health status and take proactive measures
|
|
27
|
+
* to address any issues that could affect your shop's performance.
|
|
28
|
+
*/
|
|
29
|
+
async getShopPenalty() {
|
|
30
|
+
const response = await ShopeeFetch.fetch(this.config, "/account_health/shop_penalty", {
|
|
31
|
+
method: "GET",
|
|
32
|
+
auth: true,
|
|
33
|
+
});
|
|
34
|
+
return response;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Get data metrics of shop performance
|
|
38
|
+
* @returns {Promise<GetShopPerformanceResponse>} Response containing shop performance metrics
|
|
39
|
+
*
|
|
40
|
+
* This API returns comprehensive data metrics about a shop's performance across three
|
|
41
|
+
* key dimensions:
|
|
42
|
+
*
|
|
43
|
+
* 1. Fulfillment Performance - Metrics related to order processing and logistics:
|
|
44
|
+
* - Late Shipment Rate
|
|
45
|
+
* - Non-Fulfillment Rate
|
|
46
|
+
* - Preparation Time
|
|
47
|
+
* - Fast Handover Rate
|
|
48
|
+
* - Cancellation Rate
|
|
49
|
+
* - Return-refund Rate
|
|
50
|
+
* - On-time Pickup Failure Rate
|
|
51
|
+
*
|
|
52
|
+
* 2. Listing Performance - Metrics related to product listings quality:
|
|
53
|
+
* - Severe Listing Violations (Prohibited, Counterfeit/IP infringement, Spam)
|
|
54
|
+
* - Pre-order Listing percentage and days in violation
|
|
55
|
+
* - Other Listing Violations
|
|
56
|
+
*
|
|
57
|
+
* 3. Customer Service Performance - Metrics related to customer interactions:
|
|
58
|
+
* - Chat Response Rate
|
|
59
|
+
* - Response Time
|
|
60
|
+
* - Shop Rating
|
|
61
|
+
* - Non-Responded Chats
|
|
62
|
+
*
|
|
63
|
+
* The response includes both overall performance ratings and detailed metrics with:
|
|
64
|
+
* - Current and previous period performance values
|
|
65
|
+
* - Target values with comparators (e.g., "<", ">=") to meet performance standards
|
|
66
|
+
* - Units of measurement (percentage, number, days, etc.)
|
|
67
|
+
* - Parent-child relationship between metrics
|
|
68
|
+
*
|
|
69
|
+
* Use this API to gain insights into shop performance and identify areas
|
|
70
|
+
* for improvement to maintain good shop health.
|
|
71
|
+
*/
|
|
72
|
+
async getShopPerformance() {
|
|
73
|
+
const response = await ShopeeFetch.fetch(this.config, "/account_health/get_shop_performance", {
|
|
74
|
+
method: "GET",
|
|
75
|
+
auth: true,
|
|
76
|
+
});
|
|
77
|
+
return response;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Get the Affected Orders / Relevant Listings / Relevant Violations details of metrics
|
|
81
|
+
* @param {GetMetricSourceDetailParams} params Request parameters
|
|
82
|
+
* @param {number} params.metric_id ID of metric to get details for
|
|
83
|
+
* @param {number} [params.page_no] Page number, starting from 1 (default: 1)
|
|
84
|
+
* @param {number} [params.page_size] Number of items per page, 1-100 (default: 10)
|
|
85
|
+
* @returns {Promise<GetMetricSourceDetailResponse>} Response containing detailed information about the metric
|
|
86
|
+
*
|
|
87
|
+
* This API returns detailed information about specific metrics, including affected orders,
|
|
88
|
+
* relevant listings, or violation details. The response structure varies based on the
|
|
89
|
+
* metric_id provided:
|
|
90
|
+
*
|
|
91
|
+
* - Non-Fulfillment Rate metrics (3, 88): Returns `nfr_order_list` with affected orders
|
|
92
|
+
* - Cancellation Rate metrics (42, 91): Returns `cancellation_order_list` with affected orders
|
|
93
|
+
* - Return-refund Rate metrics (43, 92): Returns `return_refund_order_list` with affected orders
|
|
94
|
+
* - Late Shipment Rate metrics (1, 85): Returns `lsr_order_list` with late shipment details
|
|
95
|
+
* - Fast Handover Rate metrics (25, 2001-2003): Returns `fhr_order_list` with handover details
|
|
96
|
+
* - On-time Pickup Failure Rate (28): Returns `opfr_day_detail_data_list` with daily violation data
|
|
97
|
+
* - Listing Violations (52, 53): Returns `violation_listing_list` with problematic listings
|
|
98
|
+
* - Pre-order Listing Violation (15): Returns `pre_order_listing_violation_data_list` with daily data
|
|
99
|
+
* - Pre-order Listing % (12): Returns `pre_order_listing_list` with pre-order listings
|
|
100
|
+
* - NDD Listings % (97): Returns `ndd_listing_list` with NDD-enabled listings
|
|
101
|
+
*
|
|
102
|
+
* The response is paginated - use page_no and page_size to navigate through the results.
|
|
103
|
+
* The total_count field indicates the total number of items available across all pages.
|
|
104
|
+
*
|
|
105
|
+
* Use this API to identify specific orders or listings that are affecting your shop's
|
|
106
|
+
* performance metrics and take corrective actions.
|
|
107
|
+
*/
|
|
108
|
+
async getMetricSourceDetail(params) {
|
|
109
|
+
const response = await ShopeeFetch.fetch(this.config, "/account_health/get_metric_source_detail", {
|
|
110
|
+
method: "GET",
|
|
111
|
+
auth: true,
|
|
112
|
+
params,
|
|
113
|
+
});
|
|
114
|
+
return response;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Get the penalty point records generated in the current quarter
|
|
118
|
+
* @param {GetPenaltyPointHistoryParams} [params] Optional request parameters
|
|
119
|
+
* @param {number} [params.page_no] Page number, starting from 1 (default: 1)
|
|
120
|
+
* @param {number} [params.page_size] Number of items per page, 1-100 (default: 10)
|
|
121
|
+
* @param {number} [params.violation_type] Filter by specific violation type (see ViolationType enum)
|
|
122
|
+
* @returns {Promise<GetPenaltyPointHistoryResponse>} Response containing penalty point records
|
|
123
|
+
*
|
|
124
|
+
* This API returns detailed records of penalty points that have been issued to the shop
|
|
125
|
+
* during the current quarter. Each record includes:
|
|
126
|
+
*
|
|
127
|
+
* - The time when the penalty points were issued
|
|
128
|
+
* - The number of points (both original and current after any adjustments via appeals)
|
|
129
|
+
* - A unique reference ID for the penalty
|
|
130
|
+
* - The type of violation that triggered the penalty
|
|
131
|
+
*
|
|
132
|
+
* Use this API to track and analyze penalty points history, which can help in:
|
|
133
|
+
* - Understanding what types of violations are impacting your shop health
|
|
134
|
+
* - Monitoring the effects of appeals on penalty points
|
|
135
|
+
* - Tracking progress over time in reducing violations
|
|
136
|
+
*
|
|
137
|
+
* The response is paginated - use page_no and page_size to navigate through the results.
|
|
138
|
+
* You can also filter by violation_type to focus on specific types of issues.
|
|
139
|
+
*
|
|
140
|
+
* Note: Penalty points reset at the beginning of each quarter (on the first Monday).
|
|
141
|
+
*/
|
|
142
|
+
async getPenaltyPointHistory(params) {
|
|
143
|
+
const response = await ShopeeFetch.fetch(this.config, "/account_health/get_penalty_point_history", {
|
|
144
|
+
method: "GET",
|
|
145
|
+
auth: true,
|
|
146
|
+
params,
|
|
147
|
+
});
|
|
148
|
+
return response;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Get the punishment records generated in the current quarter
|
|
152
|
+
* @param {GetPunishmentHistoryParams} params Request parameters
|
|
153
|
+
* @param {number} params.punishment_status Status of punishments to retrieve (1=Ongoing, 2=Ended)
|
|
154
|
+
* @param {number} [params.page_no] Page number, starting from 1 (default: 1)
|
|
155
|
+
* @param {number} [params.page_size] Number of items per page, 1-100 (default: 10)
|
|
156
|
+
* @returns {Promise<GetPunishmentHistoryResponse>} Response containing punishment records
|
|
157
|
+
*
|
|
158
|
+
* This API returns detailed records of punishments that have been applied to the shop
|
|
159
|
+
* during the current quarter. Each punishment record includes:
|
|
160
|
+
*
|
|
161
|
+
* - The time when the punishment was issued
|
|
162
|
+
* - Start and end times of the punishment period
|
|
163
|
+
* - Type of punishment (e.g., listing restrictions, marketing restrictions)
|
|
164
|
+
* - Reason for the punishment (typically indicates the tier level)
|
|
165
|
+
* - A unique reference ID for the punishment
|
|
166
|
+
* - For listing limit punishments: the specific listing limit value
|
|
167
|
+
* - For order limit punishments: the percentage applied to order limits
|
|
168
|
+
*
|
|
169
|
+
* You can retrieve either ongoing punishments (punishment_status=1) or
|
|
170
|
+
* ended punishments (punishment_status=2).
|
|
171
|
+
*
|
|
172
|
+
* Common punishment types include:
|
|
173
|
+
* - Listings not displayed in search or category browsing
|
|
174
|
+
* - Unable to create or edit listings
|
|
175
|
+
* - Unable to join marketing campaigns
|
|
176
|
+
* - No shipping subsidies
|
|
177
|
+
* - Account suspension
|
|
178
|
+
* - Listing limit reductions
|
|
179
|
+
* - Order limits
|
|
180
|
+
*
|
|
181
|
+
* The response is paginated - use page_no and page_size to navigate through the results.
|
|
182
|
+
*
|
|
183
|
+
* Use this API to understand current restrictions on your shop and when they will expire.
|
|
184
|
+
*/
|
|
185
|
+
async getPunishmentHistory(params) {
|
|
186
|
+
const response = await ShopeeFetch.fetch(this.config, "/account_health/get_punishment_history", {
|
|
187
|
+
method: "GET",
|
|
188
|
+
auth: true,
|
|
189
|
+
params,
|
|
190
|
+
});
|
|
191
|
+
return response;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Get the listings that have issues and need improvement
|
|
195
|
+
* @param {GetListingsWithIssuesParams} [params] Optional request parameters
|
|
196
|
+
* @param {number} [params.page_no] Page number, starting from 1 (default: 1)
|
|
197
|
+
* @param {number} [params.page_size] Number of items per page, 1-100 (default: 10)
|
|
198
|
+
* @returns {Promise<GetListingsWithIssuesResponse>} Response containing listings with issues
|
|
199
|
+
*
|
|
200
|
+
* This API returns details of problematic listings that need improvement. Each listing record includes:
|
|
201
|
+
*
|
|
202
|
+
* - The item ID of the problematic listing
|
|
203
|
+
* - The reason for the issue, with possible values including:
|
|
204
|
+
* - Prohibited (1): Listing violates Shopee's prohibited items policy
|
|
205
|
+
* - Counterfeit (2): Listing is flagged as potentially counterfeit
|
|
206
|
+
* - Spam (3): Listing is identified as spam content
|
|
207
|
+
* - Inappropriate Image (4): Listing contains inappropriate images
|
|
208
|
+
* - Insufficient Info (5): Listing lacks required information
|
|
209
|
+
* - Mall Listing Improvement (6): Mall listing requiring improvement
|
|
210
|
+
* - Other Listing Improvement (7): Other issues requiring attention
|
|
211
|
+
*
|
|
212
|
+
* The response is paginated - use page_no and page_size to navigate through the results.
|
|
213
|
+
* The total_count field indicates the total number of listings with issues across all pages.
|
|
214
|
+
*
|
|
215
|
+
* Use this API to identify listings that need improvement to maintain good shop health
|
|
216
|
+
* and avoid potential penalties or restrictions on your shop.
|
|
217
|
+
*/
|
|
218
|
+
async getListingsWithIssues(params) {
|
|
219
|
+
const response = await ShopeeFetch.fetch(this.config, "/account_health/get_listings_with_issues", {
|
|
220
|
+
method: "GET",
|
|
221
|
+
auth: true,
|
|
222
|
+
params,
|
|
223
|
+
});
|
|
224
|
+
return response;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Get the late orders to take action to avoid order cancellation and penalty points
|
|
228
|
+
* @param {GetLateOrdersParams} [params] Optional request parameters
|
|
229
|
+
* @param {number} [params.page_no] Page number, starting from 1 (default: 1)
|
|
230
|
+
* @param {number} [params.page_size] Number of items per page, 1-100 (default: 10)
|
|
231
|
+
* @returns {Promise<GetLateOrdersResponse>} Response containing late orders information
|
|
232
|
+
*
|
|
233
|
+
* This API returns a list of orders that are late for shipping and require immediate
|
|
234
|
+
* attention to avoid potential cancellations and resulting penalty points.
|
|
235
|
+
* Each late order record includes:
|
|
236
|
+
*
|
|
237
|
+
* - The order SN (order number)
|
|
238
|
+
* - The shipping deadline timestamp
|
|
239
|
+
* - The number of days the order is late by
|
|
240
|
+
*
|
|
241
|
+
* The response is paginated - use page_no and page_size to navigate through the results.
|
|
242
|
+
* The total_count field indicates the total number of late orders across all pages.
|
|
243
|
+
*
|
|
244
|
+
* Use this API to prioritize shipping for late orders and take action to minimize
|
|
245
|
+
* late shipment rates, which can affect your shop's performance metrics and potentially
|
|
246
|
+
* result in penalties or restrictions on your shop.
|
|
247
|
+
*/
|
|
248
|
+
async getLateOrders(params) {
|
|
249
|
+
const response = await ShopeeFetch.fetch(this.config, "/account_health/get_late_orders", {
|
|
250
|
+
method: "GET",
|
|
251
|
+
auth: true,
|
|
252
|
+
params,
|
|
253
|
+
});
|
|
254
|
+
return response;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
//# sourceMappingURL=account-health.manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-health.manager.js","sourceRoot":"","sources":["../../src/managers/account-health.manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAgB1C,MAAM,OAAO,oBAAqB,SAAQ,WAAW;IACnD,YAAY,MAAoB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,KAAK,CAAC,cAAc;QAClB,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,8BAA8B,EAC9B;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;SACX,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACH,KAAK,CAAC,kBAAkB;QACtB,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,sCAAsC,EACtC;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;SACX,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,KAAK,CAAC,qBAAqB,CACzB,MAAmC;QAEnC,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,0CAA0C,EAC1C;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;YACV,MAAM;SACP,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,KAAK,CAAC,sBAAsB,CAC1B,MAAqC;QAErC,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,2CAA2C,EAC3C;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;YACV,MAAM;SACP,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACH,KAAK,CAAC,oBAAoB,CACxB,MAAkC;QAElC,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,wCAAwC,EACxC;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;YACV,MAAM;SACP,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,KAAK,CAAC,qBAAqB,CACzB,MAAoC;QAEpC,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,0CAA0C,EAC1C;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;YACV,MAAM;SACP,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,KAAK,CAAC,aAAa,CAAC,MAA4B;QAC9C,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,iCAAiC,EACjC;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;YACV,MAAM;SACP,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
|
package/lib/managers/index.d.ts
CHANGED
package/lib/managers/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/managers/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/managers/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseManager } from "./base.manager.js";
|
|
2
2
|
import { ShopeeConfig } from "../sdk.js";
|
|
3
|
-
import { GetCommentParams, GetCommentResponse, ReplyCommentParams, ReplyCommentResponse, GetItemListParams, GetItemListResponse, GetItemBaseInfoParams, GetItemBaseInfoResponse } from "../schemas/product.js";
|
|
3
|
+
import { GetCommentParams, GetCommentResponse, ReplyCommentParams, ReplyCommentResponse, GetItemListParams, GetItemListResponse, GetItemBaseInfoParams, GetItemBaseInfoResponse, GetModelListParams, GetModelListResponse } from "../schemas/product.js";
|
|
4
4
|
export declare class ProductManager extends BaseManager {
|
|
5
5
|
constructor(config: ShopeeConfig);
|
|
6
6
|
/**
|
|
@@ -111,4 +111,23 @@ export declare class ProductManager extends BaseManager {
|
|
|
111
111
|
* - error_query_over_itemid_size: Too many item_ids in list
|
|
112
112
|
*/
|
|
113
113
|
getItemBaseInfo(params: GetItemBaseInfoParams): Promise<GetItemBaseInfoResponse>;
|
|
114
|
+
/**
|
|
115
|
+
* Get model list of an item
|
|
116
|
+
*
|
|
117
|
+
* Use this API to get model list of an item.
|
|
118
|
+
*
|
|
119
|
+
* @param params - The parameters for getting the model list
|
|
120
|
+
* @param params.item_id - The ID of the item
|
|
121
|
+
*
|
|
122
|
+
* @returns A promise that resolves to the model list response containing:
|
|
123
|
+
* - tier_variation: Variation config of item with option_list and name
|
|
124
|
+
* - model: List of model information including price_info, model_id, tier_index, model_sku, model_status, etc.
|
|
125
|
+
* - standardise_tier_variation: Standardise variation config of item (if available)
|
|
126
|
+
*
|
|
127
|
+
* @throws {Error} When the API request fails or returns an error:
|
|
128
|
+
* - error_item_not_found: Item_id is not found
|
|
129
|
+
* - error_param_shop_id_not_found: Shop_id is not found
|
|
130
|
+
* - error_item_not_found: Product not found
|
|
131
|
+
*/
|
|
132
|
+
getModelList(params: GetModelListParams): Promise<GetModelListResponse>;
|
|
114
133
|
}
|
|
@@ -143,5 +143,31 @@ export class ProductManager extends BaseManager {
|
|
|
143
143
|
});
|
|
144
144
|
return response;
|
|
145
145
|
}
|
|
146
|
+
/**
|
|
147
|
+
* Get model list of an item
|
|
148
|
+
*
|
|
149
|
+
* Use this API to get model list of an item.
|
|
150
|
+
*
|
|
151
|
+
* @param params - The parameters for getting the model list
|
|
152
|
+
* @param params.item_id - The ID of the item
|
|
153
|
+
*
|
|
154
|
+
* @returns A promise that resolves to the model list response containing:
|
|
155
|
+
* - tier_variation: Variation config of item with option_list and name
|
|
156
|
+
* - model: List of model information including price_info, model_id, tier_index, model_sku, model_status, etc.
|
|
157
|
+
* - standardise_tier_variation: Standardise variation config of item (if available)
|
|
158
|
+
*
|
|
159
|
+
* @throws {Error} When the API request fails or returns an error:
|
|
160
|
+
* - error_item_not_found: Item_id is not found
|
|
161
|
+
* - error_param_shop_id_not_found: Shop_id is not found
|
|
162
|
+
* - error_item_not_found: Product not found
|
|
163
|
+
*/
|
|
164
|
+
async getModelList(params) {
|
|
165
|
+
const response = await ShopeeFetch.fetch(this.config, "/product/get_model_list", {
|
|
166
|
+
method: "GET",
|
|
167
|
+
auth: true,
|
|
168
|
+
params,
|
|
169
|
+
});
|
|
170
|
+
return response;
|
|
171
|
+
}
|
|
146
172
|
}
|
|
147
173
|
//# sourceMappingURL=product.manager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product.manager.js","sourceRoot":"","sources":["../../src/managers/product.manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"product.manager.js","sourceRoot":"","sources":["../../src/managers/product.manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAc1C,MAAM,OAAO,cAAe,SAAQ,WAAW;IAC7C,YAAY,MAAoB;QAC9B,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,KAAK,CAAC,UAAU,CAAC,MAAwB;QACvC,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,sBAAsB,EACtB;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;YACV,MAAM;SACP,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,KAAK,CAAC,YAAY,CAAC,MAA0B;QAC3C,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,wBAAwB,EACxB;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,MAAM;SACb,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,KAAK,CAAC,WAAW,CAAC,MAAyB;QACzC,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,wBAAwB,EACxB;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;YACV,MAAM;SACP,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACH,KAAK,CAAC,eAAe,CAAC,MAA6B;QACjD,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,6BAA6B,EAC7B;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;YACV,MAAM,EAAE;gBACN,GAAG,MAAM;gBACT,YAAY,EAAE,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC;aAC5C;SACF,CACF,CAAC;QACF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,KAAK,CAAC,YAAY,CAAC,MAA0B;QAC3C,MAAM,QAAQ,GAAG,MAAM,WAAW,CAAC,KAAK,CACtC,IAAI,CAAC,MAAM,EACX,yBAAyB,EACzB;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;YACV,MAAM;SACP,CACF,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
|