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.
- lingxingapi/__init__.py +7 -0
- lingxingapi/ads/__init__.py +0 -0
- lingxingapi/ads/api.py +5946 -0
- lingxingapi/ads/param.py +192 -0
- lingxingapi/ads/route.py +134 -0
- lingxingapi/ads/schema.py +2615 -0
- lingxingapi/api.py +443 -0
- lingxingapi/base/__init__.py +0 -0
- lingxingapi/base/api.py +409 -0
- lingxingapi/base/param.py +59 -0
- lingxingapi/base/route.py +11 -0
- lingxingapi/base/schema.py +198 -0
- lingxingapi/basic/__init__.py +0 -0
- lingxingapi/basic/api.py +466 -0
- lingxingapi/basic/param.py +72 -0
- lingxingapi/basic/route.py +20 -0
- lingxingapi/basic/schema.py +212 -0
- lingxingapi/errors.py +143 -0
- lingxingapi/fba/__init__.py +0 -0
- lingxingapi/fba/api.py +1691 -0
- lingxingapi/fba/param.py +250 -0
- lingxingapi/fba/route.py +30 -0
- lingxingapi/fba/schema.py +987 -0
- lingxingapi/fields.py +50 -0
- lingxingapi/finance/__init__.py +0 -0
- lingxingapi/finance/api.py +3091 -0
- lingxingapi/finance/param.py +616 -0
- lingxingapi/finance/route.py +44 -0
- lingxingapi/finance/schema.py +1243 -0
- lingxingapi/product/__init__.py +0 -0
- lingxingapi/product/api.py +2643 -0
- lingxingapi/product/param.py +934 -0
- lingxingapi/product/route.py +49 -0
- lingxingapi/product/schema.py +1004 -0
- lingxingapi/purchase/__init__.py +0 -0
- lingxingapi/purchase/api.py +496 -0
- lingxingapi/purchase/param.py +126 -0
- lingxingapi/purchase/route.py +11 -0
- lingxingapi/purchase/schema.py +215 -0
- lingxingapi/sales/__init__.py +0 -0
- lingxingapi/sales/api.py +3200 -0
- lingxingapi/sales/param.py +723 -0
- lingxingapi/sales/route.py +70 -0
- lingxingapi/sales/schema.py +1718 -0
- lingxingapi/source/__init__.py +0 -0
- lingxingapi/source/api.py +1799 -0
- lingxingapi/source/param.py +176 -0
- lingxingapi/source/route.py +38 -0
- lingxingapi/source/schema.py +1011 -0
- lingxingapi/tools/__init__.py +0 -0
- lingxingapi/tools/api.py +291 -0
- lingxingapi/tools/param.py +73 -0
- lingxingapi/tools/route.py +8 -0
- lingxingapi/tools/schema.py +169 -0
- lingxingapi/utils.py +411 -0
- lingxingapi/warehourse/__init__.py +0 -0
- lingxingapi/warehourse/api.py +1778 -0
- lingxingapi/warehourse/param.py +506 -0
- lingxingapi/warehourse/route.py +28 -0
- lingxingapi/warehourse/schema.py +926 -0
- lingxingapi-1.0.0.dist-info/METADATA +67 -0
- lingxingapi-1.0.0.dist-info/RECORD +65 -0
- lingxingapi-1.0.0.dist-info/WHEEL +5 -0
- lingxingapi-1.0.0.dist-info/licenses/LICENSE +22 -0
- lingxingapi-1.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,987 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
from pydantic import BaseModel, Field, field_validator, model_validator
|
|
3
|
+
from lingxingapi import errors
|
|
4
|
+
from lingxingapi.base.schema import ResponseV1, ResponseV2, FlattenDataRecords
|
|
5
|
+
from lingxingapi.fields import FloatOrNone2Zero, StrOrNone2Blank
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# Share ------------------------------------------------------------------------------------------------------------------------
|
|
9
|
+
class BaseItem(BaseModel):
|
|
10
|
+
"""基础商品信息"""
|
|
11
|
+
|
|
12
|
+
# 亚马逊ASIN
|
|
13
|
+
asin: StrOrNone2Blank
|
|
14
|
+
# 父ASIN [原字段 'parent_asin']
|
|
15
|
+
parent_asin: StrOrNone2Blank = Field(validation_alias="parentAsin")
|
|
16
|
+
# 亚马逊SKU
|
|
17
|
+
msku: StrOrNone2Blank
|
|
18
|
+
# 领星本地SKU [原字段 'sku']
|
|
19
|
+
lsku: StrOrNone2Blank = Field(validation_alias="sku")
|
|
20
|
+
# 亚马逊FNSKU
|
|
21
|
+
fnsku: StrOrNone2Blank
|
|
22
|
+
# 领星本地商品名称 [原字段 'productName']
|
|
23
|
+
product_name: StrOrNone2Blank = Field(validation_alias="productName")
|
|
24
|
+
# 商品标题
|
|
25
|
+
title: StrOrNone2Blank
|
|
26
|
+
# 商品略缩图
|
|
27
|
+
thumbnail_url: StrOrNone2Blank = Field(validation_alias="url")
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
# FBA - FBA货件 (STA) ----------------------------------------------------------------------------------------------------------
|
|
31
|
+
# . STA Plans
|
|
32
|
+
class StaPlanShipment(BaseModel):
|
|
33
|
+
"""亚马逊STA计划货件"""
|
|
34
|
+
|
|
35
|
+
# 货件ID
|
|
36
|
+
shipment_id: str = Field(validation_alias="shipmentId")
|
|
37
|
+
# 货件确认ID
|
|
38
|
+
shipment_confirmation_id: str = Field(validation_alias="shipmentConfirmationId")
|
|
39
|
+
# 货件状态 [原字段 'status']
|
|
40
|
+
shipment_status: str = Field("", validation_alias="status")
|
|
41
|
+
# 取件ID
|
|
42
|
+
pick_up_id: StrOrNone2Blank = Field(validation_alias="pickUpId")
|
|
43
|
+
# 运单号
|
|
44
|
+
freight_bill_number: StrOrNone2Blank = Field(validation_alias="freightBillNumber")
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class StaItem(BaseItem):
|
|
48
|
+
"""亚马逊STA计划货件商品"""
|
|
49
|
+
|
|
50
|
+
# 预处理方 [原字段 'prepOwner']
|
|
51
|
+
prep_owner: StrOrNone2Blank = Field(validation_alias="prepOwner")
|
|
52
|
+
# 标签处理方 [原字段 'labelOwner']
|
|
53
|
+
label_owner: StrOrNone2Blank = Field(validation_alias="labelOwner")
|
|
54
|
+
# 有效日期 [原字段 'expiration']
|
|
55
|
+
expiration_date: StrOrNone2Blank = Field(validation_alias="expiration")
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
class StaPlanItem(StaItem):
|
|
59
|
+
"""亚马逊STA计划货件商品"""
|
|
60
|
+
|
|
61
|
+
# 货件申报数量 [原字段 'quantity']
|
|
62
|
+
item_qty: int = Field(validation_alias="quantity")
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class StaPlan(BaseModel):
|
|
66
|
+
"""亚马逊STA计划"""
|
|
67
|
+
|
|
68
|
+
# 领星店铺ID
|
|
69
|
+
sid: int
|
|
70
|
+
# STA计划ID [原字段 'inboundPlanId']
|
|
71
|
+
inbound_plan_id: str = Field(validation_alias="inboundPlanId")
|
|
72
|
+
# STA计划名称 [原字段 'planName']
|
|
73
|
+
plan_name: str = Field(validation_alias="planName")
|
|
74
|
+
# 计划状态
|
|
75
|
+
status: str
|
|
76
|
+
# 分仓类型 (1: 先装箱再分仓, 2: 先分仓再装箱)
|
|
77
|
+
position_type: str = Field(validation_alias="positionType")
|
|
78
|
+
# 创建时间 [原字段 'gmtCreate']
|
|
79
|
+
create_time: str = Field(validation_alias="gmtCreate")
|
|
80
|
+
# 计划创建时间 [原字段 'planCreateTime']
|
|
81
|
+
plan_create_time: str = Field(validation_alias="planCreateTime")
|
|
82
|
+
# 更新时间 [原字段 'gmtModified']
|
|
83
|
+
update_time: str = Field(validation_alias="gmtModified")
|
|
84
|
+
# 计划更新时间 [原字段 'planUpdateTime']
|
|
85
|
+
plan_update_time: str = Field(validation_alias="planUpdateTime")
|
|
86
|
+
# 货件列表 [原字段 'shipmentList']
|
|
87
|
+
shipments: list[StaPlanShipment] = Field(validation_alias="shipmentList")
|
|
88
|
+
# 计划商品列表 [原字段 'inboundPlanItemList']
|
|
89
|
+
items: list[StaPlanItem] = Field(validation_alias="inboundPlanItemList")
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
class StaPlans(ResponseV2, FlattenDataRecords):
|
|
93
|
+
"""亚马逊STA计划列表"""
|
|
94
|
+
|
|
95
|
+
data: list[StaPlan]
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
# . STA Plan Detail
|
|
99
|
+
class StaPlanAddress(BaseModel):
|
|
100
|
+
"""亚马逊STA计划发货地址"""
|
|
101
|
+
|
|
102
|
+
# 国家代码 [原字段 'countryCode']
|
|
103
|
+
country_code: str = Field(validation_alias="countryCode")
|
|
104
|
+
# 国家名称 [原字段 'countryName']
|
|
105
|
+
country: str = Field(validation_alias="countryName")
|
|
106
|
+
# 州或省代码 [原字段 'stateOrProvinceCode']
|
|
107
|
+
state: str = Field(validation_alias="stateOrProvinceCode")
|
|
108
|
+
# 城市
|
|
109
|
+
city: str
|
|
110
|
+
# 发货地址行1 [原字段 'addressLine1']
|
|
111
|
+
address_line1: str = Field(validation_alias="addressLine1")
|
|
112
|
+
# 发货地址行2 [原字段 'addressLine2']
|
|
113
|
+
address_line2: StrOrNone2Blank = Field(validation_alias="addressLine2")
|
|
114
|
+
# 邮政编码 [原字段 'postalCode']
|
|
115
|
+
postcode: str = Field(validation_alias="postalCode")
|
|
116
|
+
# 发货人姓名 [原字段 'shipperName']
|
|
117
|
+
shipper_name: str = Field(validation_alias="shipperName")
|
|
118
|
+
# 电子邮件 [原字段 'email']
|
|
119
|
+
email: str = Field(validation_alias="email")
|
|
120
|
+
# 电话号码 [原字段 'phoneNumber']
|
|
121
|
+
phone: str = Field(validation_alias="phoneNumber")
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
class StaPlanDetail(BaseModel):
|
|
125
|
+
"""亚马逊STA计划详情"""
|
|
126
|
+
|
|
127
|
+
# STA计划ID [原字段 'inboundPlanId']
|
|
128
|
+
inbound_plan_id: str = Field(validation_alias="inboundPlanId")
|
|
129
|
+
# 计划名称 [原字段 'planName']
|
|
130
|
+
plan_name: str = Field(validation_alias="planName")
|
|
131
|
+
# 计划状态
|
|
132
|
+
status: str
|
|
133
|
+
# 分仓类型 (1: 先装箱再分仓, 2: 先分仓再装箱)
|
|
134
|
+
position_type: str = Field(validation_alias="positionType")
|
|
135
|
+
# 创建时间 [原字段 'gmtCreate']
|
|
136
|
+
create_time: str = Field(validation_alias="gmtCreate")
|
|
137
|
+
# 计划创建时间 [原字段 'planCreateTime']
|
|
138
|
+
plan_create_time: str = Field(validation_alias="planCreateTime")
|
|
139
|
+
# 更新时间 [原字段 'gmtModified']
|
|
140
|
+
update_time: str = Field(validation_alias="gmtModified")
|
|
141
|
+
# 计划更新时间 [原字段 'planUpdateTime']
|
|
142
|
+
plan_update_time: str = Field(validation_alias="planUpdateTime")
|
|
143
|
+
# 货件列表 [原字段 'shipmentList']
|
|
144
|
+
shipments: list[StaPlanShipment] = Field(validation_alias="shipmentList")
|
|
145
|
+
# 发货地址 [原字段 'addressVO']
|
|
146
|
+
shipment_address: StaPlanAddress = Field(validation_alias="addressVO")
|
|
147
|
+
# 计划商品列表 [原字段 'productList']
|
|
148
|
+
items: list[StaPlanItem] = Field(validation_alias="productList")
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
class StaPlanDetailData(ResponseV2):
|
|
152
|
+
|
|
153
|
+
data: StaPlanDetail
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
# . Packing Groups
|
|
157
|
+
class PackingGroup(BaseModel):
|
|
158
|
+
"""亚马逊STA包装组"""
|
|
159
|
+
|
|
160
|
+
# 包装组ID [原字段 'packingGroupId']
|
|
161
|
+
packing_group_id: str = Field(validation_alias="packingGroupId")
|
|
162
|
+
# 包装组商品列表 [原字段 'packingGroupItemList']
|
|
163
|
+
items: list[StaPlanItem] = Field(validation_alias="packingGroupItemList")
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
class PackingGroups(ResponseV2):
|
|
167
|
+
"""亚马逊STA包装组"""
|
|
168
|
+
|
|
169
|
+
data: list[PackingGroup]
|
|
170
|
+
|
|
171
|
+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
172
|
+
@model_validator(mode="before")
|
|
173
|
+
def _flatten_data(cls, data: dict) -> dict:
|
|
174
|
+
try:
|
|
175
|
+
inner: dict = data.pop("data", {})
|
|
176
|
+
data["data"] = inner.get("packingGroupList", [])
|
|
177
|
+
except Exception:
|
|
178
|
+
raise errors.ResponseDataError(cls.__name__, data=data)
|
|
179
|
+
return data
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
# . Packing Group Boxes
|
|
183
|
+
class PackingGroupBoxItem(StaItem):
|
|
184
|
+
"""亚马逊STA包装组装箱商品"""
|
|
185
|
+
|
|
186
|
+
# 箱内商品总数量 [原字段 'quantityInBox']
|
|
187
|
+
item_qty: int = Field(validation_alias="quantityInBox")
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
class PackingGroupBoxItem(BaseModel):
|
|
191
|
+
"""亚马逊STA庄庄组装箱商品"""
|
|
192
|
+
|
|
193
|
+
# 包裹ID [原字段 'packageId']
|
|
194
|
+
package_id: StrOrNone2Blank = Field(validation_alias="packageId")
|
|
195
|
+
# 箱子顺序号 [原字段 'localBoxId']
|
|
196
|
+
box_seq: int = Field(validation_alias="localBoxId")
|
|
197
|
+
# 亚马逊箱子ID [原字段 'boxId']
|
|
198
|
+
box_id: StrOrNone2Blank = Field(validation_alias="boxId")
|
|
199
|
+
# 箱子名称 [原字段 'boxName']
|
|
200
|
+
box_name: str = Field(validation_alias="boxName")
|
|
201
|
+
# 箱内商品总数量 [原字段 'total']
|
|
202
|
+
box_item_qty: int = Field(validation_alias="total")
|
|
203
|
+
# 箱子重量
|
|
204
|
+
weight: float
|
|
205
|
+
# 重量单位 [原字段 'weightUnit']
|
|
206
|
+
weight_unit: str = Field(validation_alias="weightUnit")
|
|
207
|
+
# 箱子长度
|
|
208
|
+
length: float
|
|
209
|
+
# 箱子宽度
|
|
210
|
+
width: float
|
|
211
|
+
# 箱子高度
|
|
212
|
+
height: float
|
|
213
|
+
# 箱子尺寸单位 [原字段 'lengthUnit']
|
|
214
|
+
dimension_unit: str = Field(validation_alias="lengthUnit")
|
|
215
|
+
# 箱内商品列表 [原字段 'productList']
|
|
216
|
+
items: list[PackingGroupBoxItem] = Field(validation_alias="productList")
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
class PackingGroupBox(BaseModel):
|
|
220
|
+
"""亚马逊STA庄庄组装箱"""
|
|
221
|
+
|
|
222
|
+
# 包装组ID [原字段 'packingGroupId']
|
|
223
|
+
packing_group_id: str = Field(validation_alias="packingGroupId")
|
|
224
|
+
# 装箱列表 [原字段 'shipmentPackingList']
|
|
225
|
+
boxes: list[PackingGroupBoxItem] = Field(validation_alias="shipmentPackingList")
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
class PackingGroupBoxes(ResponseV2):
|
|
229
|
+
"""亚马逊STA庄庄组装箱"""
|
|
230
|
+
|
|
231
|
+
data: list[PackingGroupBox]
|
|
232
|
+
|
|
233
|
+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
234
|
+
@model_validator(mode="before")
|
|
235
|
+
def _flatten_data(cls, data: dict) -> dict:
|
|
236
|
+
try:
|
|
237
|
+
inner: dict = data.pop("data", {})
|
|
238
|
+
data["data"] = inner.get("packingGroupList", [])
|
|
239
|
+
except Exception:
|
|
240
|
+
raise errors.ResponseDataError(cls.__name__, data=data)
|
|
241
|
+
return data
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
# . Placement Options
|
|
245
|
+
class PlacementOptionExpirationOffsetRules(BaseModel):
|
|
246
|
+
"""亚马逊FBA货件计划分仓选项过期时间规则"""
|
|
247
|
+
|
|
248
|
+
# 时区过渡
|
|
249
|
+
transitions: list
|
|
250
|
+
# 时区过渡规则 [原字段 'transitionRules']
|
|
251
|
+
transition_rules: list = Field(validation_alias="transitionRules")
|
|
252
|
+
# 时区是否固定偏移 [原字段 'fixedOffset']
|
|
253
|
+
fixed_offset: bool = Field(validation_alias="fixedOffset")
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
class PlacementOptionExpirationOffset(BaseModel):
|
|
257
|
+
"""亚马逊FBA货件计划分仓选项过期时间偏移"""
|
|
258
|
+
|
|
259
|
+
# 时区ID [原字段 'id']
|
|
260
|
+
timezone_id: str = Field(validation_alias="id")
|
|
261
|
+
# 时区偏移秒数 [原字段 'totalSeconds']
|
|
262
|
+
seconds: int = Field(validation_alias="totalSeconds")
|
|
263
|
+
# 时区规则
|
|
264
|
+
rules: PlacementOptionExpirationOffsetRules
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
class PlacementOptionExpiration(BaseModel):
|
|
268
|
+
"""亚马逊FBA货件计划分仓选项过期时间"""
|
|
269
|
+
|
|
270
|
+
# 年份值
|
|
271
|
+
year: int
|
|
272
|
+
# 月份值 [原字段 'monthValue']
|
|
273
|
+
month: int = Field(validation_alias="monthValue")
|
|
274
|
+
# 天数值 [原字段 'dayOfMonth']
|
|
275
|
+
day: int = Field(validation_alias="dayOfMonth")
|
|
276
|
+
# 小时值
|
|
277
|
+
hour: int
|
|
278
|
+
# 分钟值
|
|
279
|
+
minute: int
|
|
280
|
+
# 秒值
|
|
281
|
+
second: int
|
|
282
|
+
# 纳秒值
|
|
283
|
+
nano: int
|
|
284
|
+
# 年内日序 [原字段 'dayOfYear']
|
|
285
|
+
day_of_year: int = Field(validation_alias="dayOfYear")
|
|
286
|
+
# 月份名称 [原字段 'month']
|
|
287
|
+
month_name: str = Field(validation_alias="month")
|
|
288
|
+
# 星期名称 [原字段 'dayOfWeek']
|
|
289
|
+
weekday_name: str = Field(validation_alias="dayOfWeek")
|
|
290
|
+
# 时区偏移 [原字段 'offset']
|
|
291
|
+
offset: PlacementOptionExpirationOffset = Field(validation_alias="offset")
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
class PlacementOptionFee(BaseModel):
|
|
295
|
+
"""亚马逊FBA货件计划分仓选项费用"""
|
|
296
|
+
|
|
297
|
+
# 费用项目 [原字段 'target']
|
|
298
|
+
# (如: Placement Services, Fulfillment Fee Discount)
|
|
299
|
+
charge: str = Field(validation_alias="target")
|
|
300
|
+
# 费用类型 (如: FEE, DISCOUNT)
|
|
301
|
+
type: str
|
|
302
|
+
# 费用金额 [原字段 'amount']
|
|
303
|
+
fee_amt: float = Field(validation_alias="amount")
|
|
304
|
+
# 费用币种代码 [原字段 'code']
|
|
305
|
+
currency_code: str = Field(validation_alias="code")
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
class PlacementOptionShipmentAddress(BaseModel):
|
|
309
|
+
"""亚马逊FBA货件详情发货地址"""
|
|
310
|
+
|
|
311
|
+
# 国家代码 [原字段: 'countryCode']
|
|
312
|
+
country_code: StrOrNone2Blank = Field(validation_alias="countryCode")
|
|
313
|
+
# 州或省代码 [原字段 'stateOrProvinceCode']
|
|
314
|
+
state: StrOrNone2Blank = Field(validation_alias="stateOrProvinceCode")
|
|
315
|
+
# 城市
|
|
316
|
+
city: StrOrNone2Blank
|
|
317
|
+
# 地址行1 [原字段 'addressLine1']
|
|
318
|
+
address_line1: StrOrNone2Blank = Field(validation_alias="addressLine1")
|
|
319
|
+
# 地址行2 [原字段 'addressLine2']
|
|
320
|
+
address_line2: StrOrNone2Blank = Field(validation_alias="addressLine2")
|
|
321
|
+
# 地址名称 [原字段 'addressName']
|
|
322
|
+
address_name: StrOrNone2Blank = Field(validation_alias="name")
|
|
323
|
+
# 邮政编码 [原字段 'postalCode']
|
|
324
|
+
postcode: StrOrNone2Blank = Field(validation_alias="postalCode")
|
|
325
|
+
# 公司名称 [原字段 'companyName']
|
|
326
|
+
company_name: StrOrNone2Blank = Field(validation_alias="companyName")
|
|
327
|
+
# 电子邮箱
|
|
328
|
+
email: StrOrNone2Blank
|
|
329
|
+
# 电话号码 [原字段 'phoneNumber']
|
|
330
|
+
phone: StrOrNone2Blank = Field(validation_alias="phoneNumber")
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
class PlacementOptionItem(BaseItem):
|
|
334
|
+
"""亚马逊FBA货件计划分仓选项货件商品"""
|
|
335
|
+
|
|
336
|
+
# 货件申报数量 [原字段 'quantity']
|
|
337
|
+
item_qty: int = Field(validation_alias="quantity")
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
class PlacementOptionShipment(BaseModel):
|
|
341
|
+
"""亚马逊FBA货件计划分仓选项货件"""
|
|
342
|
+
|
|
343
|
+
# 货件ID [原字段 'shipmentId']
|
|
344
|
+
shipment_id: str = Field(validation_alias="shipmentId")
|
|
345
|
+
# 货件名称 [原字段 'shipmentName']
|
|
346
|
+
shipment_name: str = Field(validation_alias="shipmentName")
|
|
347
|
+
# 亚马逊配送中心编码 [原字段 'wareHouseId']
|
|
348
|
+
fulfillment_center_id: str = Field(validation_alias="wareHouseId")
|
|
349
|
+
# 入库区域 (中文) [原字段 'postalCodeMark']
|
|
350
|
+
inbound_region: StrOrNone2Blank = Field(validation_alias="postalCodeMark")
|
|
351
|
+
# 收货地址 [原字段 'address']
|
|
352
|
+
ship_to_address: PlacementOptionShipmentAddress = Field(validation_alias="address")
|
|
353
|
+
# 不同货件商品数 [原字段 'itemCount']
|
|
354
|
+
item_count: int = Field(validation_alias="itemCount")
|
|
355
|
+
# 货件商品申报总数量 [原字段 'quantity']
|
|
356
|
+
items_qty: int = Field(validation_alias="quantity")
|
|
357
|
+
# 货件商品列表 [原字段 'itemList']
|
|
358
|
+
items: list[PlacementOptionItem] = Field(validation_alias="itemList")
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
class PlacementOption(BaseModel):
|
|
362
|
+
"""亚马逊FBA货件计划分仓选项"""
|
|
363
|
+
|
|
364
|
+
# fmt: off
|
|
365
|
+
# 货件分仓方案ID [原字段 'placementOptionId']
|
|
366
|
+
placement_option_id: str = Field(validation_alias="placementOptionId")
|
|
367
|
+
# 货件分仓状态 [原字段 'placementStatus']
|
|
368
|
+
placement_status: str = Field(validation_alias="placementStatus")
|
|
369
|
+
# 货件分仓过期时间 [原字段 'expiration']
|
|
370
|
+
expiration: PlacementOptionExpiration
|
|
371
|
+
# 总费用 [原字段 'feeCount']
|
|
372
|
+
fee_amt: float = Field(validation_alias="feeCount")
|
|
373
|
+
# 费用列表 [原字段 'fees']
|
|
374
|
+
fees: list[PlacementOptionFee] = Field(validation_alias="fees")
|
|
375
|
+
# 货件列表 [原字段 'shipmentInformationList']
|
|
376
|
+
shipments: list[PlacementOptionShipment] = Field(validation_alias="shipmentInformationList")
|
|
377
|
+
# fmt: on
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
class PlacementOptions(ResponseV2):
|
|
381
|
+
"""亚马逊FBA货件计划数据"""
|
|
382
|
+
|
|
383
|
+
data: list[PlacementOption]
|
|
384
|
+
|
|
385
|
+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
386
|
+
@model_validator(mode="before")
|
|
387
|
+
def _flatten_data(cls, data: dict) -> dict:
|
|
388
|
+
try:
|
|
389
|
+
inner: dict = data.pop("data", {})
|
|
390
|
+
data["data"] = inner.get("placementOptionList", [])
|
|
391
|
+
except Exception:
|
|
392
|
+
raise errors.ResponseDataError(cls.__name__, data=data)
|
|
393
|
+
return data
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
# . Placement Option Boxes
|
|
397
|
+
class PlacementOptionShipmentBoxItem(BaseItem):
|
|
398
|
+
"""亚马逊FBA货件计划分仓选项装箱商品"""
|
|
399
|
+
|
|
400
|
+
# 箱内商品总数量 [原字段 'quantityInBox']
|
|
401
|
+
item_qty: int = Field(validation_alias="quantityInBox")
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
class PlacementOptionShipmentBox(BaseModel):
|
|
405
|
+
"""亚马逊FBA货件计划分仓选项装箱"""
|
|
406
|
+
|
|
407
|
+
# 箱子名称 [原字段 'boxName']
|
|
408
|
+
box_name: str = Field(validation_alias="boxName")
|
|
409
|
+
# 箱子重量
|
|
410
|
+
weight: float
|
|
411
|
+
# 重量单位 [原字段 'weightUnit']
|
|
412
|
+
weight_unit: str = Field(validation_alias="weightUnit")
|
|
413
|
+
# 箱子长度
|
|
414
|
+
length: float
|
|
415
|
+
# 箱子宽度
|
|
416
|
+
width: float
|
|
417
|
+
# 箱子高度
|
|
418
|
+
height: float
|
|
419
|
+
# 箱子尺寸单位 [原字段 'lengthUnit']
|
|
420
|
+
dimension_unit: str = Field(validation_alias="lengthUnit")
|
|
421
|
+
# 箱子总数量 [原字段 'total']
|
|
422
|
+
box_qty: int = Field(validation_alias="total")
|
|
423
|
+
# 箱内商品列表 [原字段 'productList']
|
|
424
|
+
items: list[PlacementOptionShipmentBoxItem] = Field(validation_alias="productList")
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
class PlacementOptionShipmentBoxes(BaseModel):
|
|
428
|
+
"""亚马逊FBA货件计划分仓选项装箱"""
|
|
429
|
+
|
|
430
|
+
# fmt: off
|
|
431
|
+
# 货件ID [原字段 'shipmentId']
|
|
432
|
+
shipment_id: str = Field(validation_alias="shipmentId")
|
|
433
|
+
# 货件重量
|
|
434
|
+
weight: FloatOrNone2Zero
|
|
435
|
+
# 货件重量单位 [原字段 'weightUnit']
|
|
436
|
+
weight_unit: StrOrNone2Blank = Field(validation_alias="weightUnit")
|
|
437
|
+
# 货件体积
|
|
438
|
+
volume: FloatOrNone2Zero
|
|
439
|
+
# 货件体积单位 [原字段 'volumeUnit']
|
|
440
|
+
volume_unit: StrOrNone2Blank = Field(validation_alias="volumeUnit")
|
|
441
|
+
# 装箱列表 [原字段 'shipmentPackingList']
|
|
442
|
+
boxes: list[PlacementOptionShipmentBox] = Field(validation_alias="shipmentPackingList")
|
|
443
|
+
# fmt: on
|
|
444
|
+
|
|
445
|
+
@field_validator("boxes", mode="before")
|
|
446
|
+
def _validate_boxes(cls, v):
|
|
447
|
+
return [] if v is None else v
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
class PlacementOptionShipmentsBoxes(BaseModel):
|
|
451
|
+
"""亚马逊FBA货件计划分仓选项装箱信息"""
|
|
452
|
+
|
|
453
|
+
# fmt: off
|
|
454
|
+
# 货件分仓方案ID [原字段 'placementOptionId']
|
|
455
|
+
placement_option_id: str = Field(validation_alias="placementOptionId")
|
|
456
|
+
# 货件分仓状态 [原字段 'placementStatus']
|
|
457
|
+
placement_status: str = Field(validation_alias="placementStatus")
|
|
458
|
+
# 货件装箱列表 [原字段 'shipmentInformationList']
|
|
459
|
+
shipments: list[PlacementOptionShipmentBoxes] = Field(validation_alias="shipmentInformationList")
|
|
460
|
+
# fmt: on
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
class PlacementOptionBoxes(ResponseV2):
|
|
464
|
+
"""亚马逊FBA货件计划分仓选项装箱数据"""
|
|
465
|
+
|
|
466
|
+
data: list[PlacementOptionShipmentsBoxes]
|
|
467
|
+
|
|
468
|
+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
469
|
+
@model_validator(mode="before")
|
|
470
|
+
def _flatten_data(cls, data: dict) -> dict:
|
|
471
|
+
try:
|
|
472
|
+
inner: dict = data.pop("data", {})
|
|
473
|
+
data["data"] = inner.get("placementOptionList", [])
|
|
474
|
+
except Exception:
|
|
475
|
+
raise errors.ResponseDataError(cls.__name__, data=data)
|
|
476
|
+
return data
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
# . Shipments
|
|
480
|
+
class ShipmentAddress(BaseModel):
|
|
481
|
+
"""亚马逊FBA货件发货地址"""
|
|
482
|
+
|
|
483
|
+
# 国家代码
|
|
484
|
+
country_code: str
|
|
485
|
+
# 州或省 [原字段 'state_or_province_code']
|
|
486
|
+
state: str = Field(validation_alias="state_or_province_code")
|
|
487
|
+
# 城市
|
|
488
|
+
city: str
|
|
489
|
+
# 地址区域 [原字段 'region']
|
|
490
|
+
district: str = Field(validation_alias="region")
|
|
491
|
+
# 地址行1
|
|
492
|
+
address_line1: str
|
|
493
|
+
# 地址行2
|
|
494
|
+
address_line2: str
|
|
495
|
+
# 地址名称 [原字段 'name']
|
|
496
|
+
address_name: str = Field(validation_alias="name")
|
|
497
|
+
# 邮政编码 [原字段 'postal_code']
|
|
498
|
+
postcode: str = Field(validation_alias="postal_code")
|
|
499
|
+
# 门牌号 [原字段 'doorplate']
|
|
500
|
+
door_plate: str = Field("", validation_alias="doorplate")
|
|
501
|
+
# 电话号码
|
|
502
|
+
phone: str = ""
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
class ShipmentTrackingNumber(BaseModel):
|
|
506
|
+
"""亚马逊FBA货件追踪号码"""
|
|
507
|
+
|
|
508
|
+
# 包裹ID
|
|
509
|
+
box_id: str
|
|
510
|
+
# 追踪号码
|
|
511
|
+
tracking_number: str
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
class ShipmentItem(BaseModel):
|
|
515
|
+
"""亚马逊FBA货件商品"""
|
|
516
|
+
|
|
517
|
+
# 唯一键
|
|
518
|
+
id: int
|
|
519
|
+
# 亚马逊SKU
|
|
520
|
+
msku: str
|
|
521
|
+
# 领星本地SKU [原字段 'sku']
|
|
522
|
+
lsku: str = Field(validation_alias="sku")
|
|
523
|
+
# 亚马逊FNSKU
|
|
524
|
+
fnsku: str
|
|
525
|
+
# 预处理说明
|
|
526
|
+
prep_instruction: str
|
|
527
|
+
# 预处理方
|
|
528
|
+
prep_owner: str
|
|
529
|
+
# 预处理明细
|
|
530
|
+
prep_details: str
|
|
531
|
+
# 标签处理方 [原字段 'prep_labelowner']
|
|
532
|
+
label_owner: str = Field(validation_alias="prep_labelowner")
|
|
533
|
+
# 有效日期 [原字段 'expiration']
|
|
534
|
+
expiration_date: str = Field(validation_alias="expiration")
|
|
535
|
+
# 生产日期
|
|
536
|
+
release_date: str
|
|
537
|
+
# 初始货件申报数量 [原字段 'init_quantity_shipped']
|
|
538
|
+
init_item_qty: int = Field(validation_alias="init_quantity_shipped")
|
|
539
|
+
# 当前货件申报数量 [原字段 'quantity_shipped']
|
|
540
|
+
curr_item_qty: int = Field(validation_alias="quantity_shipped")
|
|
541
|
+
# 箱内商品数量 [原字段 'quantity_in_case']
|
|
542
|
+
box_item_qty: int = Field(validation_alias="quantity_in_case")
|
|
543
|
+
# 已发货数量 [原字段 'quantity_shipped_local']
|
|
544
|
+
shipped_qty: int = Field(validation_alias="quantity_shipped_local")
|
|
545
|
+
# 亚马逊配送中心已接收的商品数量 [原字段 'quantity_received']
|
|
546
|
+
received_qty: int = Field(validation_alias="quantity_received")
|
|
547
|
+
# 库存明细ID [原字段 'ware_house_storage_id']
|
|
548
|
+
warehouse_storage_id: int = Field(validation_alias="ware_house_storage_id")
|
|
549
|
+
# 发货计划单号列表 [原字段 'shipment_plan_list']
|
|
550
|
+
shipment_plan_numbers: list = Field(validation_alias="shipment_plan_list")
|
|
551
|
+
|
|
552
|
+
|
|
553
|
+
class Shipment(BaseModel):
|
|
554
|
+
"""亚马逊FBA货件"""
|
|
555
|
+
|
|
556
|
+
# fmt: off
|
|
557
|
+
# 唯一键
|
|
558
|
+
id: int
|
|
559
|
+
# 领星店铺ID
|
|
560
|
+
sid: int
|
|
561
|
+
# 领星店铺名称 [原字段 'seller']
|
|
562
|
+
seller_name: str = Field(validation_alias="seller")
|
|
563
|
+
# FBA货件ID
|
|
564
|
+
shipment_id: str
|
|
565
|
+
# FBA货件名称
|
|
566
|
+
shipment_name: str
|
|
567
|
+
# 货件状态
|
|
568
|
+
# 'WORKING': 卖家已创建货件,但尚未发货
|
|
569
|
+
# 'READY_TO_SHIP': 卖家完成货件穿件, 可以发货
|
|
570
|
+
# 'SHIPPED': 承运人已取件
|
|
571
|
+
# 'IN_TRANSIT': 承运人已通知亚马逊配送中心,知晓货件的存在
|
|
572
|
+
# 'DELIVERED': 承运人已将货件配送至亚马逊配送中心
|
|
573
|
+
# 'CHECK_IN': 货件已在亚马逊配送中心
|
|
574
|
+
# 'RECEIVING': 货件已到达亚马逊配送中心,但有部分商品尚未标记为已收到
|
|
575
|
+
# 'CLOSED': 货件已到达亚马逊配送中心,且所有商品已标记为已收到
|
|
576
|
+
# 'CANCELLED': 卖家在将货件发送至亚马逊配送中心后取消了货件
|
|
577
|
+
# 'DELETED': 卖家在将货件发送至亚马逊配送中心前取消了货件
|
|
578
|
+
# 'ERROR': 货件出错,但其并非亚马逊处理
|
|
579
|
+
shipment_status: str
|
|
580
|
+
# 货件事否已完成 [原字段 'is_closed']
|
|
581
|
+
# 有绑定, 按签发差异判断: 1. 发货量>签收量='进行中'; 2. 发货量<=签收量='已完成'
|
|
582
|
+
# 无绑定, 用货件状态判断: DELETED, CANCELED, CLOSED为已完成, 其他为进行中
|
|
583
|
+
# 额外情况: 当货件状态进入CLOSED, CANCELLED, DELETED 之后90天, 自动变为'已完成'
|
|
584
|
+
shipment_closed: int = Field(validation_alias="is_closed")
|
|
585
|
+
# 承运方式名称 [原字段 'alpha_name']
|
|
586
|
+
transport_name: str = Field(validation_alias="alpha_name")
|
|
587
|
+
# 承运方式编码 [原字段 'alpha_code']
|
|
588
|
+
transport_code: str = Field(validation_alias="alpha_code")
|
|
589
|
+
# 运输类型
|
|
590
|
+
shipping_mode: str
|
|
591
|
+
# 运输解决方案
|
|
592
|
+
shipping_solution: str
|
|
593
|
+
# 是否同步亚马逊后台 [原字段 'is_synchronous']
|
|
594
|
+
is_synchronized: int = Field(validation_alias="is_synchronous")
|
|
595
|
+
# 是否上传包装箱信息 [原字段 'is_uploaded_box']
|
|
596
|
+
is_box_info_uploaded: int = Field(validation_alias="is_uploaded_box")
|
|
597
|
+
# 货件创建人ID [原字段 'uid']
|
|
598
|
+
creator_id: int = Field(validation_alias="uid")
|
|
599
|
+
# 货件创建人名称 [原字段 'username']
|
|
600
|
+
creator_name: str = Field(validation_alias="username")
|
|
601
|
+
# 货件数据创建时间 [原字段 'gmt_create']
|
|
602
|
+
create_time: str = Field(validation_alias="gmt_create")
|
|
603
|
+
# 货件数据更新时间 [原字段 'gmt_modified']
|
|
604
|
+
update_time: str = Field(validation_alias="gmt_modified")
|
|
605
|
+
# 货件数据同步时间
|
|
606
|
+
sync_time: str
|
|
607
|
+
# 货件创建时间
|
|
608
|
+
working_time: str
|
|
609
|
+
# 承运人已取件时间
|
|
610
|
+
shipped_time: str
|
|
611
|
+
# 货件到达亚马逊配送中心后, 开始接收时间
|
|
612
|
+
receiving_time: str
|
|
613
|
+
# 货件到达亚马逊配送中心后, 完成接收时间
|
|
614
|
+
closed_time: str
|
|
615
|
+
# 是否为STA货件 (0: 否, 1: 是)
|
|
616
|
+
is_sta: int
|
|
617
|
+
# STA计划名称
|
|
618
|
+
sta_plan_name: str
|
|
619
|
+
# STA计划ID
|
|
620
|
+
sta_inbound_plan_id: str
|
|
621
|
+
# STA货件ID
|
|
622
|
+
sta_shipment_id: str
|
|
623
|
+
# STA发货日期 [原字段 'sta_shipment_date']
|
|
624
|
+
sta_shipping_date: str = Field(validation_alias="sta_shipment_date")
|
|
625
|
+
# STA送达开始时间
|
|
626
|
+
sta_delivery_start_date: str
|
|
627
|
+
# STA送达结束时间
|
|
628
|
+
sta_delivery_end_date: str
|
|
629
|
+
# 提货单号 (BOL)
|
|
630
|
+
bill_of_lading_number: str
|
|
631
|
+
# 跟踪编号 (PRO) [原字段 'freight_bill_number']
|
|
632
|
+
freight_pro_number: str = Field(validation_alias="freight_bill_number")
|
|
633
|
+
# 亚马逊关联编码 [原字段 'reference_id']
|
|
634
|
+
amazon_reference_id: str = Field(validation_alias="reference_id")
|
|
635
|
+
# 亚马逊配送中心编码 [原字段 'destination_fulfillment_center_id']
|
|
636
|
+
fulfillment_center_id: str = Field(validation_alias="destination_fulfillment_center_id")
|
|
637
|
+
# 发货地址
|
|
638
|
+
ship_from_address: ShipmentAddress
|
|
639
|
+
# 收货地址
|
|
640
|
+
ship_to_address: ShipmentAddress
|
|
641
|
+
# 追踪号码列表 [原字段 'tracking_number_list']
|
|
642
|
+
tracking_numbers: list[ShipmentTrackingNumber] = Field(validation_alias="tracking_number_list")
|
|
643
|
+
# 货件商品列表 [原字段 'item_list']
|
|
644
|
+
items: list[ShipmentItem] = Field(validation_alias="item_list")
|
|
645
|
+
# fmt: on
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
class Shipments(ResponseV1):
|
|
649
|
+
"""亚马逊FBA货件列表"""
|
|
650
|
+
|
|
651
|
+
data: list[Shipment]
|
|
652
|
+
|
|
653
|
+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
654
|
+
@model_validator(mode="before")
|
|
655
|
+
def _flatten_data(cls, data: dict) -> dict:
|
|
656
|
+
try:
|
|
657
|
+
inner: dict = data.pop("data", {})
|
|
658
|
+
data["data"] = inner.get("list", [])
|
|
659
|
+
except Exception:
|
|
660
|
+
raise errors.ResponseDataError(cls.__name__, data=data)
|
|
661
|
+
return data
|
|
662
|
+
|
|
663
|
+
|
|
664
|
+
# . Shipment Details
|
|
665
|
+
class ShipmentDetailAddress(BaseModel):
|
|
666
|
+
"""亚马逊FBA货件详情发货地址"""
|
|
667
|
+
|
|
668
|
+
# 国家代码 [原字段: 'countryCode']
|
|
669
|
+
country_code: StrOrNone2Blank = Field(validation_alias="countryCode")
|
|
670
|
+
# 国家
|
|
671
|
+
country: StrOrNone2Blank
|
|
672
|
+
# 州或省代码 [原字段 'stateOrProvinceCode']
|
|
673
|
+
state: StrOrNone2Blank = Field(validation_alias="stateOrProvinceCode")
|
|
674
|
+
# 城市
|
|
675
|
+
city: StrOrNone2Blank
|
|
676
|
+
# 地址行1 [原字段 'addressLine1']
|
|
677
|
+
address_line1: StrOrNone2Blank = Field(validation_alias="addressLine1")
|
|
678
|
+
# 地址行2 [原字段 'addressLine2']
|
|
679
|
+
address_line2: StrOrNone2Blank = Field(validation_alias="addressLine2")
|
|
680
|
+
# 地址名称 [原字段 'addressName']
|
|
681
|
+
address_name: StrOrNone2Blank = Field(validation_alias="addressName")
|
|
682
|
+
# 邮政编码 [原字段 'postalCode']
|
|
683
|
+
postcode: StrOrNone2Blank = Field(validation_alias="postalCode")
|
|
684
|
+
# 电子邮箱
|
|
685
|
+
email: StrOrNone2Blank
|
|
686
|
+
# 电话号码 [原字段 'phoneNumber']
|
|
687
|
+
phone: StrOrNone2Blank = Field(validation_alias="phoneNumber")
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
class ShipmentDetailTrackingNumber(BaseModel):
|
|
691
|
+
"""亚马逊FBA货件追踪号码"""
|
|
692
|
+
|
|
693
|
+
# 包裹ID [原字段 'boxId']
|
|
694
|
+
box_id: str = Field(validation_alias="boxId")
|
|
695
|
+
# 追踪号码 [原字段 'trackingNumber']
|
|
696
|
+
tracking_number: str = Field(validation_alias="trackingNumber")
|
|
697
|
+
|
|
698
|
+
|
|
699
|
+
class ShipmentDetail(BaseModel):
|
|
700
|
+
"""亚马逊FBA货件详情"""
|
|
701
|
+
|
|
702
|
+
# fmt: off
|
|
703
|
+
# 领星店铺ID
|
|
704
|
+
sid: int
|
|
705
|
+
# 货件ID [原字段 'shipmentId']
|
|
706
|
+
shipment_id: str = Field(validation_alias="shipmentId")
|
|
707
|
+
# 货件名称 [原字段 'shipmentName']
|
|
708
|
+
shipment_name: str = Field(validation_alias="shipmentName")
|
|
709
|
+
# 货件确认ID [原字段 'shipmentConfirmationId']
|
|
710
|
+
shipment_confirmation_id: str = Field(validation_alias="shipmentConfirmationId")
|
|
711
|
+
# 货件状态 [原字段 'status']
|
|
712
|
+
shipment_status: str = Field(validation_alias="status")
|
|
713
|
+
# 承运方式编码 [原字段 'alphaCode']
|
|
714
|
+
transport_code: str = Field(validation_alias="alphaCode")
|
|
715
|
+
# 运输类型 [原字段 'shippingMode']
|
|
716
|
+
shipping_mode: str = Field(validation_alias="shippingMode")
|
|
717
|
+
# 运输解决方案 [原字段 'shippingSolution']
|
|
718
|
+
shipping_solution: str = Field(validation_alias="shippingSolution")
|
|
719
|
+
# STA发货日期 [原字段 'shipingTime']
|
|
720
|
+
shipping_date: StrOrNone2Blank = Field(validation_alias="shipingTime")
|
|
721
|
+
# STA送达开始时间 [原字段 'startDate']
|
|
722
|
+
delivery_start_date: StrOrNone2Blank = Field(validation_alias="startDate")
|
|
723
|
+
# STA送达结束时间 [原字段 'endDate']
|
|
724
|
+
delivery_end_date: StrOrNone2Blank = Field(validation_alias="endDate")
|
|
725
|
+
# 提货单号 (BOL) [原字段 'pickUpId']
|
|
726
|
+
bill_of_lading_number: StrOrNone2Blank = Field(validation_alias="pickUpId")
|
|
727
|
+
# 亚马逊关联编码 [原字段 'amazonReferenceId']
|
|
728
|
+
amazon_reference_id: str = Field(validation_alias="amazonReferenceId")
|
|
729
|
+
# 亚马逊配送中心编码 [原字段 'warehouseId']
|
|
730
|
+
fulfillment_center_id: str = Field(validation_alias="warehouseId")
|
|
731
|
+
# 入库区域 (中文) [原字段 'inboundRegion']
|
|
732
|
+
inbound_region: str = Field(validation_alias="inboundRegion")
|
|
733
|
+
# 发货地址 [原字段 'sendAddress']
|
|
734
|
+
ship_from_address: ShipmentDetailAddress = Field(validation_alias="sendAddress")
|
|
735
|
+
# 收货地址 [原字段 'shippingAddress']
|
|
736
|
+
ship_to_address: ShipmentDetailAddress = Field(validation_alias="shippingAddress")
|
|
737
|
+
# 追踪号码 [原字段 'trackingNumber']
|
|
738
|
+
tracking_number: StrOrNone2Blank = Field(validation_alias="trackingNumber")
|
|
739
|
+
# 追踪号码列表 [原字段 'trackingNumberList']
|
|
740
|
+
tracking_numbers: list[ShipmentDetailTrackingNumber] = Field(validation_alias="trackingNumberList")
|
|
741
|
+
# 货件商品数量 [原字段 'itemCount']
|
|
742
|
+
item_count: int = Field(validation_alias="itemCount")
|
|
743
|
+
# 货件商品列表 [原字段 'itemList']
|
|
744
|
+
items: list[StaPlanItem] = Field(validation_alias="itemList")
|
|
745
|
+
# fmt: on
|
|
746
|
+
|
|
747
|
+
|
|
748
|
+
class ShipmentDetails(ResponseV2):
|
|
749
|
+
"""亚马逊FBA货件详情数据"""
|
|
750
|
+
|
|
751
|
+
data: list[ShipmentDetail]
|
|
752
|
+
|
|
753
|
+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
754
|
+
@model_validator(mode="before")
|
|
755
|
+
def _flatten_data(cls, data: dict) -> dict:
|
|
756
|
+
try:
|
|
757
|
+
inner: dict = data.pop("data", {})
|
|
758
|
+
data["data"] = inner.get("shipmentList", [])
|
|
759
|
+
except Exception:
|
|
760
|
+
raise errors.ResponseDataError(cls.__name__, data=data)
|
|
761
|
+
return data
|
|
762
|
+
|
|
763
|
+
|
|
764
|
+
# . Shipment Boxes
|
|
765
|
+
class ShipmentBoxItem(StaItem):
|
|
766
|
+
"""亚马逊FBA货件装箱商品"""
|
|
767
|
+
|
|
768
|
+
# 箱内商品总数量 [原字段 'quantityInBox']
|
|
769
|
+
item_qty: int = Field(validation_alias="quantityInBox")
|
|
770
|
+
|
|
771
|
+
|
|
772
|
+
class ShipmentBox(BaseModel):
|
|
773
|
+
"""亚马逊FBA货件装箱商品"""
|
|
774
|
+
|
|
775
|
+
# 包裹ID [原字段 'packageId']
|
|
776
|
+
package_id: StrOrNone2Blank = Field(validation_alias="packageId")
|
|
777
|
+
# 箱子序列 [原字段 'localBoxId']
|
|
778
|
+
box_seq: int = Field(validation_alias="localBoxId")
|
|
779
|
+
# 亚马逊箱子ID [原字段 'boxId']
|
|
780
|
+
box_id: StrOrNone2Blank = Field(validation_alias="boxId")
|
|
781
|
+
# 箱子名称 [原字段 'boxName']
|
|
782
|
+
box_name: str = Field(validation_alias="boxName")
|
|
783
|
+
# 箱子产品总数量 [原字段 'total']
|
|
784
|
+
box_item_qty: int = Field(validation_alias="total")
|
|
785
|
+
# 箱子重量
|
|
786
|
+
weight: float
|
|
787
|
+
# 重量单位 [原字段 'weightUnit']
|
|
788
|
+
weight_unit: str = Field(validation_alias="weightUnit")
|
|
789
|
+
# 箱子长度
|
|
790
|
+
length: float
|
|
791
|
+
# 箱子宽度
|
|
792
|
+
width: float
|
|
793
|
+
# 箱子高度
|
|
794
|
+
height: float
|
|
795
|
+
# 箱子尺寸单位 [原字段 'lengthUnit']
|
|
796
|
+
dimension_unit: str = Field(validation_alias="lengthUnit")
|
|
797
|
+
# 商品列表 [原字段 'productList']
|
|
798
|
+
items: list[ShipmentBoxItem] = Field(validation_alias="productList")
|
|
799
|
+
|
|
800
|
+
|
|
801
|
+
class ShipmentPallet(BaseModel):
|
|
802
|
+
"""亚马逊FBA货件装箱托盘"""
|
|
803
|
+
|
|
804
|
+
# 托盘重量
|
|
805
|
+
weight: float
|
|
806
|
+
# 重量单位 [原字段 'weightUnit']
|
|
807
|
+
weight_unit: str = Field(validation_alias="weightUnit")
|
|
808
|
+
# 托盘长度
|
|
809
|
+
length: float
|
|
810
|
+
# 托盘宽度
|
|
811
|
+
width: float
|
|
812
|
+
# 托盘高度
|
|
813
|
+
height: float
|
|
814
|
+
# 托盘尺寸单位 [原字段 'lengthUnit']
|
|
815
|
+
dimension_unit: str = Field(validation_alias="lengthUnit")
|
|
816
|
+
# 托盘数量 [原字段 'quantity']
|
|
817
|
+
pallet_qty: int = Field(validation_alias="quantity")
|
|
818
|
+
# 堆叠方式
|
|
819
|
+
stackability: str
|
|
820
|
+
|
|
821
|
+
|
|
822
|
+
class ShipmentPackings(BaseModel):
|
|
823
|
+
"""亚马逊FBA货件装箱商品"""
|
|
824
|
+
|
|
825
|
+
# 货件ID [原字段 'shipmentId']
|
|
826
|
+
shipment_id: str = Field(validation_alias="shipmentId")
|
|
827
|
+
# 装箱列表 [原字段 'shipmentPackingList']
|
|
828
|
+
boxes: list[ShipmentBox] = Field(validation_alias="shipmentPackingList")
|
|
829
|
+
# 装箱托盘列表 [原字段 'palletList']
|
|
830
|
+
pallets: list[ShipmentPallet] = Field(validation_alias="palletList")
|
|
831
|
+
|
|
832
|
+
|
|
833
|
+
class ShipmentBoxes(ResponseV2):
|
|
834
|
+
"""亚马逊FBA货件装箱数据"""
|
|
835
|
+
|
|
836
|
+
data: list[ShipmentPackings]
|
|
837
|
+
|
|
838
|
+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
839
|
+
@model_validator(mode="before")
|
|
840
|
+
def _flatten_data(cls, data: dict) -> dict:
|
|
841
|
+
try:
|
|
842
|
+
inner: dict = data.pop("data", {})
|
|
843
|
+
data["data"] = inner.get("shipmentList", [])
|
|
844
|
+
except Exception:
|
|
845
|
+
raise errors.ResponseDataError(cls.__name__, data=data)
|
|
846
|
+
return data
|
|
847
|
+
|
|
848
|
+
|
|
849
|
+
# . Shipment Transports
|
|
850
|
+
class ShipmentTransport(BaseModel):
|
|
851
|
+
"""亚马逊FBA货件运输数据"""
|
|
852
|
+
|
|
853
|
+
# 承运选项ID [原字段 'transportationOptionId']
|
|
854
|
+
transport_option_id: str = Field(validation_alias="transportationOptionId")
|
|
855
|
+
# 承运方式名称 [原字段 'alphaName']
|
|
856
|
+
transport_name: str = Field(validation_alias="alphaName")
|
|
857
|
+
# 承运方式编码 [原字段 'alphaCode']
|
|
858
|
+
transport_code: str = Field(validation_alias="alphaCode")
|
|
859
|
+
# 运输类型 [原字段 'shippingMode']
|
|
860
|
+
shipping_mode: str = Field(validation_alias="shippingMode")
|
|
861
|
+
# 运输解决方案 [原字段 'shippingSolution']
|
|
862
|
+
shipping_solution: str = Field(validation_alias="shippingSolution")
|
|
863
|
+
# 运输费用 [原字段 'carrierFee']
|
|
864
|
+
shipping_fee: FloatOrNone2Zero = Field(validation_alias="carrierFee")
|
|
865
|
+
|
|
866
|
+
|
|
867
|
+
class ShipmentTransports(ResponseV2):
|
|
868
|
+
"""亚马逊FBA货件运输数据"""
|
|
869
|
+
|
|
870
|
+
data: list[ShipmentTransport]
|
|
871
|
+
|
|
872
|
+
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
873
|
+
@model_validator(mode="before")
|
|
874
|
+
def _flatten_data(cls, data: dict) -> dict:
|
|
875
|
+
try:
|
|
876
|
+
inner: dict = data.pop("data", {})
|
|
877
|
+
data["data"] = inner.get("transportVOList", [])
|
|
878
|
+
except Exception:
|
|
879
|
+
raise errors.ResponseDataError(cls.__name__, data=data)
|
|
880
|
+
return data
|
|
881
|
+
|
|
882
|
+
|
|
883
|
+
# . Shipment Receipt Records
|
|
884
|
+
class ShipmentReceiptRecord(BaseModel):
|
|
885
|
+
"""亚马逊FBA货件接收记录"""
|
|
886
|
+
|
|
887
|
+
# 唯一md5索引
|
|
888
|
+
uid_md5: str = Field(validation_alias="unique_md5")
|
|
889
|
+
# 领星店铺ID
|
|
890
|
+
sid: int
|
|
891
|
+
# 亚马逊SKU [原字段 'sku']
|
|
892
|
+
msku: str = Field(validation_alias="sku")
|
|
893
|
+
# 亚马逊FNSKU
|
|
894
|
+
fnsku: str
|
|
895
|
+
# 商品标题 [原字段 'product_name']
|
|
896
|
+
title: str = Field(validation_alias="product_name")
|
|
897
|
+
# 货件ID [原字段 'fba_shipment_id']
|
|
898
|
+
shipment_id: str = Field(validation_alias="fba_shipment_id")
|
|
899
|
+
# 亚马逊配送中心编码
|
|
900
|
+
fulfillment_center_id: str
|
|
901
|
+
# 亚马逊配送中心国家代码 [原字段 'country']
|
|
902
|
+
country_code: str = Field(validation_alias="country")
|
|
903
|
+
# 货件接收数量 [原字段 'quantity']
|
|
904
|
+
received_qty: int = Field(validation_alias="quantity")
|
|
905
|
+
# 货件接收日期 [原字段 'received_date_report']
|
|
906
|
+
received_date: str = Field(validation_alias="received_date_report")
|
|
907
|
+
# 货件接收时间 (UTC) [原字段 'received_date']
|
|
908
|
+
received_time_utc: str = Field(validation_alias="received_date")
|
|
909
|
+
# 货件接收时间 (时间戳) [原字段 'received_date_timestamp']
|
|
910
|
+
received_time_ts: int = Field(validation_alias="received_date_timestamp")
|
|
911
|
+
|
|
912
|
+
|
|
913
|
+
class ShipmentReceiptRecords(ResponseV1):
|
|
914
|
+
"""亚马逊FBA货件接收记录"""
|
|
915
|
+
|
|
916
|
+
data: list[ShipmentReceiptRecord]
|
|
917
|
+
|
|
918
|
+
|
|
919
|
+
# . Shipment Delivery Address
|
|
920
|
+
class ShipmentDeliveryAddress(BaseModel):
|
|
921
|
+
"""亚马逊FBA货件收货地址"""
|
|
922
|
+
|
|
923
|
+
# 国家名称 [原字段 'ship_to_country']
|
|
924
|
+
country: str = Field(validation_alias="ship_to_country")
|
|
925
|
+
# 州或省 [原字段 'ship_to_province_code']
|
|
926
|
+
state: str = Field(validation_alias="ship_to_province_code")
|
|
927
|
+
# 城市 [原字段 'ship_to_city']
|
|
928
|
+
city: str = Field(validation_alias="ship_to_city")
|
|
929
|
+
# 地址行 [原字段 'ship_to_address']
|
|
930
|
+
address: str = Field(validation_alias="ship_to_address")
|
|
931
|
+
# 邮政编码 [原字段 'ship_to_postal_code']
|
|
932
|
+
postcode: str = Field(validation_alias="ship_to_postal_code")
|
|
933
|
+
# 收货人名称 [原字段 'ship_to_name']
|
|
934
|
+
receiver_name: str = Field(validation_alias="ship_to_name")
|
|
935
|
+
|
|
936
|
+
|
|
937
|
+
class ShipmentDeliveryAddressData(ResponseV1):
|
|
938
|
+
"""亚马逊FBA货件收货地址"""
|
|
939
|
+
|
|
940
|
+
data: ShipmentDeliveryAddress
|
|
941
|
+
|
|
942
|
+
|
|
943
|
+
# . Ship From Addresses
|
|
944
|
+
class ShipFromAddress(BaseModel):
|
|
945
|
+
|
|
946
|
+
# 领星店铺ID
|
|
947
|
+
sid: int
|
|
948
|
+
# 领星店铺名称
|
|
949
|
+
seller_name: str
|
|
950
|
+
# 店铺国家名称 [原字段 'seller_country_name']
|
|
951
|
+
seller_country: str = Field(validation_alias="seller_country_name")
|
|
952
|
+
# 地址ID [原字段 'id' | 唯一键]
|
|
953
|
+
address_id: int = Field(validation_alias="id")
|
|
954
|
+
# 地址别名 [原字段 'alias_name']
|
|
955
|
+
address_alias: str = Field(validation_alias="alias_name")
|
|
956
|
+
# 国家代码
|
|
957
|
+
country_code: str
|
|
958
|
+
# 国家名称 [原字段 'country_name']
|
|
959
|
+
country: str = Field(validation_alias="country_name")
|
|
960
|
+
# 州或省 [原字段 'province']
|
|
961
|
+
state: str = Field(validation_alias="province")
|
|
962
|
+
# 城市
|
|
963
|
+
city: str
|
|
964
|
+
# 区域 [原字段 'region']
|
|
965
|
+
district: str = Field(validation_alias="region")
|
|
966
|
+
# 地址行1 [原字段 'street_detail1']
|
|
967
|
+
address_line1: str = Field(validation_alias="street_detail1")
|
|
968
|
+
# 地址行2 [原字段 'street_detail2']
|
|
969
|
+
address_line2: str = Field(validation_alias="street_detail2")
|
|
970
|
+
# 邮政编码 [原字段 'zip_code']
|
|
971
|
+
postcode: str = Field(validation_alias="zip_code")
|
|
972
|
+
# 发件人名称 [原字段 'sender_name']
|
|
973
|
+
shipper_name: str = Field(validation_alias="sender_name")
|
|
974
|
+
# 公司名称 [原字段 'company_name']
|
|
975
|
+
company_name: str = Field(validation_alias="company_name")
|
|
976
|
+
# 电话号码 [原字段 'phone']
|
|
977
|
+
phone: str
|
|
978
|
+
# 电子邮箱 [原字段 'email']
|
|
979
|
+
email: str
|
|
980
|
+
# 是否为默认地址 [原字段 'is_default']
|
|
981
|
+
is_default: int = Field(validation_alias="is_default")
|
|
982
|
+
|
|
983
|
+
|
|
984
|
+
class ShipFromAddresses(ResponseV1):
|
|
985
|
+
"""亚马逊FBA货件发货地址"""
|
|
986
|
+
|
|
987
|
+
data: list[ShipFromAddress]
|