lingxingapi 1.0.0__py3-none-any.whl

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.

Potentially problematic release.


This version of lingxingapi might be problematic. Click here for more details.

Files changed (65) hide show
  1. lingxingapi/__init__.py +7 -0
  2. lingxingapi/ads/__init__.py +0 -0
  3. lingxingapi/ads/api.py +5946 -0
  4. lingxingapi/ads/param.py +192 -0
  5. lingxingapi/ads/route.py +134 -0
  6. lingxingapi/ads/schema.py +2615 -0
  7. lingxingapi/api.py +443 -0
  8. lingxingapi/base/__init__.py +0 -0
  9. lingxingapi/base/api.py +409 -0
  10. lingxingapi/base/param.py +59 -0
  11. lingxingapi/base/route.py +11 -0
  12. lingxingapi/base/schema.py +198 -0
  13. lingxingapi/basic/__init__.py +0 -0
  14. lingxingapi/basic/api.py +466 -0
  15. lingxingapi/basic/param.py +72 -0
  16. lingxingapi/basic/route.py +20 -0
  17. lingxingapi/basic/schema.py +212 -0
  18. lingxingapi/errors.py +143 -0
  19. lingxingapi/fba/__init__.py +0 -0
  20. lingxingapi/fba/api.py +1691 -0
  21. lingxingapi/fba/param.py +250 -0
  22. lingxingapi/fba/route.py +30 -0
  23. lingxingapi/fba/schema.py +987 -0
  24. lingxingapi/fields.py +50 -0
  25. lingxingapi/finance/__init__.py +0 -0
  26. lingxingapi/finance/api.py +3091 -0
  27. lingxingapi/finance/param.py +616 -0
  28. lingxingapi/finance/route.py +44 -0
  29. lingxingapi/finance/schema.py +1243 -0
  30. lingxingapi/product/__init__.py +0 -0
  31. lingxingapi/product/api.py +2643 -0
  32. lingxingapi/product/param.py +934 -0
  33. lingxingapi/product/route.py +49 -0
  34. lingxingapi/product/schema.py +1004 -0
  35. lingxingapi/purchase/__init__.py +0 -0
  36. lingxingapi/purchase/api.py +496 -0
  37. lingxingapi/purchase/param.py +126 -0
  38. lingxingapi/purchase/route.py +11 -0
  39. lingxingapi/purchase/schema.py +215 -0
  40. lingxingapi/sales/__init__.py +0 -0
  41. lingxingapi/sales/api.py +3200 -0
  42. lingxingapi/sales/param.py +723 -0
  43. lingxingapi/sales/route.py +70 -0
  44. lingxingapi/sales/schema.py +1718 -0
  45. lingxingapi/source/__init__.py +0 -0
  46. lingxingapi/source/api.py +1799 -0
  47. lingxingapi/source/param.py +176 -0
  48. lingxingapi/source/route.py +38 -0
  49. lingxingapi/source/schema.py +1011 -0
  50. lingxingapi/tools/__init__.py +0 -0
  51. lingxingapi/tools/api.py +291 -0
  52. lingxingapi/tools/param.py +73 -0
  53. lingxingapi/tools/route.py +8 -0
  54. lingxingapi/tools/schema.py +169 -0
  55. lingxingapi/utils.py +411 -0
  56. lingxingapi/warehourse/__init__.py +0 -0
  57. lingxingapi/warehourse/api.py +1778 -0
  58. lingxingapi/warehourse/param.py +506 -0
  59. lingxingapi/warehourse/route.py +28 -0
  60. lingxingapi/warehourse/schema.py +926 -0
  61. lingxingapi-1.0.0.dist-info/METADATA +67 -0
  62. lingxingapi-1.0.0.dist-info/RECORD +65 -0
  63. lingxingapi-1.0.0.dist-info/WHEEL +5 -0
  64. lingxingapi-1.0.0.dist-info/licenses/LICENSE +22 -0
  65. lingxingapi-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,3200 @@
1
+ # -*- coding: utf-8 -*-c
2
+ import datetime
3
+ from typing import Literal
4
+ from lingxingapi import errors
5
+ from lingxingapi.base.api import BaseAPI
6
+ from lingxingapi.base import schema as base_schema
7
+ from lingxingapi.sales import param, route, schema
8
+
9
+
10
+ # Type Aliases ---------------------------------------------------------------------------------------------------------
11
+ SEARCH_FIELD = Literal["asin", "msku", "lsku"]
12
+ ORDER_STATUS = Literal[
13
+ "Pending",
14
+ "Shipped",
15
+ "Unshipped",
16
+ "PartiallyShipped",
17
+ "Canceled",
18
+ ]
19
+
20
+
21
+ # API ------------------------------------------------------------------------------------------------------------------
22
+ class SalesAPI(BaseAPI):
23
+ """领星API `销售数据` 接口
24
+
25
+ ## Notice
26
+ 请勿直接实例化此类
27
+ """
28
+
29
+ # 公共 API --------------------------------------------------------------------------------------
30
+ # Listing - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
31
+ async def Listings(
32
+ self,
33
+ sids: int | list[int],
34
+ *,
35
+ search_field: SEARCH_FIELD | None = None,
36
+ search_mode: int | None = None,
37
+ search_value: str | list[str] | None = None,
38
+ deleted: int | None = None,
39
+ paired: int | None = None,
40
+ pair_start_time: str | datetime.date | datetime.datetime = None,
41
+ pair_end_time: str | datetime.date | datetime.datetime = None,
42
+ update_start_time: str | datetime.date | datetime.datetime = None,
43
+ update_end_time: str | datetime.date | datetime.datetime = None,
44
+ product_type: int | None = None,
45
+ offset: int | None = None,
46
+ length: int | None = None,
47
+ ) -> schema.Listings:
48
+ """查询亚马逊的Listing信息
49
+
50
+ ## Docs
51
+ - 销售 - Listing: [查询亚马逊Listing](https://apidoc.lingxing.com/#/docs/Sale/Listing)
52
+
53
+ :param sids `<'int/list[int]'>`: 领星店铺ID或ID列表, 参数来源: `Seller.sid`
54
+ :param search_field `<'str'>`: 搜索字段, 默认 `None` (不搜索)
55
+
56
+ - `"asin"`: 商品ASIN码
57
+ - `"msku"`: 亚马逊卖家SKU
58
+ - `"lsku"`: 领星本地商品SKU
59
+
60
+ :param search_mode `<'int'>`: 搜索模式, 默认 `None` (使用: 1)
61
+
62
+ - `0`: 模糊搜索
63
+ - `1`: 精确搜索
64
+
65
+ :param search_value `<'str/list[str]'>`: 搜索值 (最多支持10个),
66
+ 根据 search_field 和 search_mode 进行匹配, 默认 `None` (不搜索)
67
+
68
+ :param deleted `<'int'>`: 是否已删除, 默认 `None` (不筛选), 参数来源: `Listing.deleted`
69
+
70
+ - `0`: 未删除
71
+ - `1`: 已删除
72
+
73
+ :param paired `<'int'>`: 是否已完成领星配对, 默认 `None` (不筛选)
74
+
75
+ - `0`: 未配对
76
+ - `1`: 已配对
77
+
78
+ :param pair_start_time `<'str/date/datetime'>`: 领星配对更新开始时间,
79
+ 默认 `None` (不筛选), 参数来源: `Listing.pair_time_cnt`
80
+ :param pair_end_time `<'str/date/datetime'>`: 领星配对更新结束时间,
81
+ 默认 `None` (不筛选), 参数来源: `Listing.pair_time_cnt`
82
+ :param update_start_time `<'str/date/datetime'>`: 亚马逊更新开始时间,
83
+ 默认 `None` (不筛选), 参数来源: `Listing.update_time_utc`
84
+ :param update_end_time `<'str/date/datetime'>`: 亚马逊更新结束时间,
85
+ 默认 `None` (不筛选), 参数来源: `Listing.update_time_utc`
86
+ :param product_type `<'int'>`: 产品类型, 默认 `None` (不筛选), 参数来源: `Listing.product_type`
87
+
88
+ - `1`: 普通产品
89
+ - `2`: 多属性产品
90
+
91
+ :param offset `<'int'>`: 分页偏移量, 默认 `None` (使用: 0)
92
+ :param length `<'int'>`: 分页长度, 最大支持 1000, 默认 `None` (使用: 1000)
93
+ :returns `<'Listings'>`: 返回查询到的 Listing 信息列表
94
+ ```python
95
+ {
96
+ # 状态码
97
+ "code": 0,
98
+ # 提示信息
99
+ "message": "success",
100
+ # 错误信息
101
+ "errors": [],
102
+ # 请求ID
103
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
104
+ # 响应时间
105
+ "response_time": "2025-08-13 19:23:04",
106
+ # 响应数据量
107
+ "response_count": 2,
108
+ # 总数据量
109
+ "total_count": 2,
110
+ # 响应数据
111
+ "data": [
112
+ {
113
+ # 领星店铺ID (Seller.sid) [sid + msku 唯一标识]
114
+ "sid": 1,
115
+ # 商品国家 (中文) [原字段 'marketplace']
116
+ "country": "德国",
117
+ # 商品ASIN码 (Amazon Standard Identification Number)
118
+ "asin": "B0********",
119
+ # 商品父ASIN码 (变体商品的主ASIN, 无变体则与 asin 相同)
120
+ "parent_asin": "B0********",
121
+ # 亚马逊商品SKU [原字段 'seller_sku']
122
+ "msku": "sk*******",
123
+ # 领星本地商品SKU [原字段 'local_sku']
124
+ "lsku": "sk*******",
125
+ # 亚马逊FBA自生成的商品编号
126
+ "fnsku": "X00*******",
127
+ # 领星本地商品名称 [原字段 'local_name']
128
+ "product_name": "pr*******",
129
+ # 品牌名称 [原字段 'brand_name']
130
+ "brand": "Ec*******",
131
+ # 商品标题 [原字段 'item_name']
132
+ "title": "Pr*******",
133
+ # 商品略缩图链接 [原字段 'small_image_url']
134
+ "thunbnail_url": "https://m.*******.jpg",
135
+ # 产品类型 (1: 普通产品, 2: 多属性产品) [原字段 'store_type']
136
+ "product_type": 1,
137
+ # 商品价格的货币代码
138
+ "currency_code": "EUR", # 商品价格的货币代码
139
+ # 商品标准价 (不包含促销, 运费, 积分) [原字段 'price']
140
+ "standard_price": 50.99,
141
+ # 商品优惠价 [原字段 'listing_price']
142
+ "sale_price": 43.99,
143
+ # 商品运费
144
+ "shipping": 0.0,
145
+ # 商品积分 (适用于日本站点)
146
+ "points": 0.0,
147
+ # 商品到手价 (包含促销, 运费, 积分)
148
+ "landed_price": 43.99,
149
+ # 商品昨天的总销售额 [原字段 'yesterday_amount']
150
+ "sales_amt_1d": 660.96,
151
+ # 商品7天的总销售额 [原字段 'seven_amount']
152
+ "sales_amt_7d": 2183.26,
153
+ # 商品7天的总销售额 [原字段 'seven_amount']
154
+ "sales_amt_14d": 6111.12,
155
+ # 商品30天的总销售额 [原字段 'thirty_amount']
156
+ "sales_amt_30d": 15910.32,
157
+ # 商品昨天的总销量 [原字段 'yesterday_volume']
158
+ "sales_qty_1d": 15,
159
+ # 商品7天的总销量 [原字段 'total_volume']
160
+ "sales_qty_7d": 50,
161
+ # 商品14天的总销量 [原字段 'fourteen_volume']
162
+ "sales_qty_14d": 140,
163
+ # 商品30天的总销量 [原字段 'thirty_volume']
164
+ "sales_qty_30d": 367,
165
+ # 商品7天的日均销量 [原字段 'average_seven_volume']
166
+ "sales_avg_qty_7d": 7.1,
167
+ # 商品14天的日均销量 [原字段 'average_fourteen_volume']
168
+ "sales_avg_qty_14d": 10.0,
169
+ # 商品30天的日均销量 [原字段 'average_thirty_volume']
170
+ "sales_avg_qty_30d": 12.2,
171
+ # 商品所属主类目 [原字段 'seller_category_new']
172
+ "category": ["Computer & Zubehör"],
173
+ # 商品主类目排名 [原字段 'seller_rank']
174
+ "category_rank": 5710,
175
+ # 商品小类和排名列表 [原字段 'small_rank']
176
+ "subcategories": [
177
+ {
178
+ # 商品所属小类目 [原字段 'category']
179
+ "subcategory": "Tintenpatronen",
180
+ # 商品小类目排名 [原字段 'rank']
181
+ "subcategory_rank": 502,
182
+ },
183
+ ...
184
+ ],
185
+ # 商品评价数量 [原字段 'review_num']
186
+ "review_count": 100,
187
+ # 商品评价星级 [原字段 'last_star']
188
+ "review_stars": 5.0,
189
+ # 商品配送方式 (如: "FBA" 或 "FBM") [原字段 'fulfillment_channel_type']
190
+ "fulfillment_channel": "FBA",
191
+ # FBM 可售库存数量 [原字段 'quantity']
192
+ "mfn_fulfillable": 0,
193
+ # FBA 在库可售的库存数量 [原字段 'afn_fulfillable_quantity']
194
+ "afn_fulfillable": 1026,
195
+ # FBA 在库不可售的库存数量 [原字段 'afn_unsellable_quantity']
196
+ "afn_unsellable": 13,
197
+ # FBA 在库待调仓的库存数量 [原字段 'reserved_fc_processing']
198
+ "afn_reserved_fc_processing": 8,
199
+ # FBA 在库调仓中的库存数量 [原字段 'reserved_fc_transfers']
200
+ "afn_reserved_fc_transfers": 193,
201
+ # FBA 在库待发货的库存数量 [原字段 'reserved_customerorders']
202
+ "afn_reserved_customer_order": 26,
203
+ # FBA 发货计划入库的库存数量 [原字段 'afn_inbound_working_quantity']
204
+ "afn_inbound_working": 0,
205
+ # FBA 发货在途的库存数量 [原字段 'afn_inbound_shipped_quantity']
206
+ "afn_inbound_shipped": 800,
207
+ # FBA 发货入库接收中的库存数量 [原字段 'afn_inbound_receiving_quantity']
208
+ "afn_inbound_receiving": 0,
209
+ # 商品状态 (0: 停售, 1: 在售)
210
+ "status": 1,
211
+ # 商品是否已删除 (0: 未删除, 1: 已删除) [原字段 'is_delete']
212
+ "deleted": 0,
213
+ # 商品创建时间 (时区时间) [原字段 'open_date_display']
214
+ "create_time": "2024-07-20 09:44:06 +03:00",
215
+ # 商品开售日期 (如: "2023-06-23") [原字段 'on_sale_time']
216
+ "on_sale_date": "2024-07-20", # 开售日期 [原字段 'on_sale_time']
217
+ # 商品首次下单日期 (如: "2023-06-23") [原字段 'first_order_time']
218
+ "first_order_date": "2024-07-26", # 首次下单日期 [原字段 'first_order_time']
219
+ # 商品更新时间 (UTC时间) [原字段 'listing_update_date']
220
+ "update_time_utc": "2025-05-22 16:06:56",
221
+ # 领星配对时间 (北京时间) [原字段 'pair_update_time']
222
+ "pair_time_cnt": "2025-03-14 19:03:28",
223
+ # 商品尺寸和重量 [原字段 'dimension_info']
224
+ "dimensions": [
225
+ {
226
+ # 商品高度
227
+ "item_height": 1.46,
228
+ # 商品高度单位 [原字段 'item_height_units_type']
229
+ "item_height_unit": "inches",
230
+ # 商品长度
231
+ "item_length": 4.41,
232
+ # 商品长度单位 [原字段 'item_length_units_type']
233
+ "item_length_unit": "inches",
234
+ # 商品宽度
235
+ "item_width": 4.8,
236
+ # 商品宽度单位 [原字段 'item_width_units_type']
237
+ "item_width_unit": "inches",
238
+ # 商品重量
239
+ "item_weight": 0.0,
240
+ # 商品重量单位 [原字段 'item_weight_units_type']
241
+ "item_weight_unit": "",
242
+ # 商品包装高度
243
+ "package_height": 1.54,
244
+ # 商品包装高度单位 [原字段 'package_height_units_type']
245
+ "package_height_unit": "inches",
246
+ # 商品包装长度
247
+ "package_length": 6.22,
248
+ # 商品包装长度单位 [原字段 'package_length_units_type']
249
+ "package_length_unit": "inches",
250
+ # 商品包装宽度
251
+ "package_width": 4.45,
252
+ # 商品包装宽度单位 [原字段 'package_width_units_type']
253
+ "package_width_unit": "inches",
254
+ # 商品包装重量
255
+ "package_weight": 0.2,
256
+ # 商品包装重量单位 [原字段 'package_weight_units_type']
257
+ "package_weight_unit": "pounds",
258
+ },
259
+ ...
260
+ ],
261
+ # 商品负责人 [原字段 'principal_info']
262
+ "operators": [
263
+ {
264
+ # 负责人的领星帐号ID (Account.user_id) [原字段 'principal_uid']
265
+ "user_id": 1*******,
266
+ # 负责人的领星帐号显示姓名 (Account.display_name) [原字段 'principal_name']
267
+ "user_name": "白小白"
268
+ },
269
+ ...
270
+ ],
271
+ # 商品标签信息 [原字段 'global_tags']
272
+ "tags": [
273
+ {
274
+ # 领星标签ID (ListingGlobalTag.tag_id) [原字段 'globalTagId']
275
+ "tag_id": 1000**************,
276
+ # 领星标签名称 (ListingGlobalTag.tag_name) [原字段 'tagName']
277
+ "tag_name": "特殊产品",
278
+ # 领星标签颜色 [原字段 'color']
279
+ "tag_color": "#4B8BFA"
280
+ },
281
+ ...
282
+ ],
283
+ },
284
+ ...
285
+ ],
286
+ }
287
+ ```
288
+ """
289
+ url = route.LISTINGS
290
+ # 解析并验证参数
291
+ args = {
292
+ "sids": sids,
293
+ "search_field": search_field,
294
+ "search_mode": search_mode,
295
+ "search_value": search_value,
296
+ "deleted": deleted,
297
+ "paired": paired,
298
+ "pair_start_time": pair_start_time,
299
+ "pair_end_time": pair_end_time,
300
+ "update_start_time": update_start_time,
301
+ "update_end_time": update_end_time,
302
+ "product_type": product_type,
303
+ "offset": offset,
304
+ "length": length,
305
+ }
306
+ try:
307
+ p = param.Listings.model_validate(args)
308
+ except Exception as err:
309
+ raise errors.InvalidParametersError(err, url, args) from err
310
+
311
+ # 发送请求
312
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
313
+ return schema.Listings.model_validate(data)
314
+
315
+ async def EditListingOperators(
316
+ self,
317
+ *operator: dict,
318
+ ) -> schema.EditListingResult:
319
+ """批量更新Listing的负责人
320
+
321
+ ## Docs:
322
+ - 销售 - Listing: [批量分配Listing负责人](https://apidoc.lingxing.com/#/docs/Sale/UpdatePrincipal)
323
+
324
+ :params *operator `<'dict'>`: 支持最多200个Listing的负责人分配信息
325
+
326
+ - 每个字典必须包含 `sid`, `asin`, `name` 字段, 如:
327
+ `{'sid': 1, 'asin': 'B0XXXXXXXX', 'name': ['白小白']}`
328
+ - 必填字段 `sid` 领星店铺ID, 必须是 int 类型, 参数来源: `Listing.sid`
329
+ - 必填字段 `asin` 商品ASIN码, 必须是 str 类型, 参数来源: `Listing.asin`
330
+ - 可选字段 `name` 负责人名称, 可以是 str 或 list[str] 类型, 最多支持10个负责人,
331
+ 若不填写或传入 `None` 则表示清空负责人, 参数来源: `Account.display_name`
332
+
333
+ :returns `<'EditListingResult'>`: 返回批量更新的结果
334
+ ```python
335
+ {
336
+ # 状态码
337
+ "code": 0,
338
+ # 提示信息
339
+ "message": "success",
340
+ # 错误信息
341
+ "errors": [{'index': 0, 'message': '负责人:白小白不存在'}],
342
+ # 请求ID
343
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
344
+ # 响应时间
345
+ "response_time": "2025-08-13 19:23:04",
346
+ # 响应结果
347
+ "data": {
348
+ # 总更新个数
349
+ "total": 2,
350
+ # 更新成功个数 [原字段 'success']
351
+ "success": 1,
352
+ # 更新失败个数 [原字段 'error']
353
+ "failure": 1,
354
+ },
355
+ }
356
+ ```
357
+ """
358
+ url = route.EDIT_LISTING_OPERATORS
359
+ # 解析并验证参数
360
+ args = {"operators": operator}
361
+ try:
362
+ p = param.EditListingOperators.model_validate(args)
363
+ except Exception as err:
364
+ raise errors.InvalidParametersError(err, url, args) from err
365
+
366
+ # 发送请求
367
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
368
+ return schema.EditListingResult.model_validate(data)
369
+
370
+ async def EditListingPrices(
371
+ self,
372
+ *price: dict,
373
+ ) -> schema.EditListingPricesResult:
374
+ """批量修改Listing的价格
375
+
376
+ ## Docs:
377
+ - 销售 - Listing: [批量修改Listing价格](https://apidoc.lingxing.com/#/docs/Sale/pricingSubmit)
378
+
379
+ :params *prices `<'dict'>`: 支持多个Listing的价格修改信息
380
+
381
+ - 每个字典必须包含 `sid`, `msku`, `standard_price` 字段, 如:
382
+ `{"sid": 1, "msku": "SKU*******", "standard_price": 42.98}`
383
+ - 必填字段 `sid` 领星店铺ID, 必须是 int 类型, 参数来源: `Listing.sid`
384
+ - 必填字段 `msku` 亚马逊卖家SKU, 必须是 str 类型, 参数来源: `Listing.msku`
385
+ - 必填字段 `standard_price` 商品标准价, 必须是 float 类型, 参数来源: `Listing.standard_price`
386
+ - 可选字段 `sale_price` 商品优惠价, 必须是 float 类型, 参数来源: `Listing.sale_price`
387
+ - 可选字段 `start_date` 商品优惠价开始时间, 必须是 str/date/datetime 类型
388
+ - 可选字段 `end_date` 商品优惠价结束时间, 必须是 str/date/datetime 类型
389
+
390
+ :returns `<'EditListingPriceResult'>`: 返回批量修改的结果
391
+ ```python
392
+ {
393
+ # 状态码
394
+ "code": 0,
395
+ # 提示信息
396
+ "message": "success",
397
+ # 错误信息
398
+ "errors": [],
399
+ # 请求ID
400
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
401
+ # 响应时间
402
+ "response_time": "2025-08-13 19:23:04",
403
+ # 响应结果
404
+ "data": {
405
+ # 更新成功个数 [原字段 'success_num']
406
+ 'success': 1,
407
+ # 更新失败个数 [原字段 'failure_num']
408
+ 'failure': 1,
409
+ # 更新失败的详情
410
+ 'failure_detail': [
411
+ {
412
+ # 领星店铺ID (Seller.sid)
413
+ 'sid': 1,
414
+ # 商品ASIN码 (Listing.asin)
415
+ 'asin': 'B0********',
416
+ # 亚马逊卖家SKU (Listing.msku)
417
+ 'msku': 'SKU*******',
418
+ # 错误信息 [原字段 'msg']
419
+ 'message': '当前调价未完成,请勿重复操作'
420
+ },
421
+ ...
422
+ ],
423
+ },
424
+ }
425
+ ```
426
+ """
427
+ url = route.EDIT_LISTING_PRICES
428
+ # 解析并验证参数
429
+ args = {"prices": price}
430
+ try:
431
+ p = param.EditListingPrices.model_validate(args)
432
+ except Exception as err:
433
+ raise errors.InvalidParametersError(err, url, args) from err
434
+
435
+ # 发送请求
436
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
437
+ return schema.EditListingPricesResult.model_validate(data)
438
+
439
+ async def PairListingProducts(
440
+ self,
441
+ *pair_product: dict,
442
+ ) -> schema.EditListingResult:
443
+ """批量添加Listing与领星本地SKU的配对关系
444
+
445
+ ## Docs:
446
+ - 销售 - Listing: [批量添加/编辑Listing配对](https://apidoc.lingxing.com/#/docs/Sale/Productlink)
447
+
448
+ :params *pair_product `<'dict'>`: 支持添加多个Listing与领星本地SKU的配对关系
449
+
450
+ - 每个字典必须包含 `msku`, `lsku`, `sync_pic` 字段, 如:
451
+ `{"msku": "SKU*******", "lsku": "LOCAL*******", "sync_pic": 1}`
452
+ - 必填字段 `msku` 亚马逊卖家SKU, 必须是 str 类型, 参数来源: `Listing.msku`
453
+ - 必填字段 `lsku` 领星本地SKU, 必须是 str 类型, 参数来源: `Listing.lsku`
454
+ - 必填字段 `sync_pic` 领星本地SKU是否同步Listing图片, 必须是 int 类型 (0: 否, 1: 是)
455
+ - 可选字段 `seller_id` 亚马逊卖家ID, 必须是 str 类型, 参数来源: `Seller.seller_id`
456
+ - 可选字段 `marketplace_id` 亚马逊市场ID, 必须是 str 类型, 参数来源: `Seller.marketplace_id`
457
+
458
+ :returns `<'UpdateListingResult'>`: 返回批量配对的结果
459
+ ```python
460
+ {
461
+ # 状态码
462
+ "code": 0,
463
+ # 提示信息
464
+ "message": "success",
465
+ # 错误信息
466
+ "errors": [],
467
+ # 请求ID
468
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
469
+ # 响应时间
470
+ "response_time": "2025-08-13 19:23:04",
471
+ # 响应结果
472
+ "data": {
473
+ # 总更新个数
474
+ "total": 1,
475
+ # 更新成功个数 [原字段 'success']
476
+ "success": 1,
477
+ # 更新失败个数 [原字段 'error']
478
+ "failure": 0,
479
+ },
480
+ }
481
+ ```
482
+ """
483
+ url = route.PAIR_LISTING_PRODUCTS
484
+ # 解析并验证参数
485
+ args = {"pair_products": pair_product}
486
+ try:
487
+ p = param.PairListingProducts.model_validate(args)
488
+ except Exception as err:
489
+ raise errors.InvalidParametersError(err, url, args) from err
490
+
491
+ # 发送请求
492
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
493
+ return schema.EditListingResult.model_validate(data)
494
+
495
+ async def UnpairListingProducts(
496
+ self,
497
+ *unpair_product: dict,
498
+ ) -> base_schema.ResponseResult:
499
+ """批量解除Listing与领星本地SKU的配对关系
500
+
501
+ ## Docs:
502
+ - 销售 - Listing: [解除Listing配对](https://apidoc.lingxing.com/#/docs/Sale/UnlinkListing)
503
+
504
+ :params *unpair_product `<'dict'>`: 支持解除多个Listing与领星本地SKU的配对关系
505
+
506
+ - 每个字典必须包含 `sid` 和 `msku` 字段, 如:
507
+ `{“sid”: 1, "msku": "SKU*******"}`
508
+ - 必填字段 `sid` 领星店铺ID, 必须是 int 类型, 参数来源: `Listing.sid`
509
+ - 必填字段 `msku` 亚马逊卖家SKU, 必须是 str 类型, 参数来源: `Listing.msku`
510
+
511
+ :returns `<'ResponseResult'>`: 返回批量解除配对的结果
512
+ ```python
513
+ {
514
+ # 状态码
515
+ "code": 0,
516
+ # 提示信息
517
+ "message": "success",
518
+ # 错误信息
519
+ "errors": [],
520
+ # 请求ID
521
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
522
+ # 响应时间
523
+ "response_time": "2025-08-13 19:23:04",
524
+ # 响应结果
525
+ "data": None,
526
+ }
527
+ ```
528
+ """
529
+ url = route.UNPAIR_LISTING_PRODUCTS
530
+ # 解析并验证参数
531
+ args = {"unpair_products": unpair_product}
532
+ try:
533
+ p = param.UnpairListingProducts.model_validate(args)
534
+ except Exception as err:
535
+ raise errors.InvalidParametersError(err, url, args) from err
536
+
537
+ # 发送请求
538
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
539
+ return base_schema.ResponseResult.model_validate(data)
540
+
541
+ async def ListingGlobalTags(
542
+ self,
543
+ *,
544
+ search_value: str | None = None,
545
+ offset: int | None = None,
546
+ length: int | None = None,
547
+ ) -> schema.ListingGlobalTags:
548
+ """查询Listing可标记的全局标签
549
+
550
+ ## Docs:
551
+ - 销售 - Listing: [查询Listing标签列表](https://apidoc.lingxing.com/#/docs/Sale/globalTagPageList)
552
+
553
+ :param search_value `<'str'>`: 查询的标签名称, 默认 `None` (所有标签),
554
+ 参数来源: `ListingGlobalTag.tag_name`
555
+ :param offset `<'int'>`: 分页偏移量, 默认 `None` (使用: 0)
556
+ :param length `<'int'>`: 分页长度, 最大支持 200, 默认 `None` (使用: 20)
557
+ :returns `<'ListingGlobalTags'>`: 返回查询到的 Listing 标签信息列表
558
+ ```python
559
+ {
560
+ # 状态码
561
+ "code": 0,
562
+ # 提示信息
563
+ "message": "success",
564
+ # 错误信息
565
+ "errors": [],
566
+ # 请求ID
567
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
568
+ # 响应时间
569
+ "response_time": "2025-08-13 19:23:04",
570
+ # 响应数据量
571
+ "response_count": 2,
572
+ # 总数据量
573
+ "total_count": 2,
574
+ # 响应数据
575
+ "data": [
576
+ {
577
+ # 领星标签ID [原字段 'global_tag_id']
578
+ 'tag_id': '900000000000000000',
579
+ # 领星标签名称
580
+ 'tag_name': '特殊Listing',
581
+ # 标签类型 [原字段 'type']
582
+ 'tag_type': '商品标签',
583
+ # 标签的关联对象 [原字段 'tag_object']
584
+ 'tag_attachment': 'ASIN',
585
+ # 标签当前关联对象的总数量 [原字段 'relation_count']
586
+ 'tag_attachment_count': 1,
587
+ # 标签最初创建者 (Account.display_name) [原字段 'create_by_name']
588
+ 'created_by': '白小白',
589
+ # 标签创建时间 (北京时间) [原字段 'create_by']
590
+ 'create_time': '2023-08-20 09:53:08',
591
+ # 标签最后编辑者 (Account.display_name) [原字段 'modify_by_name']
592
+ 'modified_by': '白小白',
593
+ # 标签修改时间 (北京时间) [原字段 'modify_by']
594
+ 'modify_time': '2024-08-20 09:53:08',
595
+ },
596
+ ...
597
+ ],
598
+ }
599
+ ```
600
+ """
601
+ url = route.LISTING_GLOBAL_TAGS
602
+ # 解析并验证参数
603
+ args = {
604
+ "search_value": search_value,
605
+ "search_field": "tag_name" if search_value is not None else None,
606
+ "offset": offset,
607
+ "length": length,
608
+ }
609
+ try:
610
+ p = param.ListingGlobalTags.model_validate(args)
611
+ except Exception as err:
612
+ raise errors.InvalidParametersError(err, url, args) from err
613
+
614
+ # 发送请求
615
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
616
+ return schema.ListingGlobalTags.model_validate(data)
617
+
618
+ async def CreateListingGlobalTag(self, tag_name: str) -> base_schema.ResponseResult:
619
+ """创建Listing可设置的全局标签
620
+
621
+ ## Docs:
622
+ - 销售 - Listing: [添加Listing标签](https://apidoc.lingxing.com/#/docs/Sale/globalTagAddTag)
623
+
624
+ :param tag_name `<'str'>`: 领星标签名称, 如: `"特殊Listing"`
625
+ :returns `<'ResponseResult'>`: 返回添加结果
626
+ ```python
627
+ {
628
+ # 状态码
629
+ "code": 0,
630
+ # 提示信息
631
+ "message": "success",
632
+ # 错误信息
633
+ "errors": [],
634
+ # 请求ID
635
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
636
+ # 响应时间
637
+ "response_time": "2025-08-13 19:23:04",
638
+ # 响应结果
639
+ "data": None,
640
+ }
641
+ ```
642
+ """
643
+ url = route.CREATE_LISTING_GLOBAL_TAG
644
+ # 解析并验证参数
645
+ args = {"tag_name": tag_name}
646
+ try:
647
+ p = param.CreateListingGlobalTag.model_validate(args)
648
+ except Exception as err:
649
+ raise errors.InvalidParametersError(err, url, args) from err
650
+
651
+ # 发送请求
652
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
653
+ return base_schema.ResponseResult.model_validate(data)
654
+
655
+ async def RemoveListingGlobalTag(self, *tag_id: str) -> base_schema.ResponseResult:
656
+ """删除Listing可设置的全局标签
657
+
658
+ ## Docs:
659
+ - 销售 - Listing: [删除Listing标签](https://apidoc.lingxing.com/#/docs/Sale/globalTagRemoveTag)
660
+
661
+ :param *tag_id `<'str'>`: 支持最多删除200个标签ID, 参数来源: `ListingGlobalTag.tag_id`
662
+ :returns `<'ResponseResult'>`: 返回删除结果
663
+ ```python
664
+ {
665
+ # 状态码
666
+ "code": 0,
667
+ # 提示信息
668
+ "message": "success",
669
+ # 错误信息
670
+ "errors": [],
671
+ # 请求ID
672
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
673
+ # 响应时间
674
+ "response_time": "2025-08-13 19:23:04",
675
+ # 响应结果
676
+ "data": None,
677
+ }
678
+ ```
679
+ """
680
+ url = route.REMOVE_LISTING_GLOBAL_TAG
681
+ # 解析并验证参数
682
+ args = {"tag_ids": tag_id}
683
+ try:
684
+ p = param.RemoveListingGlobalTag.model_validate(args)
685
+ except Exception as err:
686
+ raise errors.InvalidParametersError(err, url, args) from err
687
+
688
+ # 发送请求
689
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
690
+ return base_schema.ResponseResult.model_validate(data)
691
+
692
+ async def ListingTags(self, *msku: dict) -> schema.ListingTags:
693
+ """查询指定Listing当前标记的标签
694
+
695
+ ## Docs:
696
+ - 销售 - Listing: [查询Listing标记标签列表](https://apidoc.lingxing.com/#/docs/Sale/queryListingRelationTagList)
697
+
698
+ :param *msku `<'dict'>`: 支持最多查询100个Listing当前标记的标签
699
+
700
+ - 每个字典必须包含 `sid` 和 `msku` 字段, 如:
701
+ `{"sid": 1, "msku": "SKU*******"}`
702
+ - 必填字段 `sid` 领星店铺ID, 必须是 int 类型, 参数来源: `Listing.sid`
703
+ - 必填字段 `msku` 亚马逊卖家SKU, 必须是 str 类型, 参数来源: `Listing.msku`
704
+
705
+ :returns `<'ListingTags'>`: 返回批量查询的Listing当前所标记的标签信息列表
706
+ ```python
707
+ {
708
+ # 状态码
709
+ "code": 0,
710
+ # 提示信息
711
+ "message": "success",
712
+ # 错误信息
713
+ "errors": [],
714
+ # 请求ID
715
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
716
+ # 响应时间
717
+ "response_time": "2025-08-13 19:23:04",
718
+ # 响应数据量
719
+ "response_count": 2,
720
+ # 总数据量
721
+ "total_count": 2,
722
+ # 响应数据
723
+ "data": [
724
+ {
725
+ # 领星店铺ID (Seller.sid)
726
+ "sid": 1,
727
+ # 亚马逊卖家SKU (Listing.msku) [原字段 'relation_id']
728
+ "msku": "SKU*******",
729
+ # 标签信息列表 [原字段 'tag_infos']
730
+ "tags": [
731
+ {
732
+ # 领星标签ID (ListingGlobalTag.tag_id) [原字段 'global_tag_id']
733
+ "tag_id": "90000*************",
734
+ # 领星标签名称 (ListingGlobalTag.tag_name) [原字段 'tag_name']
735
+ "tag_name": "特殊",
736
+ # 领星标签颜色 [原字段 'color']
737
+ "tag_color": "#F05B56",
738
+ },
739
+ ...
740
+ ]
741
+ },
742
+ ...
743
+ ],
744
+ }
745
+ ```
746
+ """
747
+ url = route.LISTING_TAGS
748
+ # 解析并验证参数
749
+ args = {"mskus": msku}
750
+ try:
751
+ p = param.ListingTagsMskus.model_validate(args)
752
+ except Exception as err:
753
+ raise errors.InvalidParametersError(err, url, args) from err
754
+
755
+ # 发送请求
756
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
757
+ return schema.ListingTags.model_validate(data)
758
+
759
+ async def SetListingTag(
760
+ self,
761
+ tag_ids: str | list[str],
762
+ *msku: dict,
763
+ ) -> base_schema.ResponseResult:
764
+ """批量给指定Listing设置标签
765
+
766
+ ## Docs:
767
+ - 销售 - Listing: [Listing新增商品标签](https://apidoc.lingxing.com/#/docs/Sale/AddGoodsTag)
768
+
769
+ :param tag_ids `<'str/list[str]'>`: 单个领星标签ID或ID列表, 参数来源: `ListingGlolbalTag.tag_id`
770
+ :param *msku `<'dict'>`: 需要设置对应标签的Listing信息
771
+
772
+ - 每个字典必须包含 `sid` 和 `msku` 字段, 如:
773
+ `{"sid": 1, "msku": "SKU*******"}`
774
+ - 必填字段 `sid` 领星店铺ID, 必须是 int 类型, 参数来源: `Listing.sid`
775
+ - 必填字段 `msku` 亚马逊卖家SKU, 必须是 str 类型, 参数来源: `Listing.msku`
776
+
777
+ :returns `<'ResponseResult'>`: 返回设置结果
778
+ ```python
779
+ {
780
+ # 状态码
781
+ "code": 0,
782
+ # 提示信息
783
+ "message": "success",
784
+ # 错误信息
785
+ "errors": [],
786
+ # 请求ID
787
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
788
+ # 响应时间
789
+ "response_time": "2025-08-13 19:23:04",
790
+ # 响应结果
791
+ "data": None,
792
+ }
793
+ ```
794
+ """
795
+ url = route.SET_LISTING_TAG
796
+ # 解析并验证参数
797
+ args = {"tag_ids": tag_ids, "mskus": msku}
798
+ try:
799
+ p = param.SetListingTag.model_validate(args)
800
+ except Exception as err:
801
+ raise errors.InvalidParametersError(err, url, args) from err
802
+
803
+ # 发送请求
804
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
805
+ return base_schema.ResponseResult.model_validate(data)
806
+
807
+ async def UnsetListingTag(
808
+ self,
809
+ tag_ids: str | list[str],
810
+ *msku: dict,
811
+ ) -> base_schema.ResponseResult:
812
+ """批量给指定Listing移除标签
813
+
814
+ ## Docs:
815
+ - 销售 - Listing: [Listing删除商品标签](https://apidoc.lingxing.com/#/docs/Sale/DeleteGoodsTag)
816
+
817
+ :param tag_ids `<'str/list[str]'>`: 单个领星标签ID或ID列表, 参数来源: `ListingGlolbalTag.tag_id`
818
+ :param *msku `<'dict'>`: 需要移除对应标签的Listing信息
819
+
820
+ - 每个字典必须包含 `sid` 和 `msku` 字段, 如:
821
+ `{"sid": 1, "msku": "SKU*******"}`
822
+ - 必填字段 `sid` 领星店铺ID, 必须是 int 类型, 参数来源: `Listing.sid`
823
+ - 必填字段 `msku` 亚马逊卖家SKU, 必须是 str 类型, 参数来源: `Listing.msku`
824
+
825
+ :returns `<'ResponseResult'>`: 返回删除结果
826
+ ```python
827
+ {
828
+ # 状态码
829
+ "code": 0,
830
+ # 提示信息
831
+ "message": "success",
832
+ # 错误信息
833
+ "errors": [],
834
+ # 请求ID
835
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
836
+ # 响应时间
837
+ "response_time": "2025-08-13 19:23:04",
838
+ # 响应结果
839
+ "data": None,
840
+ }
841
+ ```
842
+ """
843
+ url = route.UNSET_LISTING_TAG
844
+ # 解析并验证参数
845
+ args = {"tag_ids": tag_ids, "mskus": msku}
846
+ try:
847
+ p = param.UnsetListingTag.model_validate(args)
848
+ except Exception as err:
849
+ raise errors.InvalidParametersError(err, url, args) from err
850
+
851
+ # 发送请求
852
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
853
+ return base_schema.ResponseResult.model_validate(data)
854
+
855
+ async def ListingFbaFees(self, *msku: dict) -> schema.ListingFbaFees:
856
+ """批量获取Listing的预估FBA费用
857
+
858
+ ## Docs:
859
+ - 销售 - Listing: [批量获取Listing费用](https://apidoc.lingxing.com/#/docs/Sale/GetPrices)
860
+
861
+ :param *msku `<'dict'>`: 支持最多500个Listing的FBA费用查询
862
+
863
+ - 每个字典必须包含 `sid` 和 `msku` 字段, 如:
864
+ `{"sid": 1, "msku": "SKU*******"}`
865
+ - 必填字段 `sid` 领星店铺ID, 必须是 int 类型, 参数来源: `Listing.sid`
866
+ - 必填字段 `msku` 亚马逊卖家SKU, 必须是 str 类型, 参数来源: `Listing.msku`
867
+
868
+ :returns `<'ListingFbaFees'>`: 返回批量查询的预估FBA费用信息列表
869
+ ```python
870
+ {
871
+ # 状态码
872
+ "code": 0,
873
+ # 提示信息
874
+ "message": "success",
875
+ # 错误信息
876
+ "errors": [],
877
+ # 请求ID
878
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
879
+ # 响应时间
880
+ "response_time": "2025-08-13 19:23:04",
881
+ # 响应数据量
882
+ "response_count": 2,
883
+ # 总数据量
884
+ "total_count": 2,
885
+ # 响应数据
886
+ "data": [
887
+ {
888
+ # 领星店铺ID (Seller.sid)
889
+ "sid": 1,
890
+ # 亚马逊卖家SKU (Listing.msku)
891
+ "msku": "SKU*******",
892
+ # 预估FBA费用
893
+ "fba_fee": 2.39,
894
+ # 预估FBA费用货币代码 [原字段 'fba_fee_currency_code']
895
+ "currency_code": "EUR"
896
+ },
897
+ ...
898
+ ],
899
+ }
900
+ ```
901
+ """
902
+ url = route.LISTING_FBA_FEES
903
+ # 解析并验证参数
904
+ args = {"mskus": msku}
905
+ try:
906
+ p = param.ListingFbaFeesMskus.model_validate(args)
907
+ except Exception as err:
908
+ raise errors.InvalidParametersError(err, url, args) from err
909
+
910
+ # 发送请求
911
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
912
+ return schema.ListingFbaFees.model_validate(data)
913
+
914
+ async def EditListingFbms(
915
+ self,
916
+ *msku: dict,
917
+ ) -> schema.EditListingFbmsResult:
918
+ """批量修改FBM库存和处理时间
919
+
920
+ ## Docs:
921
+ - 销售 - Listing: [修改FBM库存&处理时间](https://apidoc.lingxing.com/#/docs/Sale/UpdateFbmInventory)
922
+
923
+ :params *msku `<'dict'>`: 支持最多200个Listing的FBM库存修改
924
+
925
+ - 每个字典必须包含 `sid`, `msku`, `qty` 字段, 如:
926
+ `{"sid": 1, "msku": "SKU*******", "qty": 100}`
927
+ - 必填字段 `sid` 领星店铺ID, 必须是 int 类型, 参数来源: `Listing.sid`
928
+ - 必填字段 `msku` 亚马逊卖家SKU, 必须是 str 类型, 参数来源: `Listing.msku`
929
+ - 必填字段 `qty` FBM库存数量, 必须是 int 类型
930
+ - 可填字段 `ship_days` 发货/处理天数, 必须是 int 类型
931
+
932
+ :returns `<'EditListingFbmsResult'>`: 返回批量修改FBM库存的结果
933
+ ```python
934
+ {
935
+ # 状态码
936
+ "code": 0,
937
+ # 提示信息
938
+ "message": "success",
939
+ # 错误信息
940
+ "errors": [],
941
+ # 请求ID
942
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
943
+ # 响应时间
944
+ "response_time": "2025-08-13 19:23:04",
945
+ # 响应结果
946
+ "data": {
947
+ # 更新成功个数 [原字段 'successNum']
948
+ "success": 1,
949
+ # 更新失败个数 [原字段 'failureNum']
950
+ "failure": 1,
951
+ # 更新失败的详情 [原字段 'failureDetail']
952
+ "failure_detail": [
953
+ {
954
+ # 领星店铺ID (Seller.sid) [原字段 'storeId']
955
+ "sid": 1,
956
+ # 商品ASIN码 (Listing.asin)
957
+ "asin": "B0*******", # 商品ASIN码
958
+ # 亚马逊卖家SKU (Listing.msku)
959
+ "msku": "SKU*******",
960
+ # 错误信息 [原字段 'msg']
961
+ "message": "FBA类型的Listing不支持修改FBM库存"
962
+ },
963
+ ...
964
+ ],
965
+ },
966
+ }
967
+ """
968
+ url = route.EDIT_LISTING_FBMS
969
+ # 解析并验证参数
970
+ args = {"mskus": msku}
971
+ try:
972
+ p = param.EditListingFbms.model_validate(args)
973
+ except Exception as err:
974
+ raise errors.InvalidParametersError(err, url, args) from err
975
+
976
+ # 发送请求
977
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
978
+ return schema.EditListingFbmsResult.model_validate(data)
979
+
980
+ async def ListingOperationLogs(
981
+ self,
982
+ sid: int,
983
+ msku: str,
984
+ *,
985
+ operator_ids: str | list[str] | None = None,
986
+ operation_types: int | list[int] | None = None,
987
+ start_time: str | datetime.date | datetime.datetime | None = None,
988
+ end_time: str | datetime.date | datetime.datetime | None = None,
989
+ offset: int | None = None,
990
+ length: int | None = None,
991
+ ) -> schema.ListingOperationLogs:
992
+ """查询Listing操作日志
993
+
994
+ ## Docs:
995
+ - 销售 - Listing: [查询Listing操作日志列表](https://apidoc.lingxing.com/#/docs/Sale/listingOperateLogPageList)
996
+
997
+ :param sid `<'int'>`: 领星店铺ID, 参数来源: `Listing.sid`
998
+ :param msku `<'str'>`: 亚马逊卖家SKU, 参数来源: `Listing.msku`
999
+ :param operator_ids `<'str/list[str]'>`: 操作用户ID或ID列表,
1000
+ 默认 `None` (查询所有用户), 参数来源: `Account.user_id`
1001
+ :param operation_types `<'int/list[int]'>`: 操作类型或类型列表, 默认 `None` (查询所有类型)
1002
+
1003
+ - `1`: 调价
1004
+ - `2`: 调库存
1005
+ - `3`: 修改标题,
1006
+ - `4`: 编辑商品
1007
+ - `5`: B2B调价
1008
+
1009
+ :param start_time `<'str/date/datetime'>`: 操作开始时间, 默认 `None` (查询所有时间)
1010
+ :param end_time `<'str/date/datetime'>`: 操作结束时间, 默认 `None` (查询所有时间)
1011
+ :param offset `<'int'>`: 分页偏移量, 默认 `None` (使用: 0)
1012
+ :param length `<'int'>`: 分页长度, 默认 `None` (使用: 20)
1013
+ :returns `<'ListingOperationLogs'>`: 返回查询到的 Listing 操作日志信息
1014
+ ```python
1015
+ {
1016
+ # 状态码
1017
+ "code": 0,
1018
+ # 提示信息
1019
+ "message": "success",
1020
+ # 错误信息
1021
+ "errors": [],
1022
+ # 请求ID
1023
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
1024
+ # 响应时间
1025
+ "response_time": "2025-08-13 19:23:04",
1026
+ # 响应数据量
1027
+ "response_count": 2,
1028
+ # 总数据量
1029
+ "total_count": 2,
1030
+ # 响应数据
1031
+ "data": [
1032
+ {
1033
+ # 领星店铺ID (Seller.sid)
1034
+ 'sid': 9828,
1035
+ # 操作用户名称 [原字段 'operate_user']
1036
+ 'operator': '超级管理员',
1037
+ # 操作类型 [原字段 'operate_type']
1038
+ 'operation_type': 1,
1039
+ # 操作类型说明 [原字段 'operate_type_text']
1040
+ 'operation_type_desc': '调价',
1041
+ # 操作时间 (北京时间) [原字段 'operate_time']
1042
+ 'operate_time': '2025-07-14 12:16:21',
1043
+ # 操作详情 [原字段 'operate_detail']
1044
+ 'operate_detail': '手动调价: 【价格】€17.99 -> €12.11',
1045
+ },
1046
+ ...
1047
+ ],
1048
+ }
1049
+ ```
1050
+ """
1051
+ url = route.LISTING_OPERATION_LOGS
1052
+ # 解析并验证参数
1053
+ args = {
1054
+ "sid": sid,
1055
+ "msku": msku,
1056
+ "operator_ids": operator_ids,
1057
+ "operation_types": operation_types,
1058
+ "start_time": start_time,
1059
+ "end_time": end_time,
1060
+ "offset": offset,
1061
+ "length": length,
1062
+ }
1063
+ try:
1064
+ p = param.ListingOperationLogs.model_validate(args)
1065
+ except Exception as err:
1066
+ raise errors.InvalidParametersError(err, url, args) from err
1067
+
1068
+ # 发送请求
1069
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
1070
+ return schema.ListingOperationLogs.model_validate(data)
1071
+
1072
+ # 平台订单 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1073
+ async def Orders(
1074
+ self,
1075
+ start_time: str | datetime.date | datetime.datetime,
1076
+ end_time: str | datetime.date | datetime.datetime,
1077
+ *,
1078
+ time_type: int | None = None,
1079
+ time_sort: int | None = None,
1080
+ sids: int | list[int] | None = None,
1081
+ fulfillment_channel: int | None = None,
1082
+ order_status: ORDER_STATUS | list[ORDER_STATUS] | None = None,
1083
+ offset: int | None = None,
1084
+ length: int | None = None,
1085
+ ) -> schema.Orders:
1086
+ """查询亚马逊订单
1087
+
1088
+ ## Docs:
1089
+ - 销售 - 平台订单: [查询亚马逊订单列表](https://apidoc.lingxing.com/#/docs/Sale/Orderlists)
1090
+
1091
+ :param start_time `<'str/date/datetime'>`: 查询开始时间
1092
+ :param end_time `<'str/date/datetime'>`: 查询结束时间
1093
+ :param time_type `<'int'>`: 查询时间类型, 默认 `None` (使用: 1)
1094
+
1095
+ - `1`: 订购站点时间 (Order.purchase_time_loc)
1096
+ - `2`: 领星更新北京时间 (Order.modify_time_cnt)
1097
+ - `3`: 亚马逊更新UTC时间 (Order.update_time_utc)
1098
+ - `4`: 发货站点时间 (Order.shipment_time_loc)
1099
+
1100
+ :param time_sort `<'int'>`: 是否按时间排序, 默认 `None` (使用: 0)
1101
+
1102
+ - `0`: 不排序
1103
+ - `1`: 按时间降序
1104
+ - `2`: 按时间升序
1105
+
1106
+ :param sids `<'int/list[int]'>`: 领星店铺ID或ID列表,
1107
+ 默认 `None` (所有店铺), 参数来源: `Order.sid`
1108
+
1109
+ :param fulfillment_channel `<'int'>`: 配送方式,
1110
+ 默认 `None` (所有方式), 参数来源: `Order.fulfillment_channel`
1111
+
1112
+ - `1`: AFN亚马逊配送
1113
+ - `2`: MFN卖家自发货
1114
+
1115
+ :param order_status `<'str/list[str]'>`: 订单状态或状态列表,
1116
+ 默认 `None` (所有状态), 参数来源: `Order.order_status`
1117
+
1118
+ - `"Pending"` (待处理)
1119
+ - `"Shipped"` (已发货)
1120
+ - `"Unshipped"` (未发货)
1121
+ - `"PartiallyShipped"` (部分发货)
1122
+ - `"Canceled"` (已取消)
1123
+
1124
+ :param offset `<'int'>`: 分页偏移量, 默认 `None` (使用: 0)
1125
+ :param length `<'int'>`: 分页长度, 最大支持 5000, 默认 `None` (使用: 1000)
1126
+ :returns `<'Orders'>`: 返回查询到的订单信息列表
1127
+ ```python
1128
+ {
1129
+ # 状态码
1130
+ "code": 0,
1131
+ # 提示信息
1132
+ "message": "success",
1133
+ # 错误信息
1134
+ "errors": [],
1135
+ # 请求ID
1136
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
1137
+ # 响应时间
1138
+ "response_time": "2025-08-13 19:23:04",
1139
+ # 响应数据量
1140
+ "response_count": 2,
1141
+ # 总数据量
1142
+ "total_count": 2,
1143
+ # 响应数据
1144
+ "data": [
1145
+ {
1146
+ # 领星店铺ID (Seller.sid)
1147
+ "sid": 1,
1148
+ # 领星店铺名称 (Seller.name)
1149
+ "seller_name": "Store****",
1150
+ # 亚马逊订单ID
1151
+ "amazon_order_id": "205-*******-*******",
1152
+ # 销售渠道
1153
+ "sales_channel": "Amazon.co.uk",
1154
+ # 配送方式 ("AFN" 或 "MFN")
1155
+ "fulfillment_channel": "AFN",
1156
+ # 物流追踪号码
1157
+ "tracking_number": "UK3*********",
1158
+ # 订单状态
1159
+ "order_status": "Shipped",
1160
+ # 是否为退货订单 (0: 否, 1: 是)
1161
+ "is_return_order": 0,
1162
+ # 退货订单的状态 [原字段 'is_return']
1163
+ # (0: 未退货, 1: 退货中, 2: 完成退货/退款, 3: 被标记为领星本地的退货订单)
1164
+ "return_order_status": 0,
1165
+ # 是否为换货订单 (0: 否, 1: 是)
1166
+ "is_replacement_order": 0,
1167
+ # 换货订单的状态 [原字段 'is_replaced_order'] (0: 未换货, 1: 完成换货)
1168
+ "replacement_order_status": 0,
1169
+ # 是否为多渠道配送订单 (0: 否, 1: 是)
1170
+ "is_mcf_order": 0,
1171
+ # 是否被标记为领星本地的推广订单 [原字段 'is_assessed'] (0: 否, 1: 是)
1172
+ "is_promotion_tagged": 0,
1173
+ # 订单金额的货币代码 [原字段 'order_total_currency_code']
1174
+ "order_currency_code": "GBP",
1175
+ # 订单总金额 [原字段 'order_total_amount']
1176
+ "order_amt": 28.89,
1177
+ # 退款金额
1178
+ "refund_amt": 0.0,
1179
+ # 买家名字
1180
+ "buyer_name": "",
1181
+ # 买家电子邮箱
1182
+ "buyer_email": "",
1183
+ # 买家电话号码 [原字段 'phone']
1184
+ "buyer_phone": "",
1185
+ # 买家地址 [原字段 'address']
1186
+ "buyer_address": "",
1187
+ # 买家邮政编码 [原字段 'postal_code']
1188
+ "buyer_postcode": "C*** ***",
1189
+ # 订购时间 (时区时间) [原字段 'purchase_date']
1190
+ "purchase_time": "2025-07-07T13:14:58Z",
1191
+ # 订购时间 (UTC时间) [原字段 'purchase_date_local_utc']
1192
+ "purchase_time_utc": "2025-07-07 13:14:58",
1193
+ # 订购时间 (站点时间) [原字段 'purchase_date_local']
1194
+ "purchase_time_loc": "2025-07-07 14:14:58",
1195
+ # 发货时间 (时区时间) [原字段 'shipment_date']
1196
+ "shipment_time": "2025-07-07T16:54:47+00:00",
1197
+ # 发货时间 (UTC时间) [原字段 'shipment_date_utc']
1198
+ "shipment_time_utc": "2025-07-07 16:54:47",
1199
+ # 发货时间 (站点时间) [原字段 'shipment_date_local']
1200
+ "shipment_time_loc": "2025-07-07 17:54:47",
1201
+ # 最早发货时间 (时区时间) [原字段 'earliest_ship_date']
1202
+ "earliest_ship_time": "2025-07-08T22:59:59Z",
1203
+ # 最早发货时间 (UTC时间) [原字段 'earliest_ship_date_utc']
1204
+ "earliest_ship_time_utc": "2025-07-08 22:59:59",
1205
+ # 付款确认时间 (时区时间) [原字段 'posted_date_utc']
1206
+ "posted_time": "2025-07-15T20:45:48Z",
1207
+ # 付款确认时间 (UTC时间) [原字段 'posted_date']
1208
+ "posted_time_utc": "2025-07-15 20:45:48",
1209
+ # 亚马逊订单更新时间 (UTC时间) [原字段 'last_update_date_utc']
1210
+ "update_time_utc": "2025-07-08 02:23:15",
1211
+ # 亚马逊订单更新时间 (站点时间) [原字段 'last_update_date']
1212
+ "update_time_loc": "2025-07-08 03:23:15",
1213
+ # 领星订单更新时间 (北京时间) [原字段 'gmt_modified']
1214
+ "modify_time_cnt": "2025-07-08 10:31:14",
1215
+ # 领星订单更新时间 (UTC时间) [原字段 'gmt_modified_utc']
1216
+ "modify_time_utc": "2025-07-08 02:31:14",
1217
+ # 订单中的商品列表 [原字段 'items_list']
1218
+ "items": [
1219
+ {
1220
+ # 商品ASIN (Listing.asin)
1221
+ "asin": "B0D2D6922Q",
1222
+ # 亚马逊卖家SKU (Listing.msku) [原字段 'seller_sku']
1223
+ "msku": "907-FGB-305XL-1B1C-UK",
1224
+ # 领星本地SKU (Listing.lsku) [原字段 'local_sku']
1225
+ "lsku": "902-CB-305-1B1C-UK",
1226
+ # 领星本地商品名 (Listing.product_name) [原字段 'local_name']
1227
+ "product_name": "HP305-1B1C",
1228
+ # 订购数量 [原字段 'quantity_ordered']
1229
+ "order_qty": 1,
1230
+ # 订单状态
1231
+ "order_status": "Shipped",
1232
+ },
1233
+ ...
1234
+ ],
1235
+ },
1236
+ ...
1237
+ ],
1238
+ }
1239
+ ```
1240
+ """
1241
+ url = route.ORDERS
1242
+ # 解析并验证参数
1243
+ args = {
1244
+ "start_time": start_time,
1245
+ "end_time": end_time,
1246
+ "time_type": time_type,
1247
+ "time_sort": time_sort,
1248
+ "sids": sids,
1249
+ "fulfillment_channel": fulfillment_channel,
1250
+ "order_status": order_status,
1251
+ "offset": offset,
1252
+ "length": length,
1253
+ }
1254
+ try:
1255
+ p = param.Orders.model_validate(args)
1256
+ except Exception as err:
1257
+ raise errors.InvalidParametersError(err, url, args) from err
1258
+
1259
+ # 发送请求
1260
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
1261
+ return schema.Orders.model_validate(data)
1262
+
1263
+ async def OrderDetails(self, *amazon_order_ids: str) -> schema.OrderDetails:
1264
+ """查询亚马逊订单详情
1265
+
1266
+ ## Docs:
1267
+ - 销售 - 平台订单: [查询亚马逊订单详情](https://apidoc.lingxing.com/#/docs/Sale/OrderDetail)
1268
+
1269
+ :param *amazon_order_ids `<'str'>`: 支持最多查询200个订单详情, 参数来源: `Order.amazon_order_id`
1270
+ :returns `<'OrderDetails'>`: 返回查询到的订单详情信息列表
1271
+ ```python
1272
+ {
1273
+ # 状态码
1274
+ "code": 0,
1275
+ # 提示信息
1276
+ "message": "success",
1277
+ # 错误信息
1278
+ "errors": [],
1279
+ # 请求ID
1280
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
1281
+ # 响应时间
1282
+ "response_time": "2025-08-13 19:23:04",
1283
+ # 响应数据量
1284
+ "response_count": 2,
1285
+ # 总数据量
1286
+ "total_count": 2,
1287
+ # 响应数据
1288
+ "data": [
1289
+ {
1290
+ # 领星店铺ID (Seller.sid)
1291
+ "sid": 1,
1292
+ # 亚马逊订单ID (Order.amazon_order_id)
1293
+ "amazon_order_id": "171-*******-*******",
1294
+ # 销售渠道 (如: "Amazon.com")
1295
+ "sales_channel": "Amazon.es",
1296
+ # 配送方式 ("AFN" 或 "MFN")
1297
+ "fulfillment_channel": "AFN",
1298
+ # 订单类型
1299
+ "order_type": "StandardOrder",
1300
+ # 订单状态
1301
+ "order_status": "Shipped",
1302
+ # 是否为退货订单 (0: 否, 1: 是)
1303
+ "is_return_order": 0,
1304
+ # 退货订单的状态 [原字段 'is_return']
1305
+ # (0: 未退货, 1: 退货中, 2: 完成退货/退款, 3: 被标记为领星本地的退货订单)
1306
+ "return_order_status": 0,
1307
+ # 是否为换货订单 (0: 否, 1: 是)
1308
+ "is_replacement_order": 0,
1309
+ # 换货订单的状态 (0: 未换货, 1: 完成换货) [原字段 'is_replaced_order']
1310
+ "replacement_order_status": 0,
1311
+ # 是否为促销折扣订单 (0: 否, 1: 是) [原字段 'is_promotion']
1312
+ # 当 OrderDetailItem.promotion_discount_amt > 0 时,
1313
+ # 此字段为 1, 其他 discount_amt 不计做 promotioin 类型
1314
+ "is_promotion_order": 0,
1315
+ # 是否为B2B订单 (0: 否, 1: 是) [原字段 'is_business_order']
1316
+ "is_b2b_order": 0,
1317
+ # 是否为Prime订单 (0: 否, 1: 是) [原字段 'is_prime']
1318
+ "is_prime_order": 0,
1319
+ # 是否为优先配送订单 (0: 否, 1: 是)
1320
+ "is_premium_order": 0,
1321
+ # 是否为多渠道配送订单 (0: 否, 1: 是)
1322
+ "is_mcf_order": 0,
1323
+ # 是否被用户标记为领星本地的推广订单 (0: 否, 1: 是) [原字段 'is_assessed']
1324
+ "is_user_promotion_order": 0,
1325
+ # 订单已发货数量 [原字段 'number_of_items_shipped']
1326
+ "shipped_qty": 1,
1327
+ # 订单未发货数量 [原字段 'number_of_items_unshipped']
1328
+ "unshipped_qty": 0,
1329
+ # 订单金额的货币代码 [原字段 'order_total_currency_code']
1330
+ "order_currency_code": "EUR",
1331
+ # 订单金额的货币图标 [原字段 'icon']
1332
+ "order_currency_icon": "€",
1333
+ # 订单销售总金额 [原字段 'order_total_amount']
1334
+ "order_sales_amt": 29.98,
1335
+ # 订单金额费用是否含税 (1: 含税, 2: 不含税) [原字段 'taxes_included']
1336
+ "order_tax_inclusive": 1,
1337
+ # 订单税务分类 [原字段 'tax_classifications']
1338
+ "order_tax_class": "",
1339
+ # 订单配送服务级别 [原字段 'ship_service_level']
1340
+ "shipment_service": "Expedited",
1341
+ # 订单配送服务级别类型 [原字段 'shipment_service_level_category']
1342
+ "shipment_service_category": "Expedited",
1343
+ # 采购订单编号 (买家结账时输入)
1344
+ "purchase_order_number": "",
1345
+ # 付款方式 ("COD", "CVS", "Other")
1346
+ "payment_method": "Other",
1347
+ # 亚马逊结账 (CBA) 的自定义发货标签 [原字段 'cba_displayable_shipping_label']
1348
+ "cba_shipping_label": "",
1349
+ # 买家姓名
1350
+ "buyer_name": "M*****",
1351
+ # 买家电子邮箱
1352
+ "buyer_email": "v********@marketplace.amazon.es",
1353
+ # 买家电话号码 [原字段 'phone']
1354
+ "buyer_phone": "",
1355
+ # 买家所在国家 [原字段 'country']
1356
+ "buyer_country": "ES",
1357
+ # 买家所在国家代码 [原字段 'country_code']
1358
+ "buyer_country_code": "ES",
1359
+ # 买家所在省/州 [原字段 'state_or_region']
1360
+ "buyer_state": "Valencia",
1361
+ # 买家所在城市 [原字段 'city']
1362
+ "buyer_city": "Valencia",
1363
+ # 买家所在区县 [原字段 'district']
1364
+ "buyer_district": "",
1365
+ # 买家地址 [原字段 'address']
1366
+ "buyer_address": "",
1367
+ # 买家邮政编码 [原字段 'postal_code']
1368
+ "buyer_postcode": "46006",
1369
+ # 订购时间 (UTC时间) [原字段 'purchase_date_local_utc']
1370
+ "purchase_time_utc": "2025-06-29 18:32:04",
1371
+ # 订购时间 (站点时间) [原字段 'purchase_date_local']
1372
+ "purchase_time_loc": "2025-06-29 20:32:04",
1373
+ # 发货时间 (站点时间) [原字段 'shipment_date']
1374
+ "shipment_time_loc": "2025-06-30 18:09:36",
1375
+ # 最早发货时间 (UTC时间) [原字段 'earliest_ship_date_utc']
1376
+ "earliest_ship_time_utc": "2025-06-30 21:59:59",
1377
+ # 最早发货时间 (站点时间) [原字段 'earliest_ship_date']
1378
+ "earliest_ship_time_loc": "2025-06-30 23:59:59",
1379
+ # 最晚发货时间 (时区时间) [原字段 'latest_ship_date']
1380
+ "latest_ship_time": "2025-06-30T21:59:59Z",
1381
+ # 付款确认时间 (站点时间) [原字段 'posted_date']
1382
+ "posted_time_loc": "2025-07-08 23:14:12",
1383
+ # 亚马逊订单更新时间 (UTC时间) [原字段 'last_update_date_utc']
1384
+ "update_time_utc": "2025-07-18 13:26:18",
1385
+ # 亚马逊订单更新时间 (站点时间) [原字段 'last_update_date']
1386
+ "update_time_loc": "2025-07-18 15:26:18",
1387
+ # 订单中的商品 [原字段 'item_list']
1388
+ "items": [
1389
+ {
1390
+ # 领星店铺ID (Seller.sid)
1391
+ "sid": 1,
1392
+ # 领星本地商品ID
1393
+ "product_id": 2*****,
1394
+ # 领星订单详情ID [原字段 'id']
1395
+ "order_id": 10**********,
1396
+ # 亚马逊订单商品编码 [订单下唯一键,但亚马逊返回值可能会发生变更]
1397
+ "order_item_id": "5*************",
1398
+ # 商品ASIN
1399
+ "asin": "B0********",
1400
+ # 亚马逊卖家SKU [原字段 'seller_sku']
1401
+ "msku": "SKU********",
1402
+ # 领星本地商品SKU [原字段 'sku']
1403
+ "lsku": "LOCAL-SKU********",
1404
+ # 领星本地商品名称
1405
+ "product_name": "P*******",
1406
+ # 商品 ASIN 链接
1407
+ "asin_url": "https://www.amazon.es/dp/B0********",
1408
+ # 商品图片链接 [原字段 'pic_url']
1409
+ "image_url": "https://m.media-amazon.com/images/I/61******_.jpg",
1410
+ # 商品标题
1411
+ "title": "Product Title",
1412
+ # 订单商品总数量 [原字段 'quantity_ordered']
1413
+ "order_qty": 1,
1414
+ # 订单已发货数量 [原字段 'quantity_shipped']
1415
+ "shipped_qty": 1,
1416
+ # 商品促销标识 [原字段 'promotion_ids']
1417
+ "promotion_labels": [],
1418
+ # 商品价格标识 (如: "Business Price") [原字段 'price_designation']
1419
+ "price_label": "",
1420
+ # 商品销售单价 [原字段 'unit_price_amount']
1421
+ "item_price": 24.78,
1422
+ # 商品销售金额 [原字段 'item_price_amount']
1423
+ "sales_amt": 29.98,
1424
+ # 商品销售金额税费 [原字段 'item_tax_amount']
1425
+ "sales_tax_amt": 5.2,
1426
+ # 商品销售实收金额 [原字段 'sales_price_amount']
1427
+ "sales_received_amt": 29.98,
1428
+ # 买家支付运费金额 [原字段 'shipping_price_amount']
1429
+ "shipping_credits_amt": 0.0,
1430
+ # 买家支付运费税费 [原字段 'shipping_tax_amount']
1431
+ "shipping_credits_tax_amt": 0.0,
1432
+ # 买家支付礼品包装费金额 [原字段 'gift_wrap_price_amount']
1433
+ "giftwrap_credits_amt": 0.0,
1434
+ # 买家支付礼品包装费税费 [原字段 'gift_wrap_tax_amount']
1435
+ "giftwrap_credits_tax_amt": 0.0,
1436
+ # 买家支付货到付款服务费金额 (Cash On Delivery) [原字段 'cod_fee_amount']
1437
+ "cod_service_credits_amt": 0.0,
1438
+ # 卖家商品促销折扣金额 [原字段 'promotion_discount_amount']
1439
+ "promotion_discount_amt": 0.0,
1440
+ # 卖家商品促销折扣税费 [原字段 'promotion_discount_tax_amount']
1441
+ "promotion_discount_tax_amt": 0.0,
1442
+ # 卖家商品运费折扣金额 [原字段 'shipping_discount_amount']
1443
+ "shipping_discount_amt": 0.0,
1444
+ # 卖家商品运费折扣金额 [原字段 'shipping_discount_amount']
1445
+ "shipping_discount_tax_amt": 0.0,
1446
+ # 亚马逊积分抵付款金额 (日本站) [原字段 'points_monetary_value_amount']
1447
+ "points_discount_amt": 0.0,
1448
+ # 卖家货到付款服务费折扣金额 (Cash On Delivery) [原字段 'cod_fee_discount_amount']
1449
+ "cod_service_discount_amt": 0.0,
1450
+ # 卖家总折扣金额 [原字段 'promotion_amount']
1451
+ "total_discount_amt": 0.0,
1452
+ # 卖家总代扣税费 [原字段 'tax_amount']
1453
+ "withheld_tax_amt": -5.2,
1454
+ # 卖家总代扣税费是否为预估值 (0: 否, 1: 是) [原字段 'item_tax_amount_estimated']
1455
+ "withheld_tax_amt_estimated": 0,
1456
+ # 亚马逊FBA配送费用 [原字段 'fba_shipment_amount']
1457
+ "fulfillment_fee": -3.6,
1458
+ # 亚马逊FBA配送费用是否为预估值 (0: 否, 1: 是) [原字段 'fba_shipment_amount_estimated']
1459
+ "fulfillment_fee_estimated": 0,
1460
+ # 亚马逊销售佣金 [原字段 'commission_amount']
1461
+ "referral_fee": -4.5,
1462
+ # 亚马逊销售佣金是否为预估值 (0: 否, 1: 是) [原字段 'commission_amount_estimated']
1463
+ "referral_fee_estimated": 0,
1464
+ # 亚马逊收取的其他费用 (如: Amazon Exlusives Program) [原字段 'other_amount']
1465
+ "other_fee": 0.0,
1466
+ # 用户自定义推广费用名称 (如: 推广费) [原字段 'fee_name']
1467
+ "user_promotion_type": "推广费",
1468
+ # 用户自定义推广费用货币代码 [原字段 'fee_currency']
1469
+ "user_promotion_currency_code": "",
1470
+ # 用户自定义推广费用货币符号 [原字段 'fee_icon']
1471
+ "user_promotion_currency_icon": "",
1472
+ # 用户自定义推广费用本金 (原币种) [原字段 'fee_cost']
1473
+ "user_promotion_currency_fee": 0.0,
1474
+ # 用户自定义推广费用本金 (店铺币种) [原字段 'fee_cost_amount']
1475
+ "user_promotion_fee": 0.0,
1476
+ # 商品采购头程费用金额 [原字段 'cg_transport_costs']
1477
+ "cost_of_logistics_amt": 0.0,
1478
+ # 商品采购成本金额 [原字段 'cg_price']
1479
+ "cost_of_goods_amt": 12.3,
1480
+ # 商品毛利润金额 [原字段 'profit']
1481
+ "profit_amt": 4.29,
1482
+ # 商品状况(卖家提供)[原字段 'condition_note']
1483
+ "item_condition": "",
1484
+ # 商品状况ID (卖家提供) [原字段 'condition_id']
1485
+ "item_condition_id": "",
1486
+ # 商品子状况ID (卖家提供) [原字段 'condition_subtype_id']
1487
+ "item_condition_sub_id": "",
1488
+ # 礼品包装级别(买家提供) [原字段 'gift_wrap_level']
1489
+ "giftwrap_level": "",
1490
+ # 礼品包装信息(买家提供)[原字段 'gift_message_text']
1491
+ "giftwap_message": "",
1492
+ # 计划交货开始时间 [原字段 'scheduled_delivery_start_date']
1493
+ "scheduled_delivery_start_time": "",
1494
+ # 计划交货结束时间 [原字段 'scheduled_delivery_end_date']
1495
+ "scheduled_delivery_end_time": "",
1496
+ # 商品自定义JSON数据
1497
+ "customized_json": "",
1498
+ },
1499
+ ...
1500
+ ],
1501
+ },
1502
+ ...
1503
+ ],
1504
+ }
1505
+ ```
1506
+ """
1507
+ url = route.ORDER_DETAILS
1508
+ # 解析并验证参数
1509
+ args = {"amazon_order_ids": amazon_order_ids}
1510
+ try:
1511
+ p = param.OrderDetails.model_validate(args)
1512
+ except Exception as err:
1513
+ raise errors.InvalidParametersError(err, url, args) from err
1514
+
1515
+ # 发送请求
1516
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
1517
+ return schema.OrderDetails.model_validate(data)
1518
+
1519
+ async def EditOrderNote(
1520
+ self,
1521
+ sid: int,
1522
+ amazon_order_id: str,
1523
+ note: str | None,
1524
+ ) -> base_schema.ResponseResult:
1525
+ """更新订单备注
1526
+
1527
+ ## Docs
1528
+ - 销售 - 平台订单: [SC订单-设置订单备注](https://apidoc.lingxing.com/#/docs/Sale/ScOrderSetRemark)
1529
+
1530
+ :param sid `<'int'>`: 领星店铺ID, 参数来源: `Order.sid`
1531
+ :param amazon_order_id `<'str'>`: 亚马逊订单ID, 参数来源: `Order.amazon_order_id`
1532
+ :param note `<'str/None'>`: 订单备注内容, 清除备注时传入 `None` 或空字符串
1533
+ :returns `<'ResponseResult'>`: 返回更新结果
1534
+ ```python
1535
+ {
1536
+ # 状态码
1537
+ "code": 0,
1538
+ # 提示信息
1539
+ "message": "success",
1540
+ # 错误信息
1541
+ "errors": [],
1542
+ # 请求ID
1543
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
1544
+ # 响应时间
1545
+ "response_time": "2025-08-13 19:23:04",
1546
+ # 响应结果
1547
+ "data": None,
1548
+ }
1549
+ ```
1550
+ """
1551
+ url = route.EDIT_ORDER_NOTE
1552
+ # 解析并验证参数
1553
+ args = {"sid": sid, "amazon_order_id": amazon_order_id, "note": note}
1554
+ try:
1555
+ p = param.EditOrderNote.model_validate(args)
1556
+ except Exception as err:
1557
+ raise errors.InvalidParametersError(err, url, args) from err
1558
+
1559
+ # 发送请求
1560
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
1561
+ return base_schema.ResponseResult.model_validate(data)
1562
+
1563
+ async def AfterSalesOrders(
1564
+ self,
1565
+ start_date: str | datetime.date | datetime.datetime,
1566
+ end_date: str | datetime.date | datetime.datetime,
1567
+ *,
1568
+ date_type: int | None = None,
1569
+ service_type: int | list[int] | None = None,
1570
+ sids: int | list[int] = None,
1571
+ amazon_order_ids: str | list[str] | None = None,
1572
+ offset: int | None = None,
1573
+ length: int | None = None,
1574
+ ) -> schema.AfterSalesOrders:
1575
+ """查询售后订单
1576
+
1577
+ ## Docs:
1578
+ - 销售 - 平台订单: [查询售后订单列表](https://apidoc.lingxing.com/#/docs/Sale/afterSaleList)
1579
+
1580
+ :param start_date `<'str/date/datetime'>`: 查询开始日期, 左闭右开
1581
+ :param end_date `<'str/date/datetime'>`: 查询结束日期, 左闭右开
1582
+ :param date_type `<'int'>`: 查询日期类型, 默认 `None` (使用: 1)
1583
+
1584
+ - `1`: 售后时间 (AfterSalesOrder.service_time_loc)
1585
+ - `2`: 订购时间 (AfterSalesOrder.purchase_time_loc)
1586
+ - `3`: 更新时间 (AfterSalesOrder.modify_time_cnt)
1587
+
1588
+ :param service_type `<'int/list[int]'>`: 售后类型或类型列表, 默认 `None` (查询所有类型)
1589
+
1590
+ - `1`: 退款
1591
+ - `2`: 退货
1592
+ - `3`: 换货
1593
+
1594
+ :param sids `<'int/list[int]'>`: 领星店铺ID或ID列表,
1595
+ 默认 `None` (查询所有店铺), 参数来源: `Order.sid`
1596
+ :param amazon_order_ids `<'str/list[str]'>`: 亚马逊订单ID或最多50个ID列表,
1597
+ 默认 `None` (查询所有订单), 参数来源: `Order.amazon_order_id`
1598
+ :param offset `<'int'>`: 分页偏移量, 默认 `None` (使用: 0)
1599
+ :param length `<'int'>`: 分页长度, 最大值 5000, 默认 `None` (使用: 1000)
1600
+ :returns `<'AfterSalesOrders'>`: 返回查询到的售后订单信息列表.
1601
+ ```python
1602
+ {
1603
+ # 状态码
1604
+ "code": 0,
1605
+ # 提示信息
1606
+ "message": "success",
1607
+ # 错误信息
1608
+ "errors": [],
1609
+ # 请求ID
1610
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
1611
+ # 响应时间
1612
+ "response_time": "2025-08-13 19:23:04",
1613
+ # 响应数据量
1614
+ "response_count": 2,
1615
+ # 总数据量
1616
+ "total_count": 2,
1617
+ # 响应数据
1618
+ "data": [
1619
+ {
1620
+ # 领星店铺ID (Seller.sid)
1621
+ "sid": 1,
1622
+ # 领星售后订单自增ID (非唯一键) [原字段 'id']
1623
+ "after_sales_id": 100*********,
1624
+ # 亚马逊订单ID (Order.amazon_order_id)
1625
+ "amazon_order_id": "111-*******-*******",
1626
+ # 关联ID
1627
+ "correlation_id": 1*********,
1628
+ # 商品ASIN (Listing.asin)
1629
+ "asin": "B0********",
1630
+ # 亚马逊卖家SKU (Listing.msku)
1631
+ "msku": "SKU********",
1632
+ # 店铺名称+国家 (如: "领星店铺 美国")
1633
+ "seller_country": "店铺名 美国",
1634
+ # 是否为多渠道配送订单 (0: 默认值, 1: 普通订单, 2: 多渠道订单)
1635
+ "is_mcf_order": 0,
1636
+ # 送货方式 ("FBA", "FBM")
1637
+ "delivery_type": "FBA",
1638
+ # 售后类型 (如: ["退款","退货","换货"]) [原字段 'after_type_tag']
1639
+ "service_type": ["退款"],
1640
+ # 订单销售总金额 [原字段 'order_total_amount_number']
1641
+ "order_sales_amt": 31.78,
1642
+ # 订单销售总金额的货币符号 (如: "$" 或 "") [原字段 'order_total_amount_currency_code']
1643
+ "order_sales_currency_icon": "$",
1644
+ # 订单退款总金额 [原字段 'total_refund_amount_number']
1645
+ "order_refund_amt": -26.38,
1646
+ # 订单退款总金额的货币符号 (如: "$" 或 "") [原字段 'total_refund_amount_currency_code']
1647
+ "order_refund_currency_icon": "$",
1648
+ # 订单退款成本 [原字段 'total_refund_cost_number']
1649
+ "order_refund_cost_amt": 3.6,
1650
+ # 订单退款成本的货币符号 (如: "$" 或 "") [原字段 'total_refund_cost_currency_code']
1651
+ "roder_refund_cost_currency_icon": "$",
1652
+ # 订购时间 (站点时间) [原字段 'purchase_time']
1653
+ "purchase_time_loc": "2025-07-10 12:34:17",
1654
+ # 如同一个订单存在多个售后订单,需以 items>>service_time_loc 为准
1655
+ # 售后时间 (站点时间) [原字段 'deal_time']
1656
+ "service_time_loc": "2025-07-18 00:00:00",
1657
+ # 售后间隔天数 [原字段 'interval_days']
1658
+ "service_interval_days": 8,
1659
+ # 领星订单更新时间 (北京时间) [原字段 'gmt_modified']
1660
+ # 如同一个订单存在多个售后订单,需以 items>>modify_time_cnt 为准
1661
+ "modify_time_cnt": "2025-07-20 22:36:36",
1662
+ # 售后订单中的商品列表 [原字段 'item_list']
1663
+ "items": [
1664
+ {
1665
+ # 售后订单唯一标, 由多个字段拼接而成 [原字段 'item_identifier']
1666
+ "uid": "12083+********",
1667
+ # 售后订单唯一标, 由uid基于md5压缩而成 [原字段 'md5_v2']
1668
+ "uid_md5": "2c0*****************************",
1669
+ # 商品ASIN (Listing.asin)
1670
+ "asin": "B0********",
1671
+ # 亚马逊卖家SKU (Listing.msku)
1672
+ "msku": "SKU********",
1673
+ # 领星本地商品SKU (Listing.lsku) [原字段 'local_sku']
1674
+ "lsku": "LOCAL********",
1675
+ # 领星本地商品名称 (Listing.product_name) [原字段 'local_name']
1676
+ "product_name": "待补充",
1677
+ # 商品 ASIN 链接
1678
+ "asin_url": "",
1679
+ # 商品略缩图链接 [原字段 'small_image_url']
1680
+ "thunbnail_url": "https://image.distributetop.com/******.jpg",
1681
+ # 商品标题 [原字段 'item_name']
1682
+ "title": "Product Title",
1683
+ # 售后类型 (如: "退款", "退货", "换货") [原字段 'after_type']
1684
+ "service_type": "退款",
1685
+ # 售后数量 [原字段 'after_quantity']
1686
+ "service_qty": 1,
1687
+ # 售后原因 [原字段 'after_reason']
1688
+ "service_reason": "",
1689
+ # 订单退款金额 (含货币符号) [原字段 'refund_amount']
1690
+ "order_refund_amt": "$-26.380",
1691
+ # 订单退款金额详情 [原字段 'refund_amount_details']
1692
+ "order_refund_amt_details": [
1693
+ {"type": "MarketplaceFacilitatorTax-Principal", "amt": "$1.800"},
1694
+ {"type": "Commission", "amt": "$4.500"},
1695
+ {"type": "Principal", "amt": "$-29.980"},
1696
+ {"type": "RefundCommission", "amt": "$-0.900"},
1697
+ {"type": "Tax", "amt": "$-1.800"},
1698
+ ],
1699
+ # 订单退款成本 (含货币符号) [原字段 'refund_cost']
1700
+ "order_refund_cost": "$3.600",
1701
+ # 订单退款成本详情 [原字段 'refund_cost_details']
1702
+ "order_refund_cost_details": [
1703
+ {"type": "Commission", "amt": "$4.500"},
1704
+ {"type": "RefundCommission", "amt": "$-0.900"},
1705
+ ],
1706
+ # 退货状态, 如 "Approved" [原字段 'return_status']
1707
+ "order_return_status": "",
1708
+ # 换货订单号
1709
+ "exchange_order_number": "",
1710
+ # LPN编码号
1711
+ "lpn_number": "",
1712
+ # RMA订单号 [原字段 'rma_order_number']
1713
+ "rma_number": "",
1714
+ # 运单号
1715
+ "waybill_number": "",
1716
+ # 承运商
1717
+ "carriers": "",
1718
+ # 买家备注
1719
+ "buyer_note": "",
1720
+ # 库存属性
1721
+ "inventory_attributes": "",
1722
+ # 售后时间 (站点时间) [原字段 'service_time']
1723
+ "service_time_loc": "2025-07-20 07:13:36",
1724
+ # 售后间隔天数 [原字段 'after_interval']
1725
+ "service_interval_days": "10天",
1726
+ # 领星订单更新时间 (北京时间) [原字段 'gmt_modified']
1727
+ "modify_time_cnt": "2025-07-20 22:36:36",
1728
+ },
1729
+ ...
1730
+ ],
1731
+ },
1732
+ ...
1733
+ ],
1734
+ }
1735
+ ```
1736
+ """
1737
+ url = route.AFTER_SALES_ORDERS
1738
+ # 解析并验证参数
1739
+ args = {
1740
+ "start_date": start_date,
1741
+ "end_date": end_date,
1742
+ "date_type": date_type,
1743
+ "service_type": service_type,
1744
+ "sids": sids,
1745
+ "amazon_order_ids": amazon_order_ids,
1746
+ "offset": offset,
1747
+ "length": length,
1748
+ }
1749
+ try:
1750
+ p = param.AfterSalesOrder.model_validate(args)
1751
+ except Exception as err:
1752
+ raise errors.InvalidParametersError(err, url, args) from err
1753
+
1754
+ # 发送请求
1755
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
1756
+ return schema.AfterSalesOrders.model_validate(data)
1757
+
1758
+ async def McfOrders(
1759
+ self,
1760
+ *,
1761
+ sids: int | list[int] | None = None,
1762
+ start_data: str | datetime.date | datetime.datetime | None = None,
1763
+ end_data: str | datetime.date | datetime.datetime | None = None,
1764
+ date_type: int | None = None,
1765
+ offset: int = 0,
1766
+ length: int = 10,
1767
+ ) -> schema.McfOrders:
1768
+ """查询亚马逊多渠道订单
1769
+
1770
+ ## Docs:
1771
+ - 销售 - 平台订单: [查询亚马逊多渠道订单列表-v2](https://apidoc.lingxing.com/#/docs/Sale/OrderMCFOrders)
1772
+
1773
+ :param sids `<'int/list[int]'>`: 领星店铺ID或ID列表,
1774
+ 默认 `None` (查询所有店铺), 参数来源: `Order.sid`
1775
+ :param start_data `<'str/date/datetime'>`: 查询开始日期, 左闭右开,
1776
+ 默认 `None` (查询最近6个月)
1777
+ :param end_data `<'str/date/datetime'>`: 查询结束日期, 左闭右开,
1778
+ 默认 `None` (查询最近6个月)
1779
+ :param date_type `<'int'>`: 查询日期类型, 默认 `None` (使用: 1)
1780
+
1781
+ - `1`: 订购时间 (McfOrder.purchase_time_loc)
1782
+ - `2`: 订单修改时间 (McfOrder.update_time_utc)
1783
+
1784
+ :param offset `<'int'>`: 分页偏移量, 默认 `0`
1785
+ :param length `<'int'>`: 分页长度, 最大值 1000, 默认 `10`
1786
+ :returns `<'McfOrders'>`: 返回查询到的多渠道订单信息列表
1787
+ ```python
1788
+ {
1789
+ # 状态码
1790
+ "code": 0,
1791
+ # 提示信息
1792
+ "message": "success",
1793
+ # 错误信息
1794
+ "errors": [],
1795
+ # 请求ID
1796
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
1797
+ # 响应时间
1798
+ "response_time": "2025-08-13 19:23:04",
1799
+ # 响应数据量
1800
+ "response_count": 2,
1801
+ # 总数据量
1802
+ "total_count": 2,
1803
+ # 响应数据
1804
+ "data": [
1805
+ {
1806
+ # 领星店铺ID (Seller.sid)
1807
+ "sid": 1,
1808
+ # 领星店铺名称 (Seller.name) [原字段 'store_name']
1809
+ "seller_name": "Seller****",
1810
+ # 订单国家 (中文)
1811
+ "country": "德国",
1812
+ # 多渠道亚马逊订单ID
1813
+ "amazon_order_id": "S02-*******-*******",
1814
+ # 多渠道订单配送ID [原字段 'seller_fulfillment_order_id']
1815
+ "fulfillment_order_id": "RE028-*******-*******",
1816
+ # 订单状态
1817
+ "order_status": "Complete",
1818
+ # 订单备注 [原字段 'remark']
1819
+ "order_note": "",
1820
+ # 买家名称
1821
+ "buyer_name": "Al****",
1822
+ # 购买时间 (站点时间) [原字段 'purchase_date_local']
1823
+ "purchase_time_loc": "2025-06-24 06:04:33",
1824
+ # 发货时间 (UTC时间) [原字段 'ship_date_utc']
1825
+ "shipment_time_utc": "2025-06-25T06:43:04Z",
1826
+ # 发货时间 (站点时间) [原字段 'ship_date']
1827
+ "shipment_time_loc": "2025-06-25 08:43:04",
1828
+ # 订单更新时间 (UTC时间) [原字段 'last_update_time']
1829
+ "update_time_utc": "2025-06-25 15:22:32",
1830
+ # 商品列表 [原字段 'listing_info']
1831
+ "items": [
1832
+ {
1833
+ # 商品ASIN (Listing.asin)
1834
+ "asin": "B0********",
1835
+ # 亚马逊卖家SKU (Listing.msku)
1836
+ "msku": "SKU********",
1837
+ # 领星本地SKU (Listing.lsku) [原字段 'local_sku']
1838
+ "lsku": "LOCAL********",
1839
+ # 亚马逊FBA自生成的商品编号 (Listing.fnsku)
1840
+ "fnsku": "X00*******",
1841
+ # 领星本地商品名称 (Listing.product_name) [原字段 'local_name']
1842
+ "product_name": "Pr*******",
1843
+ # 商品标题 [原字段 'item_name']
1844
+ "title": "Product Title",
1845
+ # 商品略缩图链接 [原字段 'small_image_url']
1846
+ "thunbnail_url": "https://image.distributetop.com/****.jpg",
1847
+ # 订单商品总数量 [原字段 'quantity']
1848
+ "order_qty": 1,
1849
+ },
1850
+ ...
1851
+ ],
1852
+ },
1853
+ ...
1854
+ ]
1855
+ }
1856
+ ```
1857
+ """
1858
+ url = route.MCF_ORDERS
1859
+ # 解析并验证参数
1860
+ args = {
1861
+ "sids": sids,
1862
+ "start_data": start_data,
1863
+ "end_data": end_data,
1864
+ "date_type": date_type,
1865
+ "offset": offset,
1866
+ "length": length,
1867
+ }
1868
+ try:
1869
+ p = param.McfOrders.model_validate(args)
1870
+ except Exception as err:
1871
+ raise errors.InvalidParametersError(err, url, args) from err
1872
+
1873
+ # 发送请求
1874
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
1875
+ # return data
1876
+ return schema.McfOrders.model_validate(data)
1877
+
1878
+ async def McfOrderDetails(
1879
+ self,
1880
+ *fulfillment_order_id: dict,
1881
+ ) -> schema.McfOrderDetails:
1882
+ """查询亚马逊多渠道订单的商品信息详情
1883
+
1884
+ ## Docs:
1885
+ - 销售 - 平台订单: [查询亚马逊多渠道订单详情-商品信息](https://apidoc.lingxing.com/#/docs/Sale/ProductInformation)
1886
+
1887
+ :param *fulfillment_order_id `<'dict'>`: 支持最多查询200个订单详情
1888
+
1889
+ - 每个字典必须包含 `sid` 和 `fulfillment_order_id` 字段, 如:
1890
+ `{"sid": 1, "fulfillment_order_id": "RE028-*******-*******"}`
1891
+ - 必填字段 `sid` 领星店铺ID, 必须是 int 类型, 参数来源: `McfOrder.sid`
1892
+ - 必填字段 `fulfillment_order_id` 多渠道订单配送ID, 必须是 str 类型,
1893
+ 参数来源: `McfOrder.fulfillment_order_id`
1894
+
1895
+ :returns `<'McfOrderDetails'>`: 返回查询到的多渠道订单详情信息列表
1896
+ ```python
1897
+ {
1898
+ # 状态码
1899
+ "code": 0,
1900
+ # 提示信息
1901
+ "message": "success",
1902
+ # 错误信息
1903
+ "errors": [],
1904
+ # 请求ID
1905
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
1906
+ # 响应时间
1907
+ "response_time": "2025-08-13 19:23:04",
1908
+ # 响应数据量
1909
+ "response_count": 2,
1910
+ # 总数据量
1911
+ "total_count": 2,
1912
+ # 响应数据
1913
+ "data": [
1914
+ {
1915
+ # 领星店铺ID (Seller.sid)
1916
+ "sid": 1,
1917
+ # 领星店铺名称 (Seller.name) [原字段 'store_name']
1918
+ "seller_name": "Seller****",
1919
+ # 多渠道亚马逊订单ID
1920
+ "amazon_order_id": "S01-*******-*******",
1921
+ # 多渠道订单配送ID [原字段 'seller_fulfillment_order_id']
1922
+ "fulfillment_order_id": "RE-701-*******-*******",
1923
+ # 销售渠道
1924
+ "sales_channel": "",
1925
+ # 订单配送服务级别 [原字段 'speed_category']
1926
+ "shipment_service": "标准配送",
1927
+ # 订单状态
1928
+ "order_status": "Complete",
1929
+ # 订单备注 [原字段 'remark']
1930
+ "order_note": "",
1931
+ # 订单装箱备注 [原字段 'displayable_order_comment']
1932
+ "order_comment": "Thank you for your order",
1933
+ # 买家名称
1934
+ "buyer_name": "De****",
1935
+ # 买家电子邮箱
1936
+ "buyer_email": "",
1937
+ # 买家电话号码 [原字段 'phone']
1938
+ "buyer_phone": "暂停显示",
1939
+ # 卖家地址 [原字段 'address_line1']
1940
+ "buyer_address": "125*******",
1941
+ # 买家邮政编码 [原字段 'postal_code']
1942
+ "buyer_postcode": "T9A 3R9",
1943
+ # 购买时间 (站点时间) [原字段 'purchase_date_local']
1944
+ "purchase_time_loc": "2025-07-17 22:45:30",
1945
+ # 发货时间 (UTC时间) [原字段 'ship_date_utc']
1946
+ "shipment_time_utc": "2025-07-19T22:28:26Z",
1947
+ # 发货时间 (北京时间) [原字段 'ship_date']
1948
+ "shipment_time_cnt": "2025-07-20 06:28:26",
1949
+ # 订单详情列表
1950
+ "items": [
1951
+ {
1952
+ # 商品ASIN (Listing.asin)
1953
+ "asin": "B0********",
1954
+ # 亚马逊卖家SKU (Listing.msku)
1955
+ "msku": "SKU********",
1956
+ # 领星本地SKU (Listing.lsku) [原字段 'local_sku']
1957
+ "lsku": "LOCAL********",
1958
+ # 亚马逊FBA自生成的商品编号 (Listing.fnsku)
1959
+ "fnsku": "X00*******",
1960
+ # 领星本地商品名称 (Listing.product_name) [原字段 'local_name']
1961
+ "product_name": "Pr*******",
1962
+ # 商品标题 [原字段 'item_name']
1963
+ "title": "Product Title",
1964
+ # 商品略缩图链接 [原字段 'small_image_url']
1965
+ "thunbnail_url": "https://image.distributetop.com/****.jpg",
1966
+ # 订单商品总数量 [原字段 'quantity']
1967
+ "order_qty": 1,
1968
+ # 订单商品已发货数量 [原字段 'shipped_quantity']
1969
+ "shipped_qty": 1,
1970
+ # 订单商品已取消数量 [原字段 'cancelled_quantity']
1971
+ "cancelled_qty": 0,
1972
+ # 订单商品不可售数量 [原字段 'unfulfillable_quantity']
1973
+ "unfulfillable_qty": 0,
1974
+ },
1975
+ ...
1976
+ ],
1977
+ },
1978
+ ...
1979
+ ],
1980
+ }
1981
+ ```
1982
+ """
1983
+ url = route.MCF_ORDER_DETAILS
1984
+ # 解析并验证参数
1985
+ args = {"fulfillment_order_ids": fulfillment_order_id}
1986
+ try:
1987
+ p = param.McfFulfillmentOrderIds.model_validate(args)
1988
+ except Exception as err:
1989
+ raise errors.InvalidParametersError(err, url, args) from err
1990
+
1991
+ # 发送请求
1992
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
1993
+ return schema.McfOrderDetails.model_validate(data)
1994
+
1995
+ async def McfAfterSalesOrders(
1996
+ self,
1997
+ *fulfillment_order_id: dict,
1998
+ ) -> schema.McfAfterSalesOrders:
1999
+ """查询亚马逊多渠道订单的退货换货信息详情
2000
+
2001
+ ## Docs:
2002
+ - 销售 - 平台订单: [查询亚马逊多渠道订单详情-退货换货信息](https://apidoc.lingxing.com/#/docs/Sale/ReturnInfomation)
2003
+
2004
+ :param *fulfillment_order_id `<'dict'>`: 支持最多查询200个订单详情
2005
+
2006
+ - 每个字典必须包含 `sid` 和 `fulfillment_order_id` 字段, 如:
2007
+ `{"sid": 1, "fulfillment_order_id": "RE028-*******-*******"}`
2008
+ - 必填字段 `sid` 领星店铺ID, 必须是 int 类型, 参数来源: `McfOrder.sid`
2009
+ - 必填字段 `fulfillment_order_id` 多渠道订单配送ID, 必须是 str 类型,
2010
+ 参数来源: `McfOrder.fulfillment_order_id`
2011
+
2012
+ :returns `<'McfAfterSalesOrders'>`: 返回查询到的多渠道订单售后信息详情列表
2013
+ ```python
2014
+ {
2015
+ # 状态码
2016
+ "code": 0,
2017
+ # 提示信息
2018
+ "message": "success",
2019
+ # 错误信息
2020
+ "errors": [],
2021
+ # 请求ID
2022
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
2023
+ # 响应时间
2024
+ "response_time": "2025-08-13 19:23:04",
2025
+ # 响应数据量
2026
+ "response_count": 2,
2027
+ # 总数据量
2028
+ "total_count": 2,
2029
+ # 响应数据
2030
+ "data": [
2031
+ {
2032
+ # 领星店铺ID (Seller.sid)
2033
+ "sid": 1,
2034
+ # 领星店铺名称 (Seller.name) [原字段 'store_name']
2035
+ "seller_name": "Seller****",
2036
+ # 多渠道亚马逊订单ID
2037
+ "amazon_order_id": "S01-*******-*******",
2038
+ # 多渠道订单配送ID [原字段 'seller_fulfillment_order_id']
2039
+ "fulfillment_order_id": "RE402-*******-*******",
2040
+ # 销售渠道
2041
+ "sales_channel": "",
2042
+ # 订单配送服务级别 [原字段 'speed_category']
2043
+ "shipment_service": "标准配送",
2044
+ # 订单状态
2045
+ "order_status": "CANCELLED",
2046
+ # 订单备注 [原字段 'remark']
2047
+ "order_note": "备注",
2048
+ # 订单装箱备注 [原字段 'displayable_order_comment']
2049
+ "order_comment": "Thank you for your order",
2050
+ # 买家名称
2051
+ "buyer_name": "B*****",
2052
+ # 买家电子邮箱
2053
+ "buyer_email": "",
2054
+ # 买家电话号码 [原字段 'phone']
2055
+ "buyer_phone": "暂停显示",
2056
+ # 卖家地址 [原字段 'address_line1']
2057
+ "buyer_address": "",
2058
+ # 买家邮政编码 [原字段 'postal_code']
2059
+ "buyer_postcode": "100000",
2060
+ # 购买时间 (站点时间) [原字段 'purchase_date_local']
2061
+ "purchase_time_loc": "2025-06-23 11:16:19",
2062
+ # 发货时间 (UTC时间) [原字段 'ship_date_utc']
2063
+ "shipment_time_utc": "2025-06-23T18:00:17Z",
2064
+ # 发货时间 (北京时间) [原字段 'ship_date']
2065
+ "shipment_time_cnt": "2025-06-24 02:00:17",
2066
+ # 售后服务详情 [原字段 'order_return_replace_tab']
2067
+ "after_sales_service": {
2068
+ "return_items": [
2069
+ {
2070
+ # 领星店铺ID (Seller.sid)
2071
+ "sid": 1,
2072
+ # 商品ASIN (Listing.asin)
2073
+ "asin": "B0*******",
2074
+ # 亚马逊卖家SKU (Listing.msku)
2075
+ "msku": "SKU********",
2076
+ # 领星本地SKU (Listing.lsku) [原字段 'local_sku']
2077
+ "lsku": "LOCAL********",
2078
+ # 领星本地商品名称 (Listing.product_name) [原字段 'name']
2079
+ "product_name": "Pr*******",
2080
+ # 多渠道订单配送ID [原字段 'order_id']
2081
+ "fulfillment_order_id": "RE402-*******-*******",
2082
+ # 退货数量 [原字段 'return_quantity']
2083
+ "return_qty": 1,
2084
+ # 退货状态
2085
+ "return_status": "Unit returned to inventory",
2086
+ # 退货原因
2087
+ "return_reason": "NOT_AS_DESCRIBED",
2088
+ # 退货日期
2089
+ "return_date": "2023-03-01",
2090
+ # LNP编码号 [原字段 'lpn']
2091
+ "lpn_number": "LPN***********",
2092
+ # 买家备注 [原字段 'customer_comments']
2093
+ "buyer_note": "thank you",
2094
+ },
2095
+ ...
2096
+ ],
2097
+ "replacement_items": [
2098
+ {
2099
+ # 亚马逊卖家SKU (Listing.msku)
2100
+ "msku": "SKU********",
2101
+ # 领星本地商品名称 (Listing.product_name) [原字段 'name']
2102
+ "product_name": "Pr*******",
2103
+ # 商品ASIN链接
2104
+ "asin_url": "https://www.amazon.com/dp/B0********",
2105
+ # 换货原因
2106
+ "replacement_reason": "Policy exception/customer error",
2107
+ # 换货时间
2108
+ "replacement_date": "2022-02-10",
2109
+ },
2110
+ ...
2111
+ ],
2112
+ },
2113
+ },
2114
+ ...
2115
+ ],
2116
+ }
2117
+ ```
2118
+ """
2119
+ url = route.MCF_AFTER_SALES_ORDERS
2120
+ # 解析并验证参数
2121
+ args = {"fulfillment_order_ids": fulfillment_order_id}
2122
+ try:
2123
+ p = param.McfFulfillmentOrderIds.model_validate(args)
2124
+ except Exception as err:
2125
+ raise errors.InvalidParametersError(err, url, args) from err
2126
+
2127
+ # 发送请求
2128
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
2129
+ return schema.McfAfterSalesOrders.model_validate(data)
2130
+
2131
+ async def McfOrderLogistics(
2132
+ self,
2133
+ *fulfillment_order_id: dict,
2134
+ ) -> schema.McfOrderLogisticsData:
2135
+ """查询亚马逊多渠道订单的物流信息详情
2136
+
2137
+ ## Docs:
2138
+ - 销售 - 平台订单: [查询亚马逊多渠道订单详情-物流信息](https://apidoc.lingxing.com/#/docs/Sale/LogisticsInformation)
2139
+
2140
+ :param *fulfillment_order_id `<'dict'>`: 支持最多查询200个订单详情
2141
+
2142
+ - 每个字典必须包含 `sid` 和 `fulfillment_order_id` 字段, 如:
2143
+ `{"sid": 1, "fulfillment_order_id": "RE028-*******-*******"}`
2144
+ - 必填字段 `sid` 领星店铺ID, 必须是 int 类型, 参数来源: `McfOrder.sid`
2145
+ - 必填字段 `fulfillment_order_id` 多渠道订单配送ID, 必须是 str 类型,
2146
+ 参数来源: `McfOrder.fulfillment_order_id`
2147
+
2148
+ :returns `<'McfOrderLogisticsData'>`: 返回查询到的多渠道订单物流信息详情列表
2149
+ ```python
2150
+ {
2151
+ # 状态码
2152
+ "code": 0,
2153
+ # 提示信息
2154
+ "message": "success",
2155
+ # 错误信息
2156
+ "errors": [],
2157
+ # 请求ID
2158
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
2159
+ # 响应时间
2160
+ "response_time": "2025-08-13 19:23:04",
2161
+ # 响应数据量
2162
+ "response_count": 2,
2163
+ # 总数据量
2164
+ "total_count": 2,
2165
+ # 响应数据
2166
+ "data": [
2167
+ {
2168
+ # 领星店铺ID (Seller.sid)
2169
+ "sid": 1,
2170
+ # 领星店铺名称 (Seller.name) [原字段 'store_name']
2171
+ "seller_name": "Store*****",
2172
+ # 多渠道亚马逊订单ID
2173
+ "amazon_order_id": "S02-*******-*******",
2174
+ # 多渠道订单配送ID [原字段 'seller_fulfillment_order_id']
2175
+ "fulfillment_order_id": "RE402-*******-*******",
2176
+ # 销售渠道
2177
+ "sales_channel": "",
2178
+ # 订单配送服务级别 [原字段 'speed_category']
2179
+ "shipment_service": "标准配送",
2180
+ # 订单状态
2181
+ "order_status": "Complete",
2182
+ # 订单备注 [原字段 'remark']
2183
+ "order_note": "",
2184
+ # 订单装箱备注 [原字段 'displayable_order_comment']
2185
+ "order_comment": "Thank you for your order.",
2186
+ # 买家名称
2187
+ "buyer_name": "B*****",
2188
+ # 买家电子邮箱
2189
+ "buyer_email": "",
2190
+ # 买家电话号码 [原字段 'phone']
2191
+ "buyer_phone": "暂停显示",
2192
+ # 卖家地址 [原字段 'address_line1']
2193
+ "buyer_address": "P*****",
2194
+ # 买家邮政编码 [原字段 'postal_code']
2195
+ "buyer_postcode": "00177",
2196
+ # 购买时间 (站点时间) [原字段 'purchase_date_local']
2197
+ "purchase_time_loc": "2025-06-23 11:16:19",
2198
+ # 发货时间 (UTC时间) [原字段 'ship_date_utc']
2199
+ "shipment_time_utc": "2025-06-23T18:00:17Z",
2200
+ # 发货时间 (北京时间) [原字段 'ship_date']
2201
+ "shipment_time_cnt": "2025-06-24 02:00:17",
2202
+ # 物流列表 [原字段 'shipment_info']
2203
+ "shipments": [
2204
+ {
2205
+ # 亚马逊货件编号
2206
+ "amazon_shipment_id": "U********",
2207
+ # 货件状态 [原字段: 'fulfillment_shipment_status']
2208
+ "shipment_status": "SHIPPED",
2209
+ # 预计到货时间 (站点时间) [原字段 'estimated_arrival_datetime']
2210
+ "estimated_arrival_time": "2025-06-24 23:59:59",
2211
+ # 包裹详情信息
2212
+ "packages": [
2213
+ {
2214
+ # 承运人代码
2215
+ "carrier_code": "Amazon",
2216
+ # 包裹追踪码
2217
+ "tracking_number": "IT**********",
2218
+ # 包裹编号
2219
+ "package_number": "288884492",
2220
+ # 包裹运输状态 [原字段 'current_status']
2221
+ "package_status": "",
2222
+ # 包裹发货时间 (UTC时间) [原字段 'ship_date']
2223
+ "shipment_date_utc": "2025-06-23T18:00:17Z",
2224
+ # 包裹预计到货时间 (站点时间) [原字段 'estimated_arrival_datetime']
2225
+ "estimated_arrival_time": "2025-06-24 20:00:00",
2226
+ # 包裹追踪事件列表
2227
+ "tracking_events": [
2228
+ {
2229
+ # 追踪事件
2230
+ "event": "配送成功。",
2231
+ # 追踪事件编码 [原字段 'eventCode']
2232
+ "event_code": "EVENT_301",
2233
+ # 追踪事件描述 [原字段 'eventDescription']
2234
+ "event_description": "Package delivered. ",
2235
+ # 追踪事件时间 (站点时间) [原字段 'eventDate']
2236
+ "event_time_loc": "2025-06-24 13:35:46",
2237
+ # 追踪事件地址 [原字段 'eventAddress']
2238
+ "event_address": {
2239
+ # 追踪事件地址国家
2240
+ "country": "IT",
2241
+ # 追踪事件地址省/州
2242
+ "state": "",
2243
+ # 追踪事件地址城市
2244
+ "city": "Roma",
2245
+ },
2246
+ },
2247
+ ...
2248
+ ],
2249
+ # 包裹内的商品列表 [原字段 'shipItems']
2250
+ "package_items": [
2251
+ {
2252
+ # 领星店铺ID (Seller.sid)
2253
+ "sid": 1,
2254
+ # 亚马逊SKU (Listing.msku)
2255
+ "msku": "SKU********",
2256
+ # 商品标题
2257
+ "title": "Product Title",
2258
+ # 商品数量 [原字段 'quantity']
2259
+ "item_qty": 1,
2260
+ # 包裹编码
2261
+ "package_number": "2********",
2262
+ },
2263
+ ...
2264
+ ],
2265
+ },
2266
+ ...
2267
+ ],
2268
+ },
2269
+ ...
2270
+ ],
2271
+ },
2272
+ ...
2273
+ ],
2274
+ }
2275
+ ```
2276
+ """
2277
+ url = route.MCF_ORDER_LOGISTICS
2278
+ # 解析并验证参数
2279
+ args = {"fulfillment_order_ids": fulfillment_order_id}
2280
+ try:
2281
+ p = param.McfFulfillmentOrderIds.model_validate(args)
2282
+ except Exception as err:
2283
+ raise errors.InvalidParametersError(err, url, args) from err
2284
+
2285
+ # 发送请求
2286
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
2287
+ return schema.McfOrderLogisticsData.model_validate(data)
2288
+
2289
+ async def McfOrderTransaction(
2290
+ self,
2291
+ sid: int,
2292
+ amazon_order_id: str,
2293
+ ) -> schema.McfOrderTransactionData:
2294
+ """查询多渠道订单的交易明细
2295
+
2296
+ ## Docs:
2297
+ - 销售 - 平台订单: [多渠道订单-交易明细](https://apidoc.lingxing.com/#/docs/Sale/MutilChannelTransactionDetail)
2298
+
2299
+ :param sid `<'int'>`: 领星店铺ID, 必须是 int 类型, 参数来源: `McfOrder.sid`
2300
+ :param amazon_order_id `<'str'>`: 多渠道亚马逊订单ID,
2301
+ 必须是 str 类型, 参数来源: `McfOrder.amazon_order_id`
2302
+ :returns `<'McfOrderTransactionData'>`: 返回查询到的多渠道订单交易明细信息
2303
+ ```python
2304
+ {
2305
+ # 状态码
2306
+ "code": 0,
2307
+ # 提示信息
2308
+ "message": "success",
2309
+ # 错误信息
2310
+ "errors": [],
2311
+ # 请求ID
2312
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
2313
+ # 响应时间
2314
+ "response_time": "2025-08-13 19:23:04",
2315
+ # 响应数据量
2316
+ "response_count": 2,
2317
+ # 总数据量
2318
+ "total_count": 2,
2319
+ # 响应数据
2320
+ "data": {
2321
+ # 多渠道订单总交易金额 (包含货币符号) [原字段 'totalCurrencyAmounts']
2322
+ "transaction_amt": "-CA$8.97",
2323
+ # 多渠道订单交易事件列表 [原字段 'list']
2324
+ "transaction_events": [
2325
+ {
2326
+ # 领星店铺ID (Seller.sid)
2327
+ "sid": 9846,
2328
+ # 亚马逊卖家SKU (Listing.msku) [原字段 'sellerSku']
2329
+ "msku": "SKU*********",
2330
+ # 领星本地SKU (Listing.lsku) [原字段 'sku']
2331
+ "lsku": "LOCAL*********",
2332
+ # 领星本地商品名称 (Listing.product_name) [原字段 'productName']
2333
+ "product_name": "P********",
2334
+ # 结算编号 [原字段 'fid']
2335
+ "transaction_id": "LWC*********
2336
+ # 交易事件类型 [原字段 'eventType']
2337
+ "event_type": "Shipment",
2338
+ # 交易事件商品数量 [原字段 'quantity']
2339
+ "event_qty": 0,
2340
+ # 交易事件货币代码 [原字段 'currencyCode']
2341
+ "event_currency_code": "CAD",
2342
+ # 交易事件货币金额 (含货币符号) [原字段 'totalCurrencyAmount']
2343
+ "event_amt": "CA$-3.64",
2344
+ # 交易事件详情 [原字段 'costDetails']
2345
+ "event_details": [
2346
+ {
2347
+ # 事件类型
2348
+ "type": "FBAPerUnitFulfillmentFee",
2349
+ # 事件金额 (含货币符号) [原字段 'currencyAmount']
2350
+ "amt": "-CA$3.64"
2351
+ },
2352
+ ...
2353
+ ],
2354
+ # 交易付款确认时间 (时区时间) [原字段 'postedDateLocale']
2355
+ "posted_time": "2025-07-17T23:03:11-07:00",
2356
+ # 交易转账时间 (时区时间) [原字段 'fundTransferDateLocale']
2357
+ "fund_transfer_time": "2025-07-18T10:44:28-07:00",
2358
+ },
2359
+ ...
2360
+ ],
2361
+ },
2362
+ }
2363
+ ```
2364
+ """
2365
+ url = route.MCF_ORDER_TRANSACTION
2366
+ # 解析并验证参数
2367
+ args = {"sid": sid, "amazon_order_id": amazon_order_id}
2368
+ try:
2369
+ p = param.McfOrderTransaction.model_validate(args)
2370
+ except Exception as err:
2371
+ raise errors.InvalidParametersError(err, url, args) from err
2372
+
2373
+ # 发送请求
2374
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
2375
+ return schema.McfOrderTransactionData.model_validate(data)
2376
+
2377
+ # 自发货管理 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2378
+ async def FbmOrders(
2379
+ self,
2380
+ sids: int | list[int],
2381
+ *,
2382
+ purchase_start_time: str | datetime.date | datetime.datetime | None = None,
2383
+ purchase_end_time: str | datetime.date | datetime.datetime | None = None,
2384
+ order_status: int | list[int] | None = None,
2385
+ page: int | None = None,
2386
+ length: int | None = None,
2387
+ ) -> schema.FbmOrders:
2388
+ """查询亚马逊自发货订单
2389
+
2390
+ ## Docs:
2391
+ - 销售 - 自发货管理: [查询亚马逊自发货订单列表](https://apidoc.lingxing.com/#/docs/Sale/FBMOrderList)
2392
+
2393
+ :param sids `<'int/list[int]'>`: 领星店铺ID或ID列表, 参数来源: `Order.sid`
2394
+ :param purchase_start_time `<'str/date/datetime'>`: 订购开始时间, 默认 `None`,
2395
+ 参数来源: `FbmOrder.purchase_time`
2396
+ :param purchase_end_time `<'str/date/datetime'>`: 订购结束时间, 默认 `None`,
2397
+ 参数来源: `FbmOrder.purchase_time`
2398
+ :param order_status `<'int/list[int]'>`: 订单状态或状态列表, 默认 `None` (查询所有状态),
2399
+
2400
+ - `1`: 同步中
2401
+ - `2`: 已发货
2402
+ - `3`: 未付款
2403
+ - `4`: 待审核
2404
+ - `5`: 待发货
2405
+ - `6`: 不发货
2406
+
2407
+ :param page `<'int'>`: 分页页码, 默认 `None` (使用: 1)
2408
+ :param length `<'int'>`: 分页长度, 默认 `None` (使用: 100)
2409
+ :returns `<'FbmOrders'>`: 返回查询到的自发货订单信息列表
2410
+ ```python
2411
+ {
2412
+ # 状态码
2413
+ "code": 0,
2414
+ # 提示信息
2415
+ "message": "success",
2416
+ # 错误信息
2417
+ "errors": [],
2418
+ # 请求ID
2419
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
2420
+ # 响应时间
2421
+ "response_time": "2025-08-13 19:23:04",
2422
+ # 响应数据量
2423
+ "response_count": 2,
2424
+ # 总数据量
2425
+ "total_count": 2,
2426
+ # 响应数据
2427
+ "data": [
2428
+ {
2429
+ # 自发货订单号
2430
+ "order_number": "10****************",
2431
+ # 订单状态 [原字段 'status']
2432
+ # (1: 同步中, 2: 已发货, 3: 未付款, 4: 待审核, 5: 待发货, 6: 不发货)
2433
+ "order_status": "待审核",
2434
+ # 订单类型 [原字段 'order_from']
2435
+ "order_type": "线上订单",
2436
+ # 平台订单ID列表
2437
+ "platform_order_ids": ["028-*******-*******"],
2438
+ # 订单目的地国家代码
2439
+ "country_code": "DE",
2440
+ # 物流类型ID
2441
+ "logistics_type_id": "1",
2442
+ # 物流类型名称 [原字段 'logistics_type_name']
2443
+ "logistics_type": "1",
2444
+ # 物流商ID
2445
+ "logistics_provider_id": "1",
2446
+ # 物流商名称 [原字段 'logistics_provider_name']
2447
+ "logistics_provider": "4PX",
2448
+ # 发货仓库ID [原字段 'wid']
2449
+ "warehouse_id": 1,
2450
+ # 发货仓库名称 [原字段 'warehouse_name']
2451
+ "warehouse": "OW-测试仓库",
2452
+ # 买家备注 [原字段 'customer_comment']
2453
+ "buyer_note": "thank you",
2454
+ # 订购时间
2455
+ "purchase_time": "2024-12-29 18:20:36",
2456
+ },
2457
+ ...
2458
+ ],
2459
+ }
2460
+ ```
2461
+ """
2462
+ url = route.FBM_ORDERS
2463
+ # 解析并验证参数
2464
+ args = {
2465
+ "sids": sids,
2466
+ "purchase_start_time": purchase_start_time,
2467
+ "purchase_end_time": purchase_end_time,
2468
+ "order_status": order_status,
2469
+ "page": page,
2470
+ "length": length,
2471
+ }
2472
+ try:
2473
+ p = param.FbmOrders.model_validate(args)
2474
+ except Exception as err:
2475
+ raise errors.InvalidParametersError(err, url, args) from err
2476
+
2477
+ # 发送请求
2478
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
2479
+ return schema.FbmOrders.model_validate(data)
2480
+
2481
+ async def FbmOrderDetail(self, order_number: int) -> schema.FbmOrderDetailData:
2482
+ """查询亚马逊自发货订单详情
2483
+
2484
+ ## Docs:
2485
+ - 销售 - 自发货管理: [查询亚马逊自发货订单详情](https://apidoc.lingxing.com/#/docs/Sale/FBMOrderDetail)
2486
+
2487
+ :param order_number `<'int'>`: 自发货订单号, 必须是 int 类型, 参数来源: `FbmOrder.order_number`
2488
+ :returns `<'FbmOrderDetailData'>`: 返回查询到的自发货订单
2489
+ ```python
2490
+ {
2491
+ # 状态码
2492
+ "code": 0,
2493
+ # 提示信息
2494
+ "message": "success",
2495
+ # 错误信息
2496
+ "errors": [],
2497
+ # 请求ID
2498
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
2499
+ # 响应时间
2500
+ "response_time": "2025-08-13 19:23:04",
2501
+ # 响应数据量
2502
+ "response_count": 2,
2503
+ # 总数据量
2504
+ "total_count": 2,
2505
+ # 响应数据
2506
+ "data": {
2507
+ # 领星店铺名称 (Seller.name) [原字段: 'shop_name']
2508
+ "seller_name": "Seller****",
2509
+ # 自发货订单号
2510
+ "order_number": "103***************",
2511
+ # 订单状态
2512
+ "order_status": "不发货",
2513
+ # 订单类型 [原字段 'order_from_name']
2514
+ "order_type": "线上订单",
2515
+ # 订单平台 [原字段 'platform']
2516
+ "order_platform": "AMAZON",
2517
+ # 物流类型ID
2518
+ "logistics_type_id": "1",
2519
+ # 物流类型名称 [原字段 'logistics_type_name']
2520
+ "logistics_type": "HH",
2521
+ # 物流商ID
2522
+ "logistics_provider_id": "1",
2523
+ # 物流商名称 [原字段 'logistics_provider_name']
2524
+ "logistics_provider": "4PX",
2525
+ # 发货仓库ID [原字段 'wid']
2526
+ "warehouse_id": 1,
2527
+ # 发货仓库名称 [原字段 'warehouse_name']
2528
+ "warehouse": "OW-测试仓库",
2529
+ # 订单配送服务级别 [原字段 'buyer_choose_express']
2530
+ "shipment_service": "Standard",
2531
+ # 买家留言
2532
+ "buyer_message": "",
2533
+ # 买家备注 [原字段 'customer_comment']
2534
+ "buyer_note": "",
2535
+ # 订购时间
2536
+ "purchase_time": "2024-07-07 05:14:22",
2537
+ # 物流跟踪码
2538
+ "tracking_number": "42**********",
2539
+ # 包裹预估重量 [原字段 'logistics_pre_weight']
2540
+ "package_est_weight": 100.0,
2541
+ # 包裹预估重量单位 [原字段 'logistics_pre_weight_unit']
2542
+ "package_est_weight_unit": "g",
2543
+ # 包裹预估长度 [原字段 'package_length']
2544
+ "package_est_length": 10.0,
2545
+ # 包裹预估宽度 [原字段 'package_width']
2546
+ "package_est_width": 10.0,
2547
+ # 包裹预估高度 [原字段 'package_height']
2548
+ "package_est_height": 10.0,
2549
+ # 包裹预估尺寸单位 [原字段 'package_unit']
2550
+ "package_est_dimension_unit": "cm",
2551
+ # 预估物流费用 [原字段 'logistics_pre_price']
2552
+ "logistics_est_amt": 1.2,
2553
+ # 包裹实际重量 [原字段: 'pkg_real_weight']
2554
+ "package_weight": 101.0,
2555
+ # 包裹实际重量单位 [原字段: 'pkg_real_weight_unit']
2556
+ "package_weight_unit": "g",
2557
+ # 包裹实际长度 [原字段: 'pkg_length']
2558
+ "package_length": 10.0,
2559
+ # 包裹实际宽度 [原字段: 'pkg_width']
2560
+ "package_width": 10.0,
2561
+ # 包裹实际高度 [原字段: 'pkg_height']
2562
+ "package_height": 10.0,
2563
+ # 包裹实际尺寸单位 [原字段: 'pkg_size_unit']
2564
+ "package_dimension_unit": "cm",
2565
+ # 实际物流费用货币代码 [原字段: 'logistics_freight_currency_code']
2566
+ "logistics_currency_code": "GBP",
2567
+ # 实际物流费用 [原字段: 'logistics_freight']
2568
+ "logistics_amt": 1.4,
2569
+ # 总客付运费 [原字段 'total_shipping_price']
2570
+ "shipping_amt": 1.4,
2571
+ # 订单销售金额 [原字段 'order_price_amount']
2572
+ "sales_amt": 29.99,
2573
+ # 订单毛利润金额 [原字段 'gross_profit_amount']
2574
+ "profit_amt": 24.99,
2575
+ # 订单商品列表 [原字段: 'order_item']
2576
+ "items": [
2577
+ {
2578
+ # 平台订单ID
2579
+ "platform_order_id": "026-*******-*******",
2580
+ # 订单详情的商品单号 [原字段 'order_item_no']
2581
+ "order_item_id": "398***********",
2582
+ # 亚马逊卖家SKU (Listing.msku) [原字段 'MSKU']
2583
+ "msku": "SKU********",
2584
+ # 领星本地SKU (Listing.lsku) [原字段 'sku']
2585
+ "lsku": "LOCAL********",
2586
+ # 领星本地商品名称 (Listing.product_name)
2587
+ "product_name": "P*******",
2588
+ # 商品图片链接 [原字段 'pic_url']
2589
+ "image_url": "https://****.jpg",
2590
+ # 商品单价货币代码
2591
+ "currency_code": "GBP",
2592
+ # 商品单价 [原字段 'item_unit_price']
2593
+ "item_price": 29.99,
2594
+ # 订单商品数量 [原字段 'quality']
2595
+ "order_qty": 1,
2596
+ # 订单备注 [原字段 'customization']
2597
+ "order_note": "",
2598
+ # 附件信息列表 [原字段 'newAttachments']
2599
+ "attachments": [
2600
+ {
2601
+ # 文件ID
2602
+ "file_id": 103***************,
2603
+ # 文件名称
2604
+ "file_name": "lADPBG1Q7eeWX****.jpg",
2605
+ # 文件类型 (0: 未知, 1: 图片, 2: 压缩包)
2606
+ "file_type": 1,
2607
+ # 文件链接
2608
+ "file_url": "",
2609
+ },
2610
+ ...
2611
+ ],
2612
+ },
2613
+ ...
2614
+ ],
2615
+ },
2616
+ }
2617
+ ```
2618
+ """
2619
+ url = route.FBM_ORDER_DETAIL
2620
+ # 解析并验证参数
2621
+ args = {"order_number": order_number}
2622
+ try:
2623
+ p = param.FbmOrderDetail.model_validate(args)
2624
+ except Exception as err:
2625
+ raise errors.InvalidParametersError(err, url, args) from err
2626
+
2627
+ # 发送请求
2628
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
2629
+ return schema.FbmOrderDetailData.model_validate(data)
2630
+
2631
+ # 促销管理 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2632
+ async def PromotionCoupons(
2633
+ self,
2634
+ *,
2635
+ sids: int | list[int] | None = None,
2636
+ start_data: str | datetime.date | datetime.datetime | None = None,
2637
+ end_data: str | datetime.date | datetime.datetime | None = None,
2638
+ offset: int | None = None,
2639
+ length: int | None = None,
2640
+ ) -> schema.PromotionCoupons:
2641
+ """查询促销列表 - 优惠券
2642
+
2643
+ ## Docs:
2644
+ - 销售 - 促销管理: [查询促销活动列表-优惠券](https://apidoc.lingxing.com/#/docs/Sale/promotionalActivitiesCouponList)
2645
+
2646
+ :param sids `<'int/list[int]'>`: 领星店铺ID或ID列表,
2647
+ 默认 `None` (查询所有店铺), 参数来源: `Seller.sid`
2648
+ :param start_data `<'str/date/datetime'>`:促销开始日期, 默认 `None`
2649
+ :param end_data `<'str/date/datetime'>`: 促销结束日期, 默认 `None`
2650
+ :param offset `<'int'>`: 分页偏移量, 默认 `None` (使用: 0)
2651
+ :param length `<'int'>`: 分页长度, 最大值200, 默认 `None` (使用: 20)
2652
+ :returns `<'PromotionCoupons'>`: 返回查询到的促销列表
2653
+ ```python
2654
+ {
2655
+ # 状态码
2656
+ "code": 0,
2657
+ # 提示信息
2658
+ "message": "success",
2659
+ # 错误信息
2660
+ "errors": [],
2661
+ # 请求ID
2662
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
2663
+ # 响应时间
2664
+ "response_time": "2025-08-13 19:23:04",
2665
+ # 响应数据量
2666
+ "response_count": 2,
2667
+ # 总数据量
2668
+ "total_count": 2,
2669
+ # 响应数据
2670
+ "data": [
2671
+ {
2672
+ # 领星店铺ID (Seller.sid)
2673
+ "sid": 1,
2674
+ # 优惠券名称
2675
+ "coupon_name": "5% di sconto su 304 1B",
2676
+ # 优惠券状态 [原字段 'origin_status']
2677
+ "status": "RUNNING",
2678
+ # 优惠券备注 [原字段 'remark']
2679
+ "note": "",
2680
+ # 优惠券折扣百分比 [原字段 'discount']
2681
+ "discount_pct": "5.00%",
2682
+ # 货币符号
2683
+ "currency_icon": "€",
2684
+ # 优惠券预算金额 [原字段 'budget']
2685
+ "budget_amt": "€1000",
2686
+ # 优惠券费用 [原字段 'cost']
2687
+ "coupon_fee": 107.24,
2688
+ # 优惠券领取数量 [原字段 'draw_quantity']
2689
+ "claimed_qty": 177,
2690
+ # 优惠券兑换数量 [原字段 'exchange_quantity']
2691
+ "redeemed_qty": 111,
2692
+ # 优惠券兑换率 [原字段 'exchange_rate']
2693
+ # (redeemed_qty / claimed_qty)
2694
+ "redemption_rate": 62.71,
2695
+ # 优惠券期间的商品销售数量 [原字段 'sales_volume']
2696
+ "sales_qty": 174,
2697
+ # 优惠券期间的商品销售金额 [原字段 'sales_amount']
2698
+ "sales_amt": 3082.17,
2699
+ # 优惠券的开始时间 (站点时间) [原字段 'promotion_start_time']
2700
+ "start_time": "2024-12-09 00:00:00",
2701
+ # 优惠券的结束时间 (站点时间) [原字段 'promotion_end_time']
2702
+ "end_time": "2025-01-08 00:00:00",
2703
+ # 首次同步时间 (站点时间)
2704
+ "first_sync_time": "2025-01-07 01:25:01",
2705
+ # 最后同步时间 (站点时间)
2706
+ "last_sync_time": "2025-01-08 01:22:32",
2707
+ },
2708
+ ...
2709
+ ],
2710
+ }
2711
+ ```
2712
+ """
2713
+ url = route.PROMOTION_COUPONS
2714
+ # 解析并验证参数
2715
+ args = {
2716
+ "sids": sids,
2717
+ "start_data": start_data,
2718
+ "end_data": end_data,
2719
+ "offset": offset,
2720
+ "length": length,
2721
+ }
2722
+ try:
2723
+ p = param.Promotions.model_validate(args)
2724
+ except Exception as err:
2725
+ raise errors.InvalidParametersError(err, url, args) from err
2726
+
2727
+ # 发送请求
2728
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
2729
+ return schema.PromotionCoupons.model_validate(data)
2730
+
2731
+ async def PromotionDeals(
2732
+ self,
2733
+ *,
2734
+ sids: int | list[int] | None = None,
2735
+ start_data: str | datetime.date | datetime.datetime | None = None,
2736
+ end_data: str | datetime.date | datetime.datetime | None = None,
2737
+ offset: int | None = None,
2738
+ length: int | None = None,
2739
+ ) -> schema.PromotionDeals:
2740
+ """查询促销列表 - Deal
2741
+
2742
+ ## Docs:
2743
+ - 销售 - 促销管理: [查询促销活动列表-秒杀](https://apidoc.lingxing.com/#/docs/Sale/promotionalActivitiesSecKillList)
2744
+
2745
+ :param sids `<'int/list[int]'>`: 领星店铺ID或ID列表,
2746
+ 默认 `None` (查询所有店铺), 参数来源: `Seller.sid`
2747
+ :param start_data `<'str/date/datetime'>`: 促销开始日期, 默认 `None`
2748
+ :param end_data `<'str/date/datetime'>`: 促销结束日期, 默认 `None`
2749
+ :param offset `<'int'>`: 分页偏移量, 默认 `None` (使用: 0)
2750
+ :param length `<'int'>`: 分页长度, 最大值200, 默认 `None` (使用: 20)
2751
+ :returns `<'PromotionDeals'>`: 返回查询到的促销列表
2752
+ ```python
2753
+ {
2754
+ # 状态码
2755
+ "code": 0,
2756
+ # 提示信息
2757
+ "message": "success",
2758
+ # 错误信息
2759
+ "errors": [],
2760
+ # 请求ID
2761
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
2762
+ # 响应时间
2763
+ "response_time": "2025-08-13 19:23:04",
2764
+ # 响应数据量
2765
+ "response_count": 2,
2766
+ # 总数据量
2767
+ "total_count": 2,
2768
+ # 响应数据
2769
+ "data": [
2770
+ {
2771
+ # 领星店铺ID (Seller.sid)
2772
+ "sid": 1,
2773
+ # Deal 类型 [原字段 'promotion_type']
2774
+ # (1: Best Deal, 2: Lightning Deal)
2775
+ "deal_type": 2,
2776
+ # Deal 名称 [原字段 'description']
2777
+ "deal_name": "秒杀-2024/11/01 2-34-2-883",
2778
+ # Deal 状态 [原字段 'origin_status']
2779
+ "status": "ENDED",
2780
+ # Deal 备注 [原字段 'remark']
2781
+ "note": "",
2782
+ # Deal 商品标题 [原字段 'name']
2783
+ "product_title": "Product Title",
2784
+ # Deal 商品数量 [原字段 'product_quantity']
2785
+ "product_count": 1,
2786
+ # 货币符号
2787
+ "currency_icon": "$",
2788
+ # Deal 费用 [原字段 'seckill_fee']
2789
+ "deal_fee": 150.0,
2790
+ # 参与 Deal 的商品库存数量 [原字段 'participate_inventory']
2791
+ "deal_qty": 140,
2792
+ # Deal 期间的商品销售数量 [原字段 'sales_volume']
2793
+ "sales_qty": 103,
2794
+ # Deal 期间参促库存的转化率 [原字段 'sold_rate']
2795
+ # (sales_qty / deal_qty * 100)
2796
+ "sales_rate": 73.57,
2797
+ # Deal 期间商品详情页的浏览量 [原字段 'page_view']
2798
+ "page_views": 524,
2799
+ # Deal 期间浏览至购买的转化率 [原字段 'exchange_rate']
2800
+ # (sales_qty / page_views * 100)
2801
+ "conversion_rate": 19.66,
2802
+ # Deal 期间的商品销售金额 [原字段 'sales_amount']
2803
+ "sales_amt": 4529.94,
2804
+ # Deal 开始时间 (站点时间) [原字段 'promotion_start_time']
2805
+ "start_time": "2024-11-14 10:35:00",
2806
+ # Deal 结束时间 (站点时间) [原字段 'promotion_end_time']
2807
+ "end_time": "2024-11-14 22:35:00",
2808
+ # 首次同步时间 (站点时间)
2809
+ "first_sync_time": "2024-11-18 22:04:44",
2810
+ # 最后同步时间 (站点时间)
2811
+ "last_sync_time": "2024-11-18 22:04:44",
2812
+ },
2813
+ ...
2814
+ ],
2815
+ }
2816
+ ```
2817
+ """
2818
+ url = route.PROMOTION_DEALS
2819
+ # 解析并验证参数
2820
+ args = {
2821
+ "sids": sids,
2822
+ "start_data": start_data,
2823
+ "end_data": end_data,
2824
+ "offset": offset,
2825
+ "length": length,
2826
+ }
2827
+ try:
2828
+ p = param.Promotions.model_validate(args)
2829
+ except Exception as err:
2830
+ raise errors.InvalidParametersError(err, url, args) from err
2831
+
2832
+ # 发送请求
2833
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
2834
+ return schema.PromotionDeals.model_validate(data)
2835
+
2836
+ async def PromotionActivities(
2837
+ self,
2838
+ *,
2839
+ sids: int | list[int] | None = None,
2840
+ start_data: str | datetime.date | datetime.datetime | None = None,
2841
+ end_data: str | datetime.date | datetime.datetime | None = None,
2842
+ offset: int | None = None,
2843
+ length: int | None = None,
2844
+ ) -> schema.PromotionActivities:
2845
+ """查询促销列表 - 活动
2846
+
2847
+ ## Docs:
2848
+ - 销售 - 促销管理: [查询促销活动列表-管理促销](https://apidoc.lingxing.com/#/docs/Sale/promotionalActivitiesManageList)
2849
+
2850
+ :param sids `<'int/list[int]'>`: 领星店铺ID或ID列表,
2851
+ 默认 `None` (查询所有店铺), 参数来源: `Seller.sid`
2852
+ :param start_data `<'str/date/datetime'>`: 促销开始日期, 默认 `None`
2853
+ :param end_data `<'str/date/datetime'>`: 促销结束日期, 默认 `None`
2854
+ :param offset `<'int'>`: 分页偏移量, 默认 `None` (使用: 0)
2855
+ :param length `<'int'>`: 分页长度, 最大值200, 默认 `None` (使用: 20)
2856
+ :returns `<'PromotionActivities'>`: 返回查询到的促销列表
2857
+ ```python
2858
+ {
2859
+ # 状态码
2860
+ "code": 0,
2861
+ # 提示信息
2862
+ "message": "success",
2863
+ # 错误信息
2864
+ "errors": [],
2865
+ # 请求ID
2866
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
2867
+ # 响应时间
2868
+ "response_time": "2025-08-13 19:23:04",
2869
+ # 响应数据量
2870
+ "response_count": 2,
2871
+ # 总数据量
2872
+ "total_count": 2,
2873
+ # 响应数据
2874
+ "data": [
2875
+ {
2876
+ # 领星店铺ID (Seller.sid)
2877
+ "sid": 1,
2878
+ # 促销活动类型
2879
+ # (0: 未定义类型, 3: 买一赠一, 4: 购买折扣, 5: 一口价, 8: 社媒促销)
2880
+ "promotion_type": 4,
2881
+ # 促销活动名称 [原字段 'name']
2882
+ "promotion_name": "6%BUY2",
2883
+ # 促销活动状态 [原字段 'origin_status']
2884
+ "status": "ACTIVE",
2885
+ # 促销活动备注 [原字段 'remark']
2886
+ "note": "",
2887
+ # 促销活动优惠码 [原字段 'promotion_code']
2888
+ "code": "不需要",
2889
+ # 促销活动参与条件 [原字段 'participate_condition']
2890
+ "requirement": "At least this quantity of items 2",
2891
+ # 促销活动参与条件数值 [原字段 'participate_condition_num']
2892
+ "requirement_value": 2,
2893
+ # 促销活动优惠内容 [原字段 'buyer_gets']
2894
+ "offer": "Percent off 6",
2895
+ # 促销活动优惠内容数值 [原字段 'buyer_gets_num']
2896
+ "offer_value": 6,
2897
+ # 促销活动需购买商品
2898
+ "purchase_product": "ASIN List",
2899
+ # 促销活动可享受折扣商品
2900
+ "discount_product": "ASIN List",
2901
+ # 促销活动排除商品
2902
+ "exclude_product": "",
2903
+ # 促销活动是否限制兑换量 (0: 否, 1: 是) [原字段 'exchange_limit']
2904
+ "limited": 0,
2905
+ # 货币符号
2906
+ "currency_icon": "€",
2907
+ # 促销活动期间的商品销售数量 [原字段 'sales_volume']
2908
+ "sales_qty": 1278,
2909
+ # 促销活动期间的商品销售金额 [原字段 'sales_amount']
2910
+ "sales_amt": 81222.45,
2911
+ # 促销活动开始时间 (站点时间) [原字段 'promotion_start_time']
2912
+ "start_time": "2025-01-02 13:00:00",
2913
+ # 促销活动结束时间 (站点时间) [原字段 'promotion_end_time']
2914
+ "end_time": "2025-06-30 23:59:00",
2915
+ # 首次同步时间 (站点时间)
2916
+ "first_sync_time": "2025-01-06 23:14:55",
2917
+ # 最后同步时间 (站点时间)
2918
+ "last_sync_time": "2025-01-08 23:54:13",
2919
+ },
2920
+ ...
2921
+ ],
2922
+ }
2923
+ ```
2924
+ """
2925
+ url = route.PROMOTION_ACTIVITIES
2926
+ # 解析并验证参数
2927
+ args = {
2928
+ "sids": sids,
2929
+ "start_data": start_data,
2930
+ "end_data": end_data,
2931
+ "offset": offset,
2932
+ "length": length,
2933
+ }
2934
+ try:
2935
+ p = param.Promotions.model_validate(args)
2936
+ except Exception as err:
2937
+ raise errors.InvalidParametersError(err, url, args) from err
2938
+
2939
+ # 发送请求
2940
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
2941
+ return schema.PromotionActivities.model_validate(data)
2942
+
2943
+ async def PromotionDiscounts(
2944
+ self,
2945
+ *,
2946
+ sids: int | list[int] | None = None,
2947
+ start_data: str | datetime.date | datetime.datetime | None = None,
2948
+ end_data: str | datetime.date | datetime.datetime | None = None,
2949
+ offset: int | None = None,
2950
+ length: int | None = None,
2951
+ ) -> schema.PromotionDiscounts:
2952
+ """查询促销列表 - 价格折扣
2953
+
2954
+ ## Docs:
2955
+ - 销售 - 促销管理: [查询促销活动列表-会员折扣](https://apidoc.lingxing.com/#/docs/Sale/promotionalActivitiesVipDiscountList)
2956
+
2957
+ :param sids `<'int/list[int]'>`: 领星店铺ID或ID列表,
2958
+ 默认 `None` (查询所有店铺), 参数来源: `Seller.sid`
2959
+ :param start_data `<'str/date/datetime'>`: 促销开始日期, 默认 `None`
2960
+ :param end_data `<'str/date/datetime'>`: 促销结束日期, 默认 `None`
2961
+ :param offset `<'int'>`: 分页偏移量, 默认 `None` (使用: 0)
2962
+ :param length `<'int'>`: 分页长度, 最大值200, 默认 `None` (使用: 20)
2963
+ :returns `<'PromotionDiscounts'>`: 返回查询到的促销列表
2964
+ ```python
2965
+ {
2966
+ # 状态码
2967
+ "code": 0,
2968
+ # 提示信息
2969
+ "message": "success",
2970
+ # 错误信息
2971
+ "errors": [],
2972
+ # 请求ID
2973
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
2974
+ # 响应时间
2975
+ "response_time": "2025-08-13 19:23:04",
2976
+ # 响应数据量
2977
+ "response_count": 2,
2978
+ # 总数据量
2979
+ "total_count": 2,
2980
+ # 响应数据
2981
+ "data": [
2982
+ {
2983
+ # 领星店铺ID (Seller.sid)
2984
+ "sid": 1,
2985
+ # 折扣名称 [原字段 'name']
2986
+ "discount_name": "会员专享8月份",
2987
+ # 折扣状态 [原字段 'origin_status']
2988
+ "status": "EXPIRED",
2989
+ # 折扣备注 [原字段 'remark']
2990
+ "note": "",
2991
+ # 货币符号
2992
+ "currency_icon": "€",
2993
+ # 参与折扣的商品数量
2994
+ "product_quantity": 100,
2995
+ # 折扣开始时间 (站点时间) [原字段 'promotion_start_time']
2996
+ "start_time": "2024-07-28 00:00:00",
2997
+ # 折扣结束时间 (站点时间) [原字段 'promotion_end_time']
2998
+ "end_time": "2024-08-26 23:59:00",
2999
+ # 首次同步时间 (站点时间)
3000
+ "first_sync_time": "2024-08-19 21:03:32",
3001
+ # 最后同步时间 (站点时间)
3002
+ "last_sync_time": "2024-10-10 21:15:53",
3003
+ # 更细时间 (站点时间)
3004
+ "update_time": "",
3005
+ },
3006
+ ...
3007
+ ],
3008
+ }
3009
+ ```
3010
+ """
3011
+ url = route.PROMOTION_DISCOUNTS
3012
+ # 解析并验证参数
3013
+ args = {
3014
+ "sids": sids,
3015
+ "start_data": start_data,
3016
+ "end_data": end_data,
3017
+ "offset": offset,
3018
+ "length": length,
3019
+ }
3020
+ try:
3021
+ p = param.Promotions.model_validate(args)
3022
+ except Exception as err:
3023
+ raise errors.InvalidParametersError(err, url, args) from err
3024
+
3025
+ # 发送请求
3026
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
3027
+ return schema.PromotionDiscounts.model_validate(data)
3028
+
3029
+ async def PromotionOnListings(
3030
+ self,
3031
+ site_date: str | datetime.date | datetime.datetime,
3032
+ *,
3033
+ start_data: str | datetime.date | datetime.datetime | None = None,
3034
+ end_data: str | datetime.date | datetime.datetime | None = None,
3035
+ sids: int | list[int] | None = None,
3036
+ promotion_type: int | list[int] | None = None,
3037
+ promotion_status: int | list[int] | None = None,
3038
+ product_status: int | list[int] | None = None,
3039
+ is_coupon_stacked: int | None = None,
3040
+ offset: int | None = None,
3041
+ length: int | None = None,
3042
+ ) -> schema.PromotionOnListings:
3043
+ """查询应用到 Listing 上的促销列表
3044
+
3045
+ ## Docs:
3046
+ - 销售 - 促销管理: [查询商品折扣列表](https://apidoc.lingxing.com/#/docs/Sale/promotionListingList)
3047
+
3048
+ :param site_date `<'str/date/datetime'>`: 站点日期, 必须是 str, date 或 datetime 类型
3049
+ :param start_data `<'str/date/datetime'>`: 促销开始日期, 默认 `None`
3050
+ :param end_data `<'str/date/datetime'>`: 促销结束日期, 默认 `None`
3051
+ :param sids `<'int/list[int]'>`: 领星店铺ID或ID列表,
3052
+ 默认 `None` (查询所有店铺), 参数来源: `Seller.sid`
3053
+ :param promotion_type `<'int/list[int]'>`: 促销类型或类型列表, 默认 `None` (查询所有类型)
3054
+
3055
+ - `1`: 优惠券
3056
+ - `2`: Deal
3057
+ - `3`: 活动
3058
+ - `4`: 价格折扣
3059
+
3060
+ :param promotion_status `<'int/list[int]'>`: 促销状态或状态列表, 默认 `None` (查询所有状态)
3061
+
3062
+ - `0`: 其他
3063
+ - `1`: 进行中
3064
+ - `2`: 已过期
3065
+ - `3`: 未开始
3066
+
3067
+ :param product_status `<'int/list[int]'>`: 商品状态或状态列表, 默认 `None` (查询所有状态)
3068
+
3069
+ - `-1`: 已删除
3070
+ - `0`: 停售
3071
+ - `1`: 在售
3072
+
3073
+ :param is_coupon_stacked `<'int'>`: 是否叠加优惠券 (0: 否, 1: 是), 默认 `None` (查询所有)
3074
+ :param offset `<'int'>`: 分页偏移量, 默认 `None` (使用: 0)
3075
+ :param length `<'int'>`: 分页长度, 最大值200, 默认 `None` (使用: 20)
3076
+ :returns `<'PromotionOnListings'>`: 返回查询到的应用到 Listing 上的促销列表
3077
+ ```python
3078
+ {
3079
+ # 状态码
3080
+ "code": 0,
3081
+ # 提示信息
3082
+ "message": "success",
3083
+ # 错误信息
3084
+ "errors": [],
3085
+ # 请求ID
3086
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
3087
+ # 响应时间
3088
+ "response_time": "2025-08-13 19:23:04",
3089
+ # 响应数据量
3090
+ "response_count": 2,
3091
+ # 总数据量
3092
+ "total_count": 2,
3093
+ # 响应数据
3094
+ "data": [
3095
+ {
3096
+ # 领星店铺ID (Seller.sid)
3097
+ "sid": 1,
3098
+ # 领星店铺名称 (Seller.name) [原字段 'store_name']
3099
+ "seller_name": "Seller****",
3100
+ # 国家 (中文) [原字段 'region_name']
3101
+ "country": "加拿大",
3102
+ # 商品ASIN
3103
+ "asin": "B0********",
3104
+ # 亚马逊卖家SKU (Listing.msku) [原字段 'seller_sku']
3105
+ "msku": "SKU********",
3106
+ # 商品标题 [原字段 'item_name']
3107
+ "title": "Product Title",
3108
+ # 商品链接
3109
+ "asin_url": "https://www.amazon.ca/dp/B0********",
3110
+ # 商品略缩图链接 [原字段 'small_image_url']
3111
+ "thunbnail_url": "https://m.media-amazon.com/images/I/7***.jpg",
3112
+ # 促销活动叠加数量 [原字段 'promotion_combo_num']
3113
+ "promotion_stacks": 2,
3114
+ # 货币符号
3115
+ "currency_icon": "CA$",
3116
+ # 销售价格
3117
+ "sales_price": 54.89,
3118
+ # 销售价格 (美金)
3119
+ "sales_price_usd": 41.14,
3120
+ # 最低折扣价格 [原字段 'discount_price_min']
3121
+ "discount_min_price": 36.58,
3122
+ # 平均折扣金额 [原字段 'avg_deal_price']
3123
+ "discount_avg_amt": 0.0,
3124
+ # 平均折扣百分比 [原字段 'discount_rate_rate']
3125
+ "discount_avg_pct": 83.0,
3126
+ # FBA可售库存 [原字段 'afn_fulfillable_quantity']
3127
+ "afn_fulfillable_qty": 0,
3128
+ # FBM可售库存 [原字段 'quantity']
3129
+ "mfn_fulfillable_qty": 0,
3130
+ # Listing负责人 [原字段 'principal_list']
3131
+ "operators": ["白小白"],
3132
+ # Listing标签 [原字段: 'listing_tags']
3133
+ "tags": [
3134
+ {
3135
+ # 领星标签ID (ListingGlobalTag.tag_id) [原字段 'global_tag_id']
3136
+ "tag_id": "90****************",
3137
+ # 领星标签名称 (ListingGlobalTag.tag_name) [原字段 'tag_name']
3138
+ "tag_name": "特殊",
3139
+ # 领星标签颜色 (如: "#FF0000") [原字段 'color']
3140
+ "tag_color": "#4B8BFA",
3141
+ },
3142
+ ...
3143
+ ],
3144
+ "promotions": [
3145
+ {
3146
+ # 促销ID
3147
+ "promotion_id": "823e7911-8cc5-****-****-************",
3148
+ # 促销名称 [原字段: 'name']
3149
+ "promotion_name": "Promotion",
3150
+ # 促销状态 [原字段 'origin_status']
3151
+ "status": "APPROVED",
3152
+ # 促销状态码 (0: 其他, 1: 进行中, 2: 已过期, 3: 未开始) [原字段 'status']
3153
+ "status_code": 3,
3154
+ # 促销类型 (1: 优惠券, 2: Deal, 3 活动, 4 价格折扣) [原字段 'category']
3155
+ "promotion_type": 2,
3156
+ # 促销类型文本 [原字段 'category_text']
3157
+ "promotion_type_text": "秒杀",
3158
+ # 促销子类型 [原字段 'promotion_type']
3159
+ "promotion_sub_type": 2,
3160
+ # 促销子类型文本 [原字段 'promotion_type_text']
3161
+ "promotion_sub_type_text": "Lightning Deal",
3162
+ # 折扣金额/折扣售价 [原字段 'discount_price']
3163
+ "discount_amt": 46.31,
3164
+ # 折扣百分比/售价百分比 [原字段 'discount_rate']
3165
+ "discount_pct": 83.0,
3166
+ # 促销开始时间 (站点时间) [原字段 'promotion_start_time']
3167
+ "start_time": "2024-10-22 05:30:00",
3168
+ # 促销结束时间 (站点时间) [原字段 'promotion_end_time
3169
+ "end_time": "2024-10-22 17:30:00",
3170
+ },
3171
+ ...
3172
+ ],
3173
+ },
3174
+ ...
3175
+ ],
3176
+ }
3177
+ ```
3178
+ """
3179
+ url = route.PROMOTION_ON_LISTINGS
3180
+ # 解析并验证参数
3181
+ args = {
3182
+ "site_date": site_date,
3183
+ "start_data": start_data,
3184
+ "end_data": end_data,
3185
+ "sids": sids,
3186
+ "promotion_type": promotion_type,
3187
+ "promotion_status": promotion_status,
3188
+ "product_status": product_status,
3189
+ "is_coupon_stacked": is_coupon_stacked,
3190
+ "offset": offset,
3191
+ "length": length,
3192
+ }
3193
+ try:
3194
+ p = param.PromotionOnListings.model_validate(args)
3195
+ except Exception as err:
3196
+ raise errors.InvalidParametersError(err, url, args) from err
3197
+
3198
+ # 发送请求
3199
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
3200
+ return schema.PromotionOnListings.model_validate(data)