lingxingapi 1.1.4__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.
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 +557 -0
  8. lingxingapi/base/__init__.py +0 -0
  9. lingxingapi/base/api.py +568 -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 +218 -0
  18. lingxingapi/errors.py +152 -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 +456 -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.1.4.dist-info/METADATA +73 -0
  62. lingxingapi-1.1.4.dist-info/RECORD +65 -0
  63. lingxingapi-1.1.4.dist-info/WHEEL +5 -0
  64. lingxingapi-1.1.4.dist-info/licenses/LICENSE +22 -0
  65. lingxingapi-1.1.4.dist-info/top_level.txt +1 -0
lingxingapi/fba/api.py ADDED
@@ -0,0 +1,1691 @@
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.fba import param, route, schema
7
+
8
+ # Type Aliases ---------------------------------------------------------------------------------------------------------
9
+ STA_STATUS = Literal["ACTIVE", "VOIDED", "SHIPPED", "ERRORED"]
10
+ SHIPMENT_STATUS = Literal[
11
+ "WORKING",
12
+ "READY_TO_SHIP",
13
+ "SHIPPED",
14
+ "RECEIVING",
15
+ "CLOSED",
16
+ "CANCELLED",
17
+ "DELETED",
18
+ ]
19
+ ADDRESS_SEARCH_FIELD = Literal["alias_name", "sender_name"]
20
+
21
+
22
+ # API ------------------------------------------------------------------------------------------------------------------
23
+ class FbaAPI(BaseAPI):
24
+ """领星API `FBA数据` 接口
25
+
26
+ ## Notice
27
+ 请勿直接实例化此类
28
+ """
29
+
30
+ # 公共 API --------------------------------------------------------------------------------------
31
+ # . FBA货件(STA)
32
+ async def StaPlans(
33
+ self,
34
+ start_date: str | datetime.date | datetime.datetime,
35
+ end_date: str | datetime.date | datetime.datetime,
36
+ date_type: int,
37
+ *,
38
+ plan_name: str | None = None,
39
+ shipment_ids: str | list[str] | None = None,
40
+ statuses: STA_STATUS | list[STA_STATUS] | None = None,
41
+ sids: int | list[int] | None = None,
42
+ page: int = 1,
43
+ length: int = 200,
44
+ ) -> schema.StaPlans:
45
+ """查询STA计划
46
+
47
+ ## Docs
48
+ - FBA - FBA货件(STA): [查询STA任务列表](https://apidoc.lingxing.com/#/docs/FBA/QuerySTATaskList)
49
+
50
+ :param start_date `<'str/date/datetime'>`: 开始日期 (北京时间), 双闭区间
51
+ :param end_date `<'str/date/datetime'>`: 结束日期 (北京时间), 双闭区间
52
+ :param date_type `<'int'>`: 时期类型 (1: 创建日期; 2: 更新日期)
53
+ :param plan_name `<'str'>`: STA计划名称 (模糊搜索), 默认 `None` (不搜索)
54
+ :param shipment_ids `<'str/list[str]'>`: 货件ID或货件单号列表 (精确搜索), 默认 `None` (不搜索)
55
+ :param statuses `<'str/list[str]'>`: STA计划状态列表, 默认 `None` (不筛选),
56
+ 可选值: 'ACTIVE', 'VOIDED', 'SHIPPED', 'ERRORED'
57
+ :param sids `<'int/list[int]'>`: 领星店铺ID列表, 默认 `None` (不筛选)
58
+ :param page `<'int'>`: 分页页码, 默认 `1`
59
+ :param length `<'int'>`: 分页大小, 最大值200, 默认 `200`
60
+ :returns `<'StaPlans'>`: 返回查询STA计划的结果
61
+ ```python
62
+ {
63
+ # 状态码
64
+ "code": 0,
65
+ # 提示信息
66
+ "message": "success",
67
+ # 错误信息
68
+ "errors": [],
69
+ # 请求ID
70
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
71
+ # 响应时间
72
+ "response_time": "2025-08-13 19:23:04",
73
+ # 响应数据量
74
+ "response_count": 2,
75
+ # 总数据量
76
+ "total_count": 2,
77
+ # 响应数据
78
+ "data": [
79
+ {
80
+ # 领星店铺ID
81
+ "sid": 1,
82
+ # STA计划ID [原字段 'inboundPlanId']
83
+ "inbound_plan_id": "wf1a0e57bc-****-****-****-************",
84
+ # STA计划名称 [原字段 'planName']
85
+ "plan_name": "",
86
+ # 计划状态
87
+ "status": "ACTIVE",
88
+ # 分仓类型 (1: 先装箱再分仓, 2: 先分仓再装箱)
89
+ "position_type": "2",
90
+ # 创建时间 [原字段 'gmtCreate']
91
+ "create_time": "2025-08-13 13:58",
92
+ # 计划创建时间 [原字段 'planCreateTime']
93
+ "plan_create_time": "2025-08-13 13:58",
94
+ # 更新时间 [原字段 'gmtModified']
95
+ "update_time": "2025-08-13 16:46",
96
+ # 计划更新时间 [原字段 'planUpdateTime']
97
+ "plan_update_time": "2025-08-13 14:04",
98
+ # 货件列表 [原字段 'shipmentList']
99
+ "shipments": [
100
+ {
101
+ # 货件列表 [原字段 'shipmentList']
102
+ "shipment_id": "she2e425f4-****-****-****-************",
103
+ # 货件确认ID
104
+ "shipment_confirmation_id": "FBA15*******",
105
+ # 货件状态
106
+ "shipment_status": "",
107
+ # 取件ID
108
+ "pick_up_id": "",
109
+ # 运单号
110
+ "freight_bill_number": "",
111
+ },
112
+ ...
113
+ ],
114
+ # 计划商品列表 [原字段 'inboundPlanItemList']
115
+ "items": [
116
+ {
117
+ # 亚马逊ASIN
118
+ "asin": "B0D*******",
119
+ # 父ASIN [原字段 'parent_asin']
120
+ "parent_asin": "B0D*******",
121
+ # 亚马逊SKU
122
+ "msku": "SKU********",
123
+ # 领星本地SKU [原字段 'sku']
124
+ "lsku": "LOCAL********",
125
+ # 亚马逊FNSKU
126
+ "fnsku": "X00*******",
127
+ # 领星本地商品名称 [原字段 'productName']
128
+ "product_name": "P********",
129
+ # 商品标题
130
+ "title": "Product Title",
131
+ # 商品略缩图
132
+ "thumbnail_url": "https://m.media-amazon.com/****.jpg",
133
+ # 预处理方 [原字段 'prepOwner']
134
+ "prep_owner": "SELLER",
135
+ # 标签处理方 [原字段 'labelOwner']
136
+ "label_owner": "SELLER",
137
+ # 有效日期 [原字段 'expiration']
138
+ "expiration_date": "",
139
+ # 货件申报数量 [原字段 'quantity']
140
+ "item_qty": 500,
141
+ },
142
+ ...
143
+ ],
144
+ },
145
+ ],
146
+ }
147
+ ```
148
+ """
149
+ url = route.STA_PLANS
150
+ # 解析并验证参数
151
+ args = {
152
+ "start_date": start_date,
153
+ "end_date": end_date,
154
+ "date_type": date_type,
155
+ "plan_name": plan_name,
156
+ "shipment_ids": shipment_ids,
157
+ "statuses": statuses,
158
+ "sids": sids,
159
+ "page": page,
160
+ "length": length,
161
+ }
162
+ try:
163
+ p = param.StaPlans.model_validate(args)
164
+ except Exception as err:
165
+ raise errors.InvalidParametersError(err, url, args) from err
166
+
167
+ # 发送请求
168
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
169
+ return schema.StaPlans.model_validate(data)
170
+
171
+ async def StaPlanDetail(
172
+ self,
173
+ sid: int,
174
+ inbound_plan_id: str,
175
+ ) -> schema.StaPlanDetailData:
176
+ """查询STA计划详情
177
+
178
+ ## Docs
179
+ - FBA - FBA货件(STA): [查询STA任务详情](https://apidoc.lingxing.com/#/docs/FBA/StaTaskDetail)
180
+
181
+ :param sid `<'int'>`: 领星店铺ID
182
+ :param inbound_plan_id `<'str'>`: STA计划ID, 参数来源: `StaPlan.inbound_plan_id`
183
+ :returns `<'StaPlanDetailData'>`: 返回查询STA计划详情的结果
184
+ ```python
185
+ {
186
+ # 状态码
187
+ "code": 0,
188
+ # 提示信息
189
+ "message": "success",
190
+ # 错误信息
191
+ "errors": [],
192
+ # 请求ID
193
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
194
+ # 响应时间
195
+ "response_time": "2025-08-13 19:23:04",
196
+ # 响应数据量
197
+ "response_count": 2,
198
+ # 总数据量
199
+ "total_count": 2,
200
+ # 响应数据
201
+ "data": {
202
+ # STA计划ID [原字段 'inboundPlanId']
203
+ "inbound_plan_id": "wf7b4fc853-****-****-****-************",
204
+ # 计划名称 [原字段 'planName']
205
+ "plan_name": "",
206
+ # 计划状态
207
+ "status": "ACTIVE",
208
+ # 分仓类型 (1: 先装箱再分仓, 2: 先分仓再装箱)
209
+ "position_type": "2",
210
+ # 创建时间 [原字段 'gmtCreate']
211
+ "create_time": "2025-08-13 09:58",
212
+ # 计划创建时间 [原字段 'planCreateTime']
213
+ "plan_create_time": "2025-08-13 09:15",
214
+ # 更新时间 [原字段 'gmtModified']
215
+ "update_time": "2025-08-13 12:45",
216
+ # 计划更新时间 [原字段 'planUpdateTime']
217
+ "plan_update_time": "2025-08-13 09:18",
218
+ # 货件列表 [原字段 'shipmentList']
219
+ "shipments": [
220
+ {
221
+ # 货件列表 [原字段 'shipmentList']
222
+ "shipment_id": "she2e425f4-****-****-****-************",
223
+ # 货件确认ID
224
+ "shipment_confirmation_id": "FBA15*******",
225
+ # 货件状态
226
+ "shipment_status": "READY_TO_SHIP",
227
+ # 取件ID
228
+ "pick_up_id": "",
229
+ # 运单号
230
+ "freight_bill_number": "",
231
+ },
232
+ ...
233
+ ],
234
+ # 发货地址 [原字段 'addressVO']
235
+ "shipment_address": {
236
+ # 国家代码 [原字段 'countryCode']
237
+ "country_code": "CN",
238
+ # 国家名称 [原字段 'countryName']
239
+ "country": "CN",
240
+ # 州或省 [原字段 'stateOrProvinceCode']
241
+ "state": "Guangdong",
242
+ # 城市
243
+ "city": "Shenzhen",
244
+ # 发货地址行1 [原字段 'addressLine1']
245
+ "address_line1": "Address",
246
+ # 发货地址行2 [原字段 'addressLine2']
247
+ "address_line2": "",
248
+ # 邮政编码 [原字段 'postalCode']
249
+ "postcode": "518000",
250
+ # 发货人姓名 [原字段 'shipperName']
251
+ "shipper_name": "白小白",
252
+ # 电子邮件 [原字段 'email']
253
+ "email": "baixiaobai@qq.com",
254
+ # 电话号码 [原字段 'phoneNumber']
255
+ "phone": "18*********",
256
+ },
257
+ # 计划商品列表 [原字段 'productList']
258
+ "items": [
259
+ {
260
+ # 亚马逊ASIN
261
+ "asin": "B0D*******",
262
+ # 父ASIN [原字段 'parent_asin']
263
+ "parent_asin": "B0D*******",
264
+ # 亚马逊SKU
265
+ "msku": "SKU********",
266
+ # 领星本地SKU [原字段 'sku']
267
+ "lsku": "LOCAL********",
268
+ # 亚马逊FNSKU
269
+ "fnsku": "X00*******",
270
+ # 领星本地商品名称 [原字段 'productName']
271
+ "product_name": "P********",
272
+ # 商品标题
273
+ "title": "Product Title",
274
+ # 商品略缩图
275
+ "thumbnail_url": "https://m.media-amazon.com/****.jpg",
276
+ # 预处理方 [原字段 'prepOwner']
277
+ "prep_owner": "SELLER",
278
+ # 标签处理方 [原字段 'labelOwner']
279
+ "label_owner": "SELLER",
280
+ # 有效日期 [原字段 'expiration']
281
+ "expiration_date": "",
282
+ # 货件申报数量 [原字段 'quantity']
283
+ "item_qty": 500,
284
+ },
285
+ ...
286
+ ],
287
+ },
288
+ }
289
+ ```
290
+ """
291
+ url = route.STA_PLAN_DETAIL
292
+ # 解析并验证参数
293
+ args = {
294
+ "sid": sid,
295
+ "inbound_plan_id": inbound_plan_id,
296
+ }
297
+ try:
298
+ p = param.StaID.model_validate(args)
299
+ except Exception as err:
300
+ raise errors.InvalidParametersError(err, url, args) from err
301
+
302
+ # 发送请求
303
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
304
+ return schema.StaPlanDetailData.model_validate(data)
305
+
306
+ async def PackingGroups(
307
+ self,
308
+ sid: int,
309
+ inbound_plan_id: str,
310
+ ) -> schema.PackingGroups:
311
+ """查询STA包装组
312
+
313
+ ## Docs
314
+ - FBA - FBA货件(STA): [查询包装组](https://apidoc.lingxing.com/#/docs/FBA/ListPackingGroupItems)
315
+
316
+ :param sid `<'int'>`: 领星店铺ID
317
+ :param inbound_plan_id `<'str'>`: STA计划ID, 参数来源: `StaPlan.inbound_plan_id`
318
+ :returns `<'PackingGroups'>`: 返回查询包装组的结果
319
+ ```python
320
+ {
321
+ # 状态码
322
+ "code": 0,
323
+ # 提示信息
324
+ "message": "success",
325
+ # 错误信息
326
+ "errors": [],
327
+ # 请求ID
328
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
329
+ # 响应时间
330
+ "response_time": "2025-08-13 19:23:04",
331
+ # 响应数据量
332
+ "response_count": 2,
333
+ # 总数据量
334
+ "total_count": 2,
335
+ # 响应数据
336
+ "data": [
337
+ {
338
+ # 包装组ID [原字段 'packingGroupId']
339
+ "packing_group_id": "pg7847440c-****-****-****-************",
340
+ # 包装组商品列表 [原字段 'packingGroupItemList']
341
+ "items": [
342
+ {
343
+ # 亚马逊ASIN
344
+ "asin": "B0D*******",
345
+ # 父ASIN [原字段 'parent_asin']
346
+ "parent_asin": "B0D*******",
347
+ # 亚马逊SKU
348
+ "msku": "SKU********",
349
+ # 领星本地SKU [原字段 'sku']
350
+ "lsku": "LOCAL********",
351
+ # 亚马逊FNSKU
352
+ "fnsku": "X00*******",
353
+ # 领星本地商品名称 [原字段 'productName']
354
+ "product_name": "P********",
355
+ # 商品标题
356
+ "title": "Product Title",
357
+ # 商品略缩图
358
+ "thumbnail_url": "https://m.media-amazon.com/****.jpg",
359
+ # 预处理方 [原字段 'prepOwner']
360
+ "prep_owner": "SELLER",
361
+ # 标签处理方 [原字段 'labelOwner']
362
+ "label_owner": "SELLER",
363
+ # 有效日期 [原字段 'expiration']
364
+ "expiration_date": "",
365
+ # 货件申报数量 [原字段 'quantity']
366
+ "item_qty": 500,
367
+ },
368
+ ...
369
+ ],
370
+ },
371
+ ...
372
+ ],
373
+ }
374
+ ```
375
+ """
376
+ url = route.PACKING_GROUPS
377
+ # 解析并验证参数
378
+ args = {
379
+ "sid": sid,
380
+ "inbound_plan_id": inbound_plan_id,
381
+ }
382
+ try:
383
+ p = param.StaID.model_validate(args)
384
+ except Exception as err:
385
+ raise errors.InvalidParametersError(err, url, args) from err
386
+
387
+ # 发送请求
388
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
389
+ return schema.PackingGroups.model_validate(data)
390
+
391
+ async def PackingGroupBoxes(
392
+ self,
393
+ sid: int,
394
+ inbound_plan_id: str,
395
+ packing_group_ids: str | list[str],
396
+ ) -> schema.PackingGroupBoxes:
397
+ """查询STA包装组装箱信息
398
+
399
+ ## Docs
400
+ - FBA - FBA货件(STA): [查询STA任务包装组装箱信息](https://apidoc.lingxing.com/#/docs/FBA/QuerySTATaskBoxInformation
401
+
402
+ :param sid `<'int'>`: 领星店铺ID
403
+ :param inbound_plan_id `<'str'>`: STA计划ID, 参数来源: `StaPlan.inbound_plan_id`
404
+ :param packing_group_ids `<'str/list[str]'>`: 包装组ID列表, 参数来源: `PackingGroup.packing_group_id`
405
+ :returns `<'PackingGroupBoxes'>`: 返回查询包装组装箱信息的结果
406
+ ```python
407
+ {
408
+ # 状态码
409
+ "code": 0,
410
+ # 提示信息
411
+ "message": "success",
412
+ # 错误信息
413
+ "errors": [],
414
+ # 请求ID
415
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
416
+ # 响应时间
417
+ "response_time": "2025-08-13 19:23:04",
418
+ # 响应数据量
419
+ "response_count": 2,
420
+ # 总数据量
421
+ "total_count": 2,
422
+ # 响应数据
423
+ "data": [
424
+ {
425
+ # 包装组ID [原字段 'packingGroupId']
426
+ "packing_group_id": "pg2ec98be6-****-****-****-************",
427
+ # 装箱列表 [原字段 'shipmentPackingList']
428
+ "boxes": [
429
+ {
430
+ # 包裹ID [原字段 'packageId']
431
+ "package_id": "pkb1170e07-****-****-****-************",
432
+ # 箱子顺序号 [原字段 'localBoxId']
433
+ "box_seq": 1,
434
+ # 亚马逊箱子ID [原字段 'boxId']
435
+ "box_id": "",
436
+ # 箱子名称 [原字段 'boxName']
437
+ "box_name": "P1 - B1",
438
+ # 箱内商品总数量 [原字段 'total']
439
+ "box_item_qty": 85,
440
+ # 箱子重量
441
+ "weight": 10.2,
442
+ # 重量单位 [原字段 'weightUnit']
443
+ "weight_unit": "KG",
444
+ # 箱子长度
445
+ "length": 635.0,
446
+ # 箱子宽度
447
+ "width": 20.3,
448
+ # 箱子高度
449
+ "height": 45.7,
450
+ # 箱子尺寸单位 [原字段 'lengthUnit']
451
+ "dimension_unit": "CM",
452
+ # 箱内商品列表 [原字段 'productList']
453
+ "items": [
454
+ {
455
+ # 亚马逊ASIN
456
+ "asin": "B0D*******",
457
+ # 父ASIN [原字段 'parent_asin']
458
+ "parent_asin": "B0D*******",
459
+ # 亚马逊SKU
460
+ "msku": "SKU********",
461
+ # 领星本地SKU [原字段 'sku']
462
+ "lsku": "LOCAL********",
463
+ # 亚马逊FNSKU
464
+ "fnsku": "X00*******",
465
+ # 领星本地商品名称 [原字段 'productName']
466
+ "product_name": "P********",
467
+ # 商品标题
468
+ "title": "Product Title",
469
+ # 商品略缩图
470
+ "thumbnail_url": "https://m.media-amazon.com/****.jpg",
471
+ # 预处理方 [原字段 'prepOwner']
472
+ "prep_owner": "SELLER",
473
+ # 标签处理方 [原字段 'labelOwner']
474
+ "label_owner": "SELLER",
475
+ # 有效日期 [原字段 'expiration']
476
+ "expiration_date": "",
477
+ # 箱内商品总数量 [原字段 'quantityInBox']
478
+ "item_qty": 85,
479
+ },
480
+ ...
481
+ ],
482
+ },
483
+ ...
484
+ ],
485
+ },
486
+ ...
487
+ ],
488
+ }
489
+ ```
490
+ """
491
+ url = route.PACKING_GROUP_BOXES
492
+ # 解析并验证参数
493
+ args = {
494
+ "sid": sid,
495
+ "inbound_plan_id": inbound_plan_id,
496
+ "packing_group_ids": packing_group_ids,
497
+ }
498
+ try:
499
+ p = param.PackingGroupBoxes.model_validate(args)
500
+ except Exception as err:
501
+ raise errors.InvalidParametersError(err, url, args) from err
502
+
503
+ # 发送请求
504
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
505
+ return schema.PackingGroupBoxes.model_validate(data)
506
+
507
+ async def PlacementOptions(
508
+ self,
509
+ sid: int,
510
+ inbound_plan_id: str,
511
+ ) -> schema.PlacementOptions:
512
+ """查询货件分仓方案
513
+
514
+ ## Docs
515
+ - FBA - FBA货件(STA): [查询货件方案](https://apidoc.lingxing.com/#/docs/FBA/ShipmentPreView)
516
+
517
+ :param sid `<'int'>`: 领星店铺ID
518
+ :param inbound_plan_id `<'str'>`: STA计划ID, 参数来源: `StaPlan.inbound_plan_id`
519
+ :returns `<'PlacementOptions'>`: 返回查询货件分仓方案的结果
520
+ ```python
521
+ {
522
+ # 状态码
523
+ "code": 0,
524
+ # 提示信息
525
+ "message": "操作成功",
526
+ # 错误信息
527
+ "errors": [],
528
+ # 请求ID
529
+ "request_id": "f9e5e291e14c4180a3cf1405b4d24b99.191.17554878107185127",
530
+ # 响应时间
531
+ "response_time": "2025-08-18T11:30:10.826",
532
+ # 响应数据量
533
+ "response_count": 2,
534
+ # 总数据量
535
+ "total_count": 2,
536
+ # 响应数据
537
+ "data": [
538
+ {
539
+ # 货件分仓方案ID [原字段 'placementOptionId']
540
+ "placement_option_id": "plda18cf79-****-****-****-************",
541
+ # 货件分仓状态 [原字段 'placementStatus']
542
+ "placement_status": "ACCEPTED",
543
+ # 货件分仓过期时间 [原字段 'expiration']
544
+ "expiration": {
545
+ # 年份值
546
+ "year": 2025,
547
+ # 月份值 [原字段 'monthValue']
548
+ "month": 8,
549
+ # 天数值 [原字段 'dayOfMonth']
550
+ "day": 18,
551
+ # 小时值
552
+ "hour": 2,
553
+ # 分钟值
554
+ "minute": 48,
555
+ # 秒值
556
+ "second": 58,
557
+ # 纳秒值
558
+ "nano": 4000000,
559
+ # 年内日序 [原字段 'dayOfYear']
560
+ "day_of_year": 230,
561
+ # 月份名称 [原字段 'month']
562
+ "month_name": "AUGUST",
563
+ # 星期名称 [原字段 'dayOfWeek']
564
+ "weekday_name": "MONDAY",
565
+ # 时区偏移 [原字段 'offset']
566
+ "offset": {
567
+ # 时区ID [原字段 'id']
568
+ "timezone_id": "Z",
569
+ # 时区偏移秒数 [原字段 'totalSeconds']
570
+ "seconds": 0,
571
+ # 时区规则
572
+ "rules": {
573
+ # 时区过渡
574
+ "transitions": [],
575
+ # 时区过渡规则 [原字段 'transitionRules']
576
+ "transition_rules": [],
577
+ # 时区是否固定偏移 [原字段 'fixedOffset']
578
+ "fixed_offset": True,
579
+ },
580
+ },
581
+ },
582
+ # 总费用 [原字段 'feeCount']
583
+ "fee_amt": 35.12,
584
+ # 费用列表 [原字段 'fees']
585
+ "fees": [
586
+ {
587
+ # 费用项目 [原字段 'target']
588
+ # (如: Placement Services, Fulfillment Fee Discount)
589
+ "charge": "Placement Services",
590
+ # 费用类型 (如: FEE, DISCOUNT)
591
+ "type": "FEE",
592
+ # 费用金额 [原字段 'amount']
593
+ "fee_amt": 37.62,
594
+ # 费用币种代码 [原字段 'code']
595
+ "currency_code": "USD",
596
+ },
597
+ ...
598
+ ],
599
+ # 货件列表 [原字段 'shipmentInformationList']
600
+ "shipments": [
601
+ {
602
+ # 货件ID [原字段 'shipmentId']
603
+ "shipment_id": "sh1483a535-****-****-****-************",
604
+ # 货件名称 [原字段 'shipmentName']
605
+ "shipment_name": "GP-LBE1",
606
+ # 亚马逊配送中心编码 [原字段 'wareHouseId']
607
+ "fulfillment_center_id": "LBE1",
608
+ # 入库区域 (中文) [原字段 'postalCodeMark']
609
+ "inbound_region": "东部",
610
+ # 收货地址 [原字段 'address']
611
+ "ship_to_address": {
612
+ # 国家代码 [原字段: 'countryCode']
613
+ "country_code": "US",
614
+ # 州或省代码 [原字段 'stateOrProvinceCode']
615
+ "state": "PA",
616
+ # 城市
617
+ "city": "NEW STANTON",
618
+ # 地址行1 [原字段 'addressLine1']
619
+ "address_line1": "165 GLENN FOX RD",
620
+ # 地址行2 [原字段 'addressLine2']
621
+ "address_line2": "",
622
+ # 地址名称 [原字段 'addressName']
623
+ "address_name": "LBE1",
624
+ # 邮政编码 [原字段 'postalCode']
625
+ "postcode": "15672-9703",
626
+ # 公司名称 [原字段 'companyName']
627
+ "company_name": "",
628
+ # 电子邮箱
629
+ "email": "",
630
+ # 电话号码 [原字段 'phoneNumber']
631
+ "phone": "",
632
+ },
633
+ # 不同货件商品数 [原字段 'itemCount']
634
+ "item_count": 2,
635
+ '# 货件商品申报总数量 [原字段 'quantity']'
636
+ "items_qty": 209,
637
+ # 货件商品列表 [原字段 'itemList']
638
+ "items": [
639
+ {
640
+ # 亚马逊ASIN
641
+ "asin": "B0F*******",
642
+ # 父ASIN [原字段 'parent_asin']
643
+ "parent_asin": "B0F*******",
644
+ # 亚马逊SKU
645
+ "msku": "SKU********",
646
+ # 领星本地SKU [原字段 'sku']
647
+ "lsku": "",
648
+ # 亚马逊FNSKU
649
+ "fnsku": "X00*******",
650
+ # 领星本地商品名称 [原字段 'productName']
651
+ "product_name": "",
652
+ # 商品标题
653
+ "title": "Product Title",
654
+ # 商品略缩图
655
+ "thumbnail_url": "https://m.media-amazon.com/****.jpg",
656
+ # 货件申报数量 [原字段 'quantity']
657
+ "item_qty": 149,
658
+ },
659
+ ...
660
+ ],
661
+ }
662
+ ],
663
+ }
664
+ ],
665
+ }
666
+ ```
667
+ """
668
+ url = route.PLACEMENT_OPTIONS
669
+ # 解析并验证参数
670
+ args = {
671
+ "sid": sid,
672
+ "inbound_plan_id": inbound_plan_id,
673
+ }
674
+ try:
675
+ p = param.StaID.model_validate(args)
676
+ except Exception as err:
677
+ raise errors.InvalidParametersError(err, url, args) from err
678
+
679
+ # 发送请求
680
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
681
+ return schema.PlacementOptions.model_validate(data)
682
+
683
+ async def PlacementOptionBoxes(
684
+ self,
685
+ sid: int,
686
+ inbound_plan_id: str,
687
+ ) -> schema.PlacementOptionBoxes:
688
+ """查询货件分仓方案装箱信息
689
+
690
+ ## Docs
691
+ - FBA - FBA货件(STA): [查询货件方案的装箱信息](https://apidoc.lingxing.com/#/docs/FBA/getInboundPackingBoxInfo)
692
+
693
+ :param sid `<'int'>`: 领星店铺ID
694
+ :param inbound_plan_id `<'str'>`: STA计划ID, 参数来源: `StaPlan.inbound_plan_id`
695
+ :returns `<'PlacementOptionBoxes'>`: 返回查询货件分仓方案装箱信息的结果
696
+ ```python
697
+ {
698
+ # 状态码
699
+ "code": 0,
700
+ # 提示信息
701
+ "message": "操作成功",
702
+ # 错误信息
703
+ "errors": [],
704
+ # 请求ID
705
+ "request_id": "f9e5e291e14c4180a3cf1405b4d24b99.191.17554878107185127",
706
+ # 响应时间
707
+ "response_time": "2025-08-18T11:30:10.826",
708
+ # 响应数据量
709
+ "response_count": 2,
710
+ # 总数据量
711
+ "total_count": 2,
712
+ # 响应数据
713
+ "data": [
714
+ {
715
+ # 货件分仓方案ID [原字段 'placementOptionId']
716
+ "placement_option_id": "plda18cf79-****-****-****-************",
717
+ # 货件分仓状态 [原字段 'placementStatus']
718
+ "placement_status": "ACCEPTED",
719
+ # 货件装箱列表 [原字段 'shipmentInformationList']
720
+ "shipments": [
721
+ {
722
+ # 货件ID [原字段 'shipmentId']
723
+ "shipment_id": "sh1483a535-****-****-****-************",
724
+ # 货件重量
725
+ "weight": 118.0,
726
+ # 货件重量单位 [原字段 'weightUnit']
727
+ "weight_unit": "LB",
728
+ # 货件体积
729
+ "volume": 6.7,
730
+ # 货件体积单位 [原字段 'volumeUnit']
731
+ "volume_unit": "FT³",
732
+ # 装箱列表 [原字段 'shipmentPackingList']
733
+ "boxes": [
734
+ {
735
+ # 箱子名称 [原字段 'boxName']
736
+ "box_name": "P1 - B2",
737
+ # 箱子重量
738
+ "weight": 22.0,
739
+ # 重量单位 [原字段 'weightUnit']
740
+ "weight_unit": "LB",
741
+ # 箱子长度
742
+ "length": 12.0,
743
+ # 箱子宽度
744
+ "width": 10.0,
745
+ # 箱子高度
746
+ "height": 16.0,
747
+ # 箱子尺寸单位 [原字段 'lengthUnit']
748
+ "dimension_unit": "IN",
749
+ # 箱子总数量 [原字段 'total']
750
+ "box_qty": 1,
751
+ # 箱内商品列表 [原字段 'productList']
752
+ "items": [
753
+ {
754
+ # 亚马逊ASIN
755
+ "asin": "B0F*******",
756
+ # 父ASIN [原字段 'parent_asin']
757
+ "parent_asin": "B0F*******",
758
+ # 亚马逊SKU
759
+ "msku": "SKU********",
760
+ # 领星本地SKU [原字段 'sku']
761
+ "lsku": "",
762
+ # 亚马逊FNSKU
763
+ "fnsku": "X00*******",
764
+ # 领星本地商品名称 [原字段 'productName']
765
+ "product_name": "",
766
+ # 商品标题
767
+ "title": "Product Title",
768
+ # 商品略缩图
769
+ "thumbnail_url": "https://m.media-amazon.com/****.jpg",
770
+ # 箱内商品总数量 [原字段 'quantityInBox']
771
+ "item_qty": 37,
772
+ },
773
+ ...
774
+ ],
775
+ },
776
+ ...
777
+ ],
778
+ },
779
+ ...
780
+ ],
781
+ },
782
+ ...
783
+ ],
784
+ }
785
+ ```
786
+ """
787
+ url = route.PLACEMENT_OPTION_BOXES
788
+ # 解析并验证参数
789
+ args = {
790
+ "sid": sid,
791
+ "inbound_plan_id": inbound_plan_id,
792
+ }
793
+ try:
794
+ p = param.StaID.model_validate(args)
795
+ except Exception as err:
796
+ raise errors.InvalidParametersError(err, url, args) from err
797
+
798
+ # 发送请求
799
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
800
+ return schema.PlacementOptionBoxes.model_validate(data)
801
+
802
+ async def Shipments(
803
+ self,
804
+ sids: int | list[int],
805
+ start_date: str | datetime.date | datetime.datetime,
806
+ end_date: str | datetime.date | datetime.datetime,
807
+ *,
808
+ sub_start_date: str | datetime.date | datetime.datetime | None = None,
809
+ sub_end_date: str | datetime.date | datetime.datetime | None = None,
810
+ sub_date_type: int | None = None,
811
+ shipment_ids: str | list[str] | None = None,
812
+ shipment_statuses: SHIPMENT_STATUS | list[SHIPMENT_STATUS] | None = None,
813
+ length: int | None = None,
814
+ offset: int | None = None,
815
+ ) -> schema.Shipments:
816
+ """查询STA货件
817
+
818
+ ## Docs
819
+ - FBA - FBA货件(STA): [查询货件列表](https://apidoc.lingxing.com/#/docs/FBA/FBAShipmentList)
820
+
821
+ :param sids `<'int/list[int]'>`: 领星店铺ID或ID列表
822
+ :param start_date `<'str/date/datetime'>`: 货件创建开始日期, 左闭右开
823
+ :param end_date `<'str/date/datetime'>`: 货件创建结束日期, 左闭右开
824
+ :param sub_start_date `<'str/date/datetime'>`: 子筛选开始日期, 左闭右开, 默认 `None` (不筛选)
825
+ :param sub_end_date `<'str/date/datetime'>`: 子筛选结束日期, 左闭右开, 默认 `None` (不筛选)
826
+ :param sub_date_type `<'int'>`: 子筛选日期类型 (1: 货件修改日期), 默认 `None` (不筛选)
827
+ :param shipment_ids `<'str/list[str]'>`: 货件ID或ID列表, 默认 `None` (不筛选)
828
+ :param shipment_statuses `<'str/list[str]'>`: 货件状态列表, 默认 `None` (不筛选), 可选值:
829
+
830
+ - `'WORKING'`: 卖家已创建货件,但尚未发货
831
+ - `'READY_TO_SHIP'`: 卖家完成货件穿件, 可以发货
832
+ - `'SHIPPED'`: 承运人已取件
833
+ - `'RECEIVING'`: 货件已到达亚马逊配送中心,但有部分商品尚未标记为已收到
834
+ - `'CLOSED'`: 货件已到达亚马逊配送中心,且所有商品已标记为已收到
835
+ - `'CANCELLED'`: 卖家在将货件发送至亚马逊配送中心后取消了货件
836
+ - `'DELETED'`: 卖家在将货件发送至亚马逊配送中心前取消了货件
837
+
838
+ :param offset `<'int'>`: 分页偏移量, 默认 `None` (使用: 0)
839
+ :param length `<'int'>`: 分页长度, 默认 `None` (使用: 1000)
840
+ :returns `<'Shipments'>`: 返回查询FBA货件数据
841
+ ```python
842
+ {
843
+ # 状态码
844
+ "code": 0,
845
+ # 提示信息
846
+ "message": "success",
847
+ # 错误信息
848
+ "errors": [],
849
+ # 请求ID
850
+ "request_id": "44DAC5AE-7D76-9054-2431-0EF7E357CFE5",
851
+ # 响应时间
852
+ "response_time": "2025-08-13 19:23:04",
853
+ # 响应数据量
854
+ "response_count": 2,
855
+ # 总数据量
856
+ "total_count": 2,
857
+ # 响应数据
858
+ "data": "data": [
859
+ {
860
+ # 唯一键 (货件记录ID)
861
+ "id": 4*****,
862
+ # 领星店铺ID
863
+ "sid": 1,
864
+ # 领星店铺名称 [原字段 'seller']
865
+ "seller_name": "US-Store",
866
+ # FBA货件ID
867
+ "shipment_id": "FBA*********",
868
+ # FBA货件名称
869
+ "shipment_name": "SMF3",
870
+ # 货件状态
871
+ # 'WORKING': 卖家已创建货件,但尚未发货
872
+ # 'READY_TO_SHIP': 卖家完成货件穿件, 可以发货
873
+ # 'SHIPPED': 承运人已取件
874
+ # 'IN_TRANSIT': 承运人已通知亚马逊配送中心,知晓货件的存在
875
+ # 'DELIVERED': 承运人已将货件配送至亚马逊配送中心
876
+ # 'CHECK_IN': 货件已在亚马逊配送中心
877
+ # 'RECEIVING': 货件已到达亚马逊配送中心,但有部分商品尚未标记为已收到
878
+ # 'CLOSED': 货件已到达亚马逊配送中心,且所有商品已标记为已收到
879
+ # 'CANCELLED': 卖家在将货件发送至亚马逊配送中心后取消了货件
880
+ # 'DELETED': 卖家在将货件发送至亚马逊配送中心前取消了货件
881
+ # 'ERROR': 货件出错,但其并非亚马逊处理
882
+ "shipment_status": "READY_TO_SHIP",
883
+ # 货件事否已完成 [原字段 'is_closed']
884
+ # 有绑定, 按签发差异判断: 1. 发货量>签收量='进行中'; 2. 发货量<=签收量='已完成'
885
+ # 无绑定, 用货件状态判断: DELETED, CANCELED, CLOSED为已完成, 其他为进行中
886
+ # 额外情况: 当货件状态进入CLOSED, CANCELLED, DELETED 之后90天, 自动变为'已完成'
887
+ "shipment_closed": 0,
888
+ # 承运方式名称 [原字段 'alpha_name']
889
+ "transport_name": "Other",
890
+ # 承运方式编码 [原字段 'alpha_code']
891
+ "transport_code": "",
892
+ # 运输类型
893
+ "shipping_mode": "GROUND_SMALL_PARCEL",
894
+ # 运输解决方案
895
+ "shipping_solution": "USE_YOUR_OWN_CARRIER",
896
+ # 是否同步亚马逊后台 [原字段 'is_synchronous']
897
+ "is_synchronized": 1,
898
+ # 是否上传包装箱信息 [原字段 'is_uploaded_box']
899
+ "is_box_info_uploaded": 1,
900
+ # 货件创建人ID [原字段 'uid']
901
+ "creator_id": 0,
902
+ # 货件创建人名称 [原字段 'username']
903
+ "creator_name": "",
904
+ # 货件数据创建时间 [原字段 'gmt_create']
905
+ "create_time": "2025-08-14 13:04",
906
+ # 货件数据更新时间 [原字段 'gmt_modified']
907
+ "update_time": "2025-08-15 12:59",
908
+ # 货件数据同步时间
909
+ "sync_time": "2025-08-14 14:07",
910
+ # 货件创建时间
911
+ "working_time": "2025-08-14 13:04",
912
+ # 承运人已取件时间
913
+ "shipped_time": "",
914
+ # 货件到达亚马逊配送中心后, 开始接收时间
915
+ "receiving_time": "",
916
+ # 货件到达亚马逊配送中心后, 完成接收时间
917
+ "closed_time": "",
918
+ # 是否为STA货件 (0: 否, 1: 是)
919
+ "is_sta": 1,
920
+ # STA计划名称
921
+ "sta_plan_name": "",
922
+ # STA计划ID
923
+ "sta_inbound_plan_id": "wfea99b20e-****-****-****-************",
924
+ # STA货件ID
925
+ "sta_shipment_id": "shc0ba9022-****-****-****-************",
926
+ # STA发货日期 [原字段 'sta_shipment_date']
927
+ "sta_shipping_date": "2025-08-18",
928
+ # STA送达开始时间
929
+ "sta_delivery_start_date": "2025-08-18",
930
+ # STA送达结束时间
931
+ "sta_delivery_end_date": "2025-08-31",
932
+ # 提货单号 (BOL)
933
+ "bill_of_lading_number": "",
934
+ # 跟踪编号 (PRO) [原字段 'freight_bill_number']
935
+ "freight_pro_number": "",
936
+ # 亚马逊关联编码 [原字段 'reference_id']
937
+ "amazon_reference_id": "3FB*****",
938
+ # 亚马逊配送中心编码 [原字段 'destination_fulfillment_center_id']
939
+ "fulfillment_center_id": "SMF3",
940
+ # 发货地址
941
+ "ship_from_address": {
942
+ # 国家代码
943
+ "country_code": "CN",
944
+ # 州或省 [原字段 'state_or_province_code']
945
+ "state": "Guangdong",
946
+ # 城市
947
+ "city": "Shenzhen",
948
+ # 地址区域 [原字段 'region']
949
+ "district": "Huaqiang North",
950
+ # 地址行1
951
+ "address_line1": "Fuyong",
952
+ # 地址行2
953
+ "address_line2": "",
954
+ # 地址名称 [原字段 'name']
955
+ "address_name": "JBL",
956
+ # 邮政编码 [原字段 'postal_code']
957
+ "postcode": "518000",
958
+ # 门牌号 [原字段 'doorplate']
959
+ "door_plate": "",
960
+ # 电话号码
961
+ "phone": "",
962
+ },
963
+ # 收货地址
964
+ "ship_to_address": {
965
+ # 国家代码
966
+ "country_code": "US",
967
+ # 州或省代码 [原字段 'state_or_province_code']
968
+ "state": "CA",
969
+ # 城市
970
+ "city": "Stockton",
971
+ # 地址区域 [原字段 'region']
972
+ "address_region": "",
973
+ # 地址行1
974
+ "address_line1": "3923 S B ST",
975
+ # 地址行2
976
+ "address_line2": "",
977
+ # 地址名称 [原字段 'name']
978
+ "address_name": "JBL",
979
+ # 邮政编码 [原字段 'postal_code']
980
+ "postcode": "95206-8202",
981
+ # 门牌号 [原字段 'doorplate']
982
+ "door_plate": "",
983
+ # 电话号码
984
+ "phone": "",
985
+ },
986
+ # 追踪号码列表 [原字段 'tracking_number_list']
987
+ "tracking_numbers": [
988
+ {
989
+ # 包裹ID
990
+ "box_id": "FBA19**************",
991
+ # 追踪号码
992
+ "tracking_number": ""
993
+ },
994
+ ...
995
+ ],
996
+ # 货件商品列表 [原字段 'item_list']
997
+ "items": [
998
+ {
999
+ # 唯一键
1000
+ "id": 2******,
1001
+ # 亚马逊SKU
1002
+ "msku": "SKU********",
1003
+ # 领星本地SKU [原字段 'sku']
1004
+ "lsku": "LOCAL********",
1005
+ # 亚马逊FNSKU
1006
+ "fnsku": "X00*******",
1007
+ # 预处理说明
1008
+ "prep_instruction": "Labeling",
1009
+ # 预处理方
1010
+ "prep_owner": "SELLER",
1011
+ # 预处理明细
1012
+ "prep_details": "",
1013
+ # 标签处理方 [原字段 'prep_labelowner']
1014
+ "label_owner": "SELLER",
1015
+ # 有效日期 [原字段 'expiration']
1016
+ "expiration_date": "",
1017
+ # 生产日期
1018
+ "release_date": "",
1019
+ # 初始货件申报数量 [原字段 'init_quantity_shipped']
1020
+ "init_item_qty": 100,
1021
+ # 当前货件申报数量 [原字段 'quantity_shipped']
1022
+ "curr_item_qty": 100,
1023
+ # 箱内商品数量 [原字段 'quantity_in_case']
1024
+ "box_item_qty": 0,
1025
+ # 已发货数量 [原字段 'quantity_shipped_local']
1026
+ "shipped_qty": 0,
1027
+ # 亚马逊配送中心已接收的商品数量 [原字段 'quantity_received']
1028
+ "received_qty": 0,
1029
+ # 库存明细ID [原字段 'ware_house_storage_id']
1030
+ "warehouse_storage_id": 0,
1031
+ # 发货计划单号列表 [原字段 'shipment_plan_list']
1032
+ "shipment_plan_numbers": [],
1033
+ },
1034
+ ...
1035
+ ],
1036
+ },
1037
+ ...
1038
+ ],
1039
+ }
1040
+ ```
1041
+ """
1042
+ url = route.SHIPMENTS
1043
+ # 解析并验证参数
1044
+ args = {
1045
+ "sids": sids,
1046
+ "start_date": start_date,
1047
+ "end_date": end_date,
1048
+ "sub_start_date": sub_start_date,
1049
+ "sub_end_date": sub_end_date,
1050
+ "sub_date_type": sub_date_type,
1051
+ "shipment_ids": shipment_ids,
1052
+ "shipment_statuses": shipment_statuses,
1053
+ "offset": offset,
1054
+ "length": length,
1055
+ }
1056
+ try:
1057
+ p = param.Shipments.model_validate(args)
1058
+ except Exception as err:
1059
+ raise errors.InvalidParametersError(err, url, args) from err
1060
+
1061
+ # 发送请求
1062
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
1063
+ return schema.Shipments.model_validate(data)
1064
+
1065
+ async def ShipmentDetails(
1066
+ self,
1067
+ sid: int,
1068
+ inbound_plan_id: str,
1069
+ shipment_ids: str | list[str],
1070
+ ) -> schema.ShipmentDetails:
1071
+ """查询STA货件详情
1072
+
1073
+ ## Docs
1074
+ - FBA - FBA货件(STA): [查询货件详情](https://apidoc.lingxing.com/#/docs/FBA/ShipmentDetailList)
1075
+
1076
+ :param sid `<'int'>`: 领星店铺ID
1077
+ :param inbound_plan_id `<'str'>`: STA计划ID, 参数来源: `Shipment.sta_inbound_plan_id`
1078
+ :param shipment_ids `<'str/list[str]'>`: 货件ID或ID列表, 参数来源: `Shipment.sta_shipment_id`
1079
+ :returns `<'ShipmentDetails'>`: 返回查询STA货件详情的结果
1080
+ ```python
1081
+ {
1082
+ # 状态码
1083
+ "code": 0,
1084
+ # 提示信息
1085
+ "message": "操作成功",
1086
+ # 错误信息
1087
+ "errors": [],
1088
+ # 请求ID
1089
+ "request_id": "f9e5e291e14c4180a3cf1405b4d24b99.191.17554878107185127",
1090
+ # 响应时间
1091
+ "response_time": "2025-08-18T11:30:10.826",
1092
+ # 响应数据量
1093
+ "response_count": 2,
1094
+ # 总数据量
1095
+ "total_count": 2,
1096
+ # 响应数据
1097
+ "data": [
1098
+ {
1099
+ # 领星店铺ID
1100
+ "sid": 1,
1101
+ # 货件ID [原字段 'shipmentId']
1102
+ "shipment_id": "sh5d4c8859-****-****-****-************",
1103
+ # 货件名称 [原字段 'shipmentName']
1104
+ "shipment_name": "产品-2箱-CLT2",
1105
+ # 货件确认ID [原字段 'shipmentConfirmationId']
1106
+ "shipment_confirmation_id": "FBA1********",
1107
+ # 货件状态 [原字段 'status']
1108
+ "shipment_status": "READY_TO_SHIP",
1109
+ # 承运方式编码 [原字段 'alphaCode']
1110
+ "transport_code": "",
1111
+ # 运输类型 [原字段 'shippingMode']
1112
+ "shipping_mode": "GROUND_SMALL_PARCEL",
1113
+ # 运输解决方案 [原字段 'shippingSolution']
1114
+ "shipping_solution": "USE_YOUR_OWN_CARRIER",
1115
+ # STA发货日期 [原字段 'shipingTime']
1116
+ "shipping_date": "2025-08-18",
1117
+ # STA送达开始时间 [原字段 'startDate']
1118
+ "delivery_start_date": "2025-08-18",
1119
+ # STA送达结束时间 [原字段 'endDate']
1120
+ "delivery_end_date": "2025-08-31",
1121
+ # 提货单号 (BOL) [原字段 'pickUpId']
1122
+ "bill_of_lading_number": "",
1123
+ # 亚马逊关联编码 [原字段 'amazonReferenceId']
1124
+ "amazon_reference_id": "31A*****",
1125
+ # 亚马逊配送中心编码 [原字段 'warehouseId']
1126
+ "fulfillment_center_id": "CLT2",
1127
+ # 入库区域 (中文) [原字段 'inboundRegion']
1128
+ "inbound_region": "东部",
1129
+ # 发货地址 [原字段 'shippingAddress']
1130
+ "ship_from_address": {
1131
+ # 国家代码 [原字段: 'countryCode']
1132
+ "country_code": "CN",
1133
+ # 国家
1134
+ "country": "中国",
1135
+ # 州或省代码 [原字段 'stateOrProvinceCode']
1136
+ "state": "Guangdong",
1137
+ # 城市
1138
+ "city": "Shenzhen",
1139
+ # 地址行1 [原字段 'addressLine1']
1140
+ "address_line1": "Fuyong",
1141
+ # 地址行2 [原字段 'addressLine2']
1142
+ "address_line2": "",
1143
+ # 地址名称 [原字段 'addressName']
1144
+ "address_name": "JBL",
1145
+ # 邮政编码 [原字段 'postalCode']
1146
+ "postcode": "518000",
1147
+ # 电子邮箱
1148
+ "email": "",
1149
+ # 电话号码 [原字段 'phoneNumber']
1150
+ "phone": "",
1151
+ },
1152
+ # 收货地址 [原字段 'sendAddress']
1153
+ "ship_to_address": {
1154
+ # 国家代码 [原字段: 'countryCode']
1155
+ "country_code": "US",
1156
+ # 国家
1157
+ "country": "美国",
1158
+ # 州或省代码 [原字段 'stateOrProvinceCode']
1159
+ "state": "NC",
1160
+ # 城市
1161
+ "city": "Charlotte",
1162
+ # 地址行1 [原字段 'addressLine1']
1163
+ "address_line1": "10240 Old Dowd Rd",
1164
+ # 地址行2 [原字段 'addressLine2']
1165
+ "address_line2": "",
1166
+ # 地址名称 [原字段 'addressName']
1167
+ "address_name": "Amazon.com Services, Inc.",
1168
+ # 邮政编码 [原字段 'postalCode']
1169
+ "postcode": "28214-8082",
1170
+ # 电子邮箱
1171
+ "email": "",
1172
+ # 电话号码 [原字段 'phoneNumber']
1173
+ "phone": "",
1174
+ },
1175
+ # 追踪号码 [原字段 'trackingNumber']
1176
+ "tracking_number": "",
1177
+ # 追踪号码列表 [原字段 'trackingNumberList']
1178
+ "tracking_numbers": [
1179
+ {
1180
+ # 包裹ID [原字段 'boxId']
1181
+ "box_id": "FBA1905423KBU000002",
1182
+ # 追踪号码 [原字段 'trackingNumber']
1183
+ "tracking_number": ""
1184
+ },
1185
+ ],
1186
+ # 货件商品数量 [原字段 'itemCount']
1187
+ "item_count": 2,
1188
+ # 货件商品列表 [原字段 'itemList']
1189
+ "items": [
1190
+ {
1191
+ # 亚马逊ASIN
1192
+ "asin": "B0D*******",
1193
+ # 父ASIN [原字段 'parent_asin']
1194
+ "parent_asin": "B0D*******",
1195
+ # 亚马逊SKU
1196
+ "msku": "SKU********",
1197
+ # 领星本地SKU [原字段 'sku']
1198
+ "lsku": "LOCAL********",
1199
+ # 亚马逊FNSKU
1200
+ "fnsku": "X00*******",
1201
+ # 领星本地商品名称 [原字段 'productName']
1202
+ "product_name": "P********",
1203
+ # 商品标题
1204
+ "title": "Product Title",
1205
+ # 商品略缩图
1206
+ "thumbnail_url": "https://m.media-amazon.com/****.jpg",
1207
+ # 预处理方 [原字段 'prepOwner']
1208
+ "prep_owner": "SELLER",
1209
+ # 标签处理方 [原字段 'labelOwner']
1210
+ "label_owner": "SELLER",
1211
+ # 有效日期 [原字段 'expiration']
1212
+ "expiration_date": "",
1213
+ # 货件申报数量 [原字段 'quantity']
1214
+ "item_qty": 500,
1215
+ },
1216
+ ...
1217
+ ],
1218
+ },
1219
+ ...
1220
+ ],
1221
+ }
1222
+ ```
1223
+ """
1224
+ url = route.SHIPMENT_DETAILS
1225
+ # 解析并验证参数
1226
+ args = {
1227
+ "sid": sid,
1228
+ "inbound_plan_id": inbound_plan_id,
1229
+ "shipment_ids": shipment_ids,
1230
+ }
1231
+ try:
1232
+ p = param.ShipmentDetails.model_validate(args)
1233
+ except Exception as err:
1234
+ raise errors.InvalidParametersError(err, url, args) from err
1235
+
1236
+ # 发送请求
1237
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
1238
+ return schema.ShipmentDetails.model_validate(data)
1239
+
1240
+ async def ShipmentBoxes(
1241
+ self,
1242
+ sid: int,
1243
+ inbound_plan_id: str,
1244
+ shipment_ids: str | list[str],
1245
+ ) -> schema.ShipmentBoxes:
1246
+ """查询货件装箱信息
1247
+
1248
+ ## Docs
1249
+ - FBA - FBA货件(STA): [查询货件装箱信息](https://apidoc.lingxing.com/#/docs/FBA/ListShipmentBoxes)
1250
+
1251
+ :param sid `<'int'>`: 领星店铺ID
1252
+ :param inbound_plan_id `<'str'>`: STA计划ID, 参数来源: `StaPlan.inbound_plan_id`
1253
+ :param shipment_ids `<'str/list[str]'>`: 货件ID或ID列表, 参数来源: `Shipment.sta_shipment_id`
1254
+ :returns `<'ShipmentBoxes'>`: 返回查询货件装箱信息的结果
1255
+ ```python
1256
+ {
1257
+ # 状态码
1258
+ "code": 0,
1259
+ # 提示信息
1260
+ "message": "操作成功",
1261
+ # 错误信息
1262
+ "errors": [],
1263
+ # 请求ID
1264
+ "request_id": "f9e5e291e14c4180a3cf1405b4d24b99.191.17554878107185127",
1265
+ # 响应时间
1266
+ "response_time": "2025-08-18T11:30:10.826",
1267
+ # 响应数据量
1268
+ "response_count": 2,
1269
+ # 总数据量
1270
+ "total_count": 2,
1271
+ # 响应数据
1272
+ "data": [
1273
+ {
1274
+ # 货件ID [原字段 'shipmentId']
1275
+ "shipment_id": "sha51eae2f-****-****-****-************",
1276
+ # 装箱列表 [原字段 'shipmentPackingList']
1277
+ "boxes": [
1278
+ {
1279
+ # 包裹ID [原字段 'packageId']
1280
+ "package_id": "pkd0ab9bcc-****-****-****-************",
1281
+ # 箱子序列 [原字段 'localBoxId']
1282
+ "box_seq": 1,
1283
+ # 亚马逊箱子ID [原字段 'boxId']
1284
+ "box_id": "FBA18**************
1285
+ # 箱子名称 [原字段 'boxName']
1286
+ "box_name": "P1 - B1",
1287
+ # 箱子产品总数量 [原字段 'total']
1288
+ "box_item_qty": 40,
1289
+ # 箱子重量
1290
+ "weight": 22.0,
1291
+ # 重量单位 [原字段 'weightUnit']
1292
+ "weight_unit": "LB",
1293
+ # 箱子长度
1294
+ "length": 16.0,
1295
+ # 箱子宽度
1296
+ "width": 10.0,
1297
+ # 箱子高度
1298
+ "height": 18.0,
1299
+ # 箱子尺寸单位 [原字段 'lengthUnit']
1300
+ "dimension_unit": "IN",
1301
+ # 商品列表 [原字段 'productList']
1302
+ "items": [
1303
+ {
1304
+ # 亚马逊ASIN
1305
+ "asin": "B0D*******",
1306
+ # 父ASIN [原字段 'parent_asin']
1307
+ "parent_asin": "B0D*******",
1308
+ # 亚马逊SKU
1309
+ "msku": "SKU********",
1310
+ # 领星本地SKU [原字段 'sku']
1311
+ "lsku": "LOCAL********",
1312
+ # 亚马逊FNSKU
1313
+ "fnsku": "X00*******",
1314
+ # 领星本地商品名称 [原字段 'productName']
1315
+ "product_name": "P********",
1316
+ # 商品标题
1317
+ "title": "Product Title",
1318
+ # 商品略缩图
1319
+ "thumbnail_url": "https://m.media-amazon.com/****.jpg",
1320
+ # 预处理方 [原字段 'prepOwner']
1321
+ "prep_owner": "SELLER",
1322
+ # 标签处理方 [原字段 'labelOwner']
1323
+ "label_owner": "SELLER",
1324
+ # 有效日期 [原字段 'expiration']
1325
+ "expiration_date": "",
1326
+ # 箱子商品数量 [原字段 'quantityInBox']
1327
+ "item_qty": 40,
1328
+ },
1329
+ ...
1330
+ ],
1331
+ },
1332
+ ...
1333
+ ],
1334
+ # 装箱托盘列表 [原字段 'palletList']
1335
+ "pallets": [
1336
+ {
1337
+ # 托盘重量
1338
+ "weight": 220.0,
1339
+ # 重量单位 [原字段 'weightUnit']
1340
+ "weight_unit": "LB",
1341
+ # 托盘长度
1342
+ "length": 160.0,
1343
+ # 托盘宽度
1344
+ "width": 100.0,
1345
+ # 托盘高度
1346
+ "height": 180.0,
1347
+ # 托盘尺寸单位 [原字段 'lengthUnit']
1348
+ "dimension_unit": "IN",
1349
+ # 托盘数量 [原字段 'quantity']
1350
+ "pallet_qty": 1,
1351
+ # 堆叠方式
1352
+ "stackability": "STACKABLE",
1353
+ },
1354
+ ...
1355
+ ],
1356
+ },
1357
+ ...
1358
+ ],
1359
+ }
1360
+ ```
1361
+ """
1362
+ url = route.SHIPMENT_BOXES
1363
+ # 解析并验证参数
1364
+ args = {
1365
+ "sid": sid,
1366
+ "inbound_plan_id": inbound_plan_id,
1367
+ "shipment_ids": shipment_ids,
1368
+ }
1369
+ try:
1370
+ p = param.ShipmentBoxes.model_validate(args)
1371
+ except Exception as err:
1372
+ raise errors.InvalidParametersError(err, url, args) from err
1373
+
1374
+ # 发送请求
1375
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
1376
+ return schema.ShipmentBoxes.model_validate(data)
1377
+
1378
+ async def ShipmentTransports(
1379
+ self,
1380
+ sid: int,
1381
+ inbound_plan_id: str,
1382
+ shipment_id: str,
1383
+ ) -> schema.ShipmentTransports:
1384
+ """查询货件承运方式
1385
+
1386
+ ## Docs
1387
+ - FBA - FBA货件(STA): [查询承运方式](https://apidoc.lingxing.com/#/docs/FBA/GetTransportList)
1388
+
1389
+ :param sid `<'int'>`: 领星店铺ID
1390
+ :param inbound_plan_id `<'str'>`: STA计划ID, 参数来源: `StaPlan.inbound_plan_id`
1391
+ :param shipment_id `<'str'>`: 货件ID, 参数来源: `Shipment.sta_shipment_id`
1392
+ :returns `<'ShipmentTransports'>`: 返回查询货件承运方式的结果
1393
+ ```python
1394
+ {
1395
+ # 状态码
1396
+ "code": 0,
1397
+ # 提示信息
1398
+ "message": "操作成功",
1399
+ # 错误信息
1400
+ "errors": [],
1401
+ # 请求ID
1402
+ "request_id": "f9e5e291e14c4180a3cf1405b4d24b99.191.17554878107185127",
1403
+ # 响应时间
1404
+ "response_time": "2025-08-18T11:30:10.826",
1405
+ # 响应数据量
1406
+ "response_count": 2,
1407
+ # 总数据量
1408
+ "total_count": 2,
1409
+ # 响应数据
1410
+ "data": [
1411
+ {
1412
+ # 承运选项ID [原字段 'transportationOptionId']
1413
+ "transport_option_id": "to3ea8cf93-****-****-****-************",
1414
+ # 承运方式名称 [原字段 'alphaName']
1415
+ "transport_name": "UPS",
1416
+ # 承运方式编码 [原字段 'alphaCode']
1417
+ "transport_code": "UPSN",
1418
+ # 运输类型 [原字段 'shippingMode']
1419
+ "shipping_mode": "GROUND_SMALL_PARCEL",
1420
+ # 运输解决方案 [原字段 'shippingSolution']
1421
+ "shipping_solution": "AMAZON_PARTNERED_CARRIER",
1422
+ # 运输费用 [原字段 'carrierFee']
1423
+ "shipping_fee": 0.0,
1424
+ },
1425
+ ...
1426
+ ],
1427
+ }
1428
+ ```
1429
+ """
1430
+ url = route.SHIPMENT_TRANSPORTS
1431
+ # 解析并验证参数
1432
+ args = {
1433
+ "sid": sid,
1434
+ "inbound_plan_id": inbound_plan_id,
1435
+ "shipment_id": shipment_id,
1436
+ }
1437
+ try:
1438
+ p = param.ShipmentTransports.model_validate(args)
1439
+ except Exception as err:
1440
+ raise errors.InvalidParametersError(err, url, args) from err
1441
+
1442
+ # 发送请求
1443
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
1444
+ return schema.ShipmentTransports.model_validate(data)
1445
+
1446
+ async def ShipmentReceiptRecords(
1447
+ self,
1448
+ sid: int,
1449
+ date: str | datetime.date | datetime.datetime,
1450
+ *,
1451
+ shipment_ids: str | list[str] | None = None,
1452
+ offset: int | None = None,
1453
+ length: int | None = None,
1454
+ ) -> schema.ShipmentReceiptRecords:
1455
+ """查询货件货接收明细
1456
+
1457
+ ## Docs
1458
+ - FBA - FBA货件(STA): [查询FBA到货接收明细](https://apidoc.lingxing.com/#/docs/FBA/FBAReceivedInventory)
1459
+
1460
+ :param sid `<'int'>`: 领星店铺ID
1461
+ :param date `<'str/date/datetime'>`: 货件接收日期
1462
+ :param shipment_ids `<'str/list[str]'>`: 货件ID或ID列表, 默认 `None` (不筛选)
1463
+ :param offset `<'int'>`: 分页偏移量, 默认 `None` (使用: 0)
1464
+ :param length `<'int'>`: 分页长度, 默认 `None` (使用: 1000)
1465
+ :returns `<'ShipmentReceiptRecords'>`: 返回查询货件接收明细的结果
1466
+ ```python
1467
+ {
1468
+ # 状态码
1469
+ "code": 0,
1470
+ # 提示信息
1471
+ "message": "操作成功",
1472
+ # 错误信息
1473
+ "errors": [],
1474
+ # 请求ID
1475
+ "request_id": "f9e5e291e14c4180a3cf1405b4d24b99.191.17554878107185127",
1476
+ # 响应时间
1477
+ "response_time": "2025-08-20 11:00:54",
1478
+ # 响应数据量
1479
+ "response_count": 2,
1480
+ # 总数据量
1481
+ "total_count": 2,
1482
+ # 响应数据
1483
+ "data": [
1484
+ {
1485
+ # 唯一md5索引
1486
+ "uid_md5": "7665b697************************",
1487
+ # 领星店铺ID
1488
+ "sid": 9968,
1489
+ # 亚马逊SKU [原字段 'sku']
1490
+ "msku": "AC-618-305XL 1B1C-EU-X",
1491
+ # 亚马逊FNSKU
1492
+ "fnsku": "X0027O96FF",
1493
+ # 商品标题 [原字段 'product_name']
1494
+ "title": "Product Title",
1495
+ # 货件ID [原字段 'fba_shipment_id']
1496
+ "shipment_id": "FBA15KGYN4HK",
1497
+ # 亚马逊配送中心编码
1498
+ "fulfillment_center_id": "CDG7",
1499
+ # 亚马逊配送中心国家代码 [原字段 'country']
1500
+ "country_code": "FR",
1501
+ # 货件接收数量 [原字段 'quantity']
1502
+ "received_qty": -2,
1503
+ # 货件接收日期 [原字段 'received_date_report']
1504
+ "received_date": "2025-07-21",
1505
+ # 货件接收时间 (UTC) [原字段 'received_date']
1506
+ "received_time_utc": "2025-07-21T00:00:00+00:00",
1507
+ # 货件接收时间 (时间戳) [原字段 'received_date_timestamp']
1508
+ "received_time_ts": 1753027200,
1509
+ },
1510
+ ...
1511
+ ],
1512
+ }
1513
+ ```
1514
+ """
1515
+ url = route.SHIPMENT_RECEIPT_RECORDS
1516
+ # 解析并验证参数
1517
+ args = {
1518
+ "sid": sid,
1519
+ "date": date,
1520
+ "shipment_ids": shipment_ids,
1521
+ "offset": offset,
1522
+ "length": length,
1523
+ }
1524
+ try:
1525
+ p = param.ShipmentReceiptRecords.model_validate(args)
1526
+ except Exception as err:
1527
+ raise errors.InvalidParametersError(err, url, args) from err
1528
+
1529
+ # 发送请求
1530
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
1531
+ return schema.ShipmentReceiptRecords.model_validate(data)
1532
+
1533
+ async def ShipmentDeliveryAddress(
1534
+ self,
1535
+ id: int,
1536
+ ) -> schema.ShipmentDeliveryAddressData:
1537
+ """查询FBA货件收货地址
1538
+
1539
+ ## Docs
1540
+ - FBA - FBA货件(STA): [地址簿-配送地址详情](https://apidoc.lingxing.com/#/docs/FBA/ShoppingAddress)
1541
+
1542
+ :param id `<'int'>`: 货件唯一记录ID, 参数来源: `Shipment.id`
1543
+ :returns `<'ShipToAddress'>`: 返回查询货件收货地址的结果
1544
+ ```python
1545
+ {
1546
+ # 状态码
1547
+ "code": 0,
1548
+ # 提示信息
1549
+ "message": "操作成功",
1550
+ # 错误信息
1551
+ "errors": [],
1552
+ # 请求ID
1553
+ "request_id": "f9e5e291e14c4180a3cf1405b4d24b99.191.17554878107185127",
1554
+ # 响应时间
1555
+ "response_time": "2025-08-20 11:00:54",
1556
+ # 响应数据量
1557
+ "response_count": 2,
1558
+ # 总数据量
1559
+ "total_count": 2,
1560
+ # 响应数据
1561
+ "data": {
1562
+ # 国家名称 [原字段 'ship_to_country']
1563
+ "country": "United States of America (USA)",
1564
+ # 州或省 [原字段 'ship_to_province_code']
1565
+ "state": "TN",
1566
+ # 城市 [原字段 'ship_to_city']
1567
+ "city": "Memphis",
1568
+ # 地址行 [原字段 'ship_to_address']
1569
+ "address": "3292 E Holmes Rd",
1570
+ # 邮政编码 [原字段 'ship_to_postal_code']
1571
+ "postcode": "38118-8102",
1572
+ # 收货人名称 [原字段 'ship_to_name']
1573
+ "receiver_name": "MEM1",
1574
+ },
1575
+ }
1576
+ ```
1577
+ """
1578
+ url = route.SHIPMENT_DELIVERY_ADDRESS
1579
+ # 解析并验证参数
1580
+ args = {"id": id}
1581
+ try:
1582
+ p = param.ShipmentDeliveryAddress.model_validate(args)
1583
+ except Exception as err:
1584
+ raise errors.InvalidParametersError(err, url, args) from err
1585
+
1586
+ # 发送请求
1587
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
1588
+ return schema.ShipmentDeliveryAddressData.model_validate(data)
1589
+
1590
+ async def ShipFromAddresses(
1591
+ self,
1592
+ *,
1593
+ sids: int | list[int] | None = None,
1594
+ search_field: ADDRESS_SEARCH_FIELD | None = None,
1595
+ search_value: str | None = None,
1596
+ offset: int | None = None,
1597
+ length: int | None = None,
1598
+ ) -> schema.ShipFromAddresses:
1599
+ """查询发货地址
1600
+
1601
+ ## Docs
1602
+ - FBA - FBA货件(STA): [地址簿-发货地址列表](https://apidoc.lingxing.com/#/docs/FBA/ShipFromAddressList)
1603
+
1604
+ :param sids `<'int/list/None'>`: 领星店铺ID或ID列表, 默认 `None` (不筛选)
1605
+ :param search_field `<'str/None'>`: 搜索字段, 默认 `None` (不筛选), 可选值:
1606
+
1607
+ - `'alias_name'`: 地址别名
1608
+ - `'sender_name'`: 发货人名称
1609
+
1610
+ :param search_value `<'str/None'>`: 搜索值, 模糊搜索, 默认 `None` (不筛选)
1611
+ :param offset `<'int/None'>`: 分页偏移量, 默认 `None` (使用: 0)
1612
+ :param length `<'int/None'>`: 分页长度, 默认 `None` (使用: 20)
1613
+ :returns `<'ShipFromAddresses'>`: 返回查询发货地址的结果
1614
+ ```python
1615
+ {
1616
+ # 状态码
1617
+ "code": 0,
1618
+ # 提示信息
1619
+ "message": "操作成功",
1620
+ # 错误信息
1621
+ "errors": [],
1622
+ # 请求ID
1623
+ "request_id": "f9e5e291e14c4180a3cf1405b4d24b99.191.17554878107185127",
1624
+ # 响应时间
1625
+ "response_time": "2025-08-20 11:00:54",
1626
+ # 响应数据量
1627
+ "response_count": 2,
1628
+ # 总数据量
1629
+ "total_count": 2,
1630
+ # 响应数据
1631
+ "data": [
1632
+ {
1633
+ # 领星店铺ID
1634
+ "sid": 1,
1635
+ # 领星店铺名称
1636
+ "seller_name": "UK-Store",
1637
+ # 店铺国家名称 [原字段 'seller_country_name']
1638
+ "seller_country": "英国",
1639
+ # 地址ID [原字段 'id' | 唯一键]
1640
+ "address_id": 1***,
1641
+ # 地址别名 [原字段 'alias_name']
1642
+ "address_alias": "测试发货地址",
1643
+ # 国家代码
1644
+ "country_code": "CN",
1645
+ # 国家名称 [原字段 'country_name']
1646
+ "country": "中国 内地",
1647
+ # 州或省 [原字段 'province']
1648
+ "state": "广东省",
1649
+ # 城市
1650
+ "city": "深圳市",
1651
+ # 区域 [原字段 'region']
1652
+ "district": "福田区",
1653
+ # 地址行1 [原字段 'street_detail1']
1654
+ "address_line1": "",
1655
+ # 地址行2 [原字段 'street_detail2']
1656
+ "address_line2": "",
1657
+ # 邮政编码 [原字段 'zip_code']
1658
+ "postcode": "518000",
1659
+ # 发件人名称 [原字段 'sender_name']
1660
+ "shipper_name": "测试",
1661
+ # 公司名称 [原字段 'company_name']
1662
+ "company_name": "测试",
1663
+ # 电话号码 [原字段 'phone']
1664
+ "phone": "1234567890",
1665
+ # 电子邮箱 [原字段 'email']
1666
+ "email": "test@gmail.com",
1667
+ # 是否为默认地址 [原字段 'is_default']
1668
+ "is_default": 0,
1669
+ },
1670
+ ...
1671
+ ],
1672
+ }
1673
+ ```
1674
+ """
1675
+ url = route.SHIP_FROM_ADDRESSES
1676
+ # 解析并验证参数
1677
+ args = {
1678
+ "sids": sids,
1679
+ "search_field": search_field,
1680
+ "search_value": search_value,
1681
+ "offset": offset,
1682
+ "length": length,
1683
+ }
1684
+ try:
1685
+ p = param.ShipFromAddresses.model_validate(args)
1686
+ except Exception as err:
1687
+ raise errors.InvalidParametersError(err, url, args) from err
1688
+
1689
+ # 发送请求
1690
+ data = await self._request_with_sign("POST", url, body=p.model_dump_params())
1691
+ return schema.ShipFromAddresses.model_validate(data)