WlbOrderCreateRequest.php
12.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
<?php
/**
* TOP API: taobao.wlb.order.create request
*
* @author auto create
* @since 1.0, 2012-12-13 16:33:03
*/
class WlbOrderCreateRequest
{
/**
* 支付宝交易号
**/
private $alipayNo;
/**
* 该字段暂时保留
**/
private $attributes;
/**
* 买家呢称
**/
private $buyerNick;
/**
* 期望结束时间,在入库单会使用到
**/
private $expectEndTime;
/**
* 计划开始送达时间 在入库单中可能会使用
**/
private $expectStartTime;
/**
* {"invoince_info": [{"bill_type":"发票类型,必选", "bill_title":"发票抬头,必选", "bill_amount":"发票金额(单位是分),必选","bill_content":"发票内容,可选"}]}
**/
private $invoinceInfo;
/**
* 该物流宝订单是否已完成,如果完成则设置为true,如果为false,则需要等待继续创建订单商品信息。
**/
private $isFinished;
/**
* 物流宝订单编号,该接口约定每次最多只能传50条order_item_list,如果一个物流宝订单超过50条商品的时候,需要批量来调用该接口,第一次调用的时候,wlb_order_code为空,如果第一次创建成功,该接口返回wlb_order_code,其后继续再该订单上添加商品条目,需要带上wlb_order_code,out_biz_code,order_item_list,is_finished四个字段。
**/
private $orderCode;
/**
* 用字符串格式来表示订单标记列表:比如COD^PRESELL^SPLIT^LIMIT 等,中间用“^”来隔开 ---------------------------------------- 订单标记list(所有字母全部大写): 1: COD –货到付款 2: LIMIT-限时配送 3: PRESELL-预售 5:COMPLAIN-已投诉 7:SPLIT-拆单, 8:EXCHANGE-换货, 9:VISIT-上门 , 10: MODIFYTRANSPORT-是否可改配送方式,
: 是否可改配送方式 默认可更改
11 CONSIGN 物流宝代理发货,自动更改发货状态
12: SELLER_AFFORD 是否卖家承担运费 默认是,即没 13: SYNC_RETURN_BILL,同时退回发票
**/
private $orderFlag;
/**
* 订单商品列表: {"order_item_list":[{"trade_code":"可选,淘宝交易订单,并且不是赠品,必须要传订单来源编号"," sub_trade_code ":"可选,淘宝子交易号","item_id":"必须,商品Id","item_code":"必须,商家编码","item_name":"可选,物流宝商品名称","item_quantity":"必选,计划数量","item_price":"必选,物品价格,单位为分","owner_user_nick
":"可选,货主nick 代销模式下会存在","flag":"判断是否为赠品0 不是1是","remarks":"可选,备注","batch_remark":"可选,批次描述信息会把这个信息带给WMS,但不会跟物流宝库存相关联","inventory_type":"库存类型1 可销售库存 101 类型用来定义残次品 201 冻结类型库存 301 在途库存","picture_url":"图片Url","distributor_user_nick": "分销商NICK",必选"ext_order_item_code":"可选,外部商品的商家编码"]} ======================================== 如果订单中的商品条目数大于50条的时候,我们会校验,不能创建成功,需要你按照50个一批的数量传,需要分批调用该接口,第二次传的时候,需要带上wlb_order_code和is_finished和order_item_list三个字段是必传的,is_finished为true表示传输完毕,为false表示还没完全传完。
**/
private $orderItemList;
/**
* 订单子类型:
(1)OTHER: 其他
(2)TAOBAO_TRADE: 淘宝交易
(3)OTHER_TRADE:其他交易
(4)ALLCOATE: 调拨
(5)PURCHASE:采购
**/
private $orderSubType;
/**
* 订单类型:
(1)NORMAL_OUT :正常出库
(2)NORMAL_IN:正常入库
(3)RETURN_IN:退货入库
(4)EXCHANGE_OUT:换货出库
**/
private $orderType;
/**
* 外部订单业务ID,该编号在isv中是唯一编号, 用来控制并发,去重用
**/
private $outBizCode;
/**
* 包裹件数,入库单和出库单中会用到
**/
private $packageCount;
/**
* 应收金额,cod订单必选
**/
private $payableAmount;
/**
* 源订单编号
**/
private $prevOrderCode;
/**
* 发收方发货方信息必须传 手机和电话必选其一
收货方信息
邮编^^^省^^^市^^^区^^^具体地址^^^收件方名称^^^手机^^^电话
如果某一个字段的数据为空时,必须传NA
**/
private $receiverInfo;
/**
* 备注
**/
private $remark;
/**
* 投递时间范围要求,格式'15:20'用分号隔开
**/
private $scheduleEnd;
/**
* 投递时间范围要求,格式'13:20'用分号隔开
**/
private $scheduleStart;
/**
* 投递时延要求:
(1)INSTANT_ARRIVED: 当日达
(2)TOMMORROY_MORNING_ARRIVED:次晨达
(3)TOMMORROY_ARRIVED:次日达
(4)工作日:WORK_DAY
(5)节假日:WEEKED_DAY
**/
private $scheduleType;
/**
* 发货方信息,发收方发货方信息必须传 手机和电话必选其一
邮编^^^省^^^市^^^区^^^具体地址^^^收件方名称^^^手机^^^电话
如果某一个字段的数据为空时,必须传NA
**/
private $senderInfo;
/**
* cod服务费,只有cod订单的时候,才需要这个字段
**/
private $serviceFee;
/**
* 仓库编码
**/
private $storeCode;
/**
* 出库单中可能会用到
运输公司名称^^^运输公司联系人^^^运输公司运单号^^^运输公司电话^^^运输公司联系人身份证号
========================================
如果某一个字段的数据为空时,必须传NA
**/
private $tmsInfo;
/**
* 运单编号,退货单时可能会使用
**/
private $tmsOrderCode;
/**
* 物流公司编码
**/
private $tmsServiceCode;
/**
* 总金额
**/
private $totalAmount;
private $apiParas = array();
public function setAlipayNo($alipayNo)
{
$this->alipayNo = $alipayNo;
$this->apiParas["alipay_no"] = $alipayNo;
}
public function getAlipayNo()
{
return $this->alipayNo;
}
public function setAttributes($attributes)
{
$this->attributes = $attributes;
$this->apiParas["attributes"] = $attributes;
}
public function getAttributes()
{
return $this->attributes;
}
public function setBuyerNick($buyerNick)
{
$this->buyerNick = $buyerNick;
$this->apiParas["buyer_nick"] = $buyerNick;
}
public function getBuyerNick()
{
return $this->buyerNick;
}
public function setExpectEndTime($expectEndTime)
{
$this->expectEndTime = $expectEndTime;
$this->apiParas["expect_end_time"] = $expectEndTime;
}
public function getExpectEndTime()
{
return $this->expectEndTime;
}
public function setExpectStartTime($expectStartTime)
{
$this->expectStartTime = $expectStartTime;
$this->apiParas["expect_start_time"] = $expectStartTime;
}
public function getExpectStartTime()
{
return $this->expectStartTime;
}
public function setInvoinceInfo($invoinceInfo)
{
$this->invoinceInfo = $invoinceInfo;
$this->apiParas["invoince_info"] = $invoinceInfo;
}
public function getInvoinceInfo()
{
return $this->invoinceInfo;
}
public function setIsFinished($isFinished)
{
$this->isFinished = $isFinished;
$this->apiParas["is_finished"] = $isFinished;
}
public function getIsFinished()
{
return $this->isFinished;
}
public function setOrderCode($orderCode)
{
$this->orderCode = $orderCode;
$this->apiParas["order_code"] = $orderCode;
}
public function getOrderCode()
{
return $this->orderCode;
}
public function setOrderFlag($orderFlag)
{
$this->orderFlag = $orderFlag;
$this->apiParas["order_flag"] = $orderFlag;
}
public function getOrderFlag()
{
return $this->orderFlag;
}
public function setOrderItemList($orderItemList)
{
$this->orderItemList = $orderItemList;
$this->apiParas["order_item_list"] = $orderItemList;
}
public function getOrderItemList()
{
return $this->orderItemList;
}
public function setOrderSubType($orderSubType)
{
$this->orderSubType = $orderSubType;
$this->apiParas["order_sub_type"] = $orderSubType;
}
public function getOrderSubType()
{
return $this->orderSubType;
}
public function setOrderType($orderType)
{
$this->orderType = $orderType;
$this->apiParas["order_type"] = $orderType;
}
public function getOrderType()
{
return $this->orderType;
}
public function setOutBizCode($outBizCode)
{
$this->outBizCode = $outBizCode;
$this->apiParas["out_biz_code"] = $outBizCode;
}
public function getOutBizCode()
{
return $this->outBizCode;
}
public function setPackageCount($packageCount)
{
$this->packageCount = $packageCount;
$this->apiParas["package_count"] = $packageCount;
}
public function getPackageCount()
{
return $this->packageCount;
}
public function setPayableAmount($payableAmount)
{
$this->payableAmount = $payableAmount;
$this->apiParas["payable_amount"] = $payableAmount;
}
public function getPayableAmount()
{
return $this->payableAmount;
}
public function setPrevOrderCode($prevOrderCode)
{
$this->prevOrderCode = $prevOrderCode;
$this->apiParas["prev_order_code"] = $prevOrderCode;
}
public function getPrevOrderCode()
{
return $this->prevOrderCode;
}
public function setReceiverInfo($receiverInfo)
{
$this->receiverInfo = $receiverInfo;
$this->apiParas["receiver_info"] = $receiverInfo;
}
public function getReceiverInfo()
{
return $this->receiverInfo;
}
public function setRemark($remark)
{
$this->remark = $remark;
$this->apiParas["remark"] = $remark;
}
public function getRemark()
{
return $this->remark;
}
public function setScheduleEnd($scheduleEnd)
{
$this->scheduleEnd = $scheduleEnd;
$this->apiParas["schedule_end"] = $scheduleEnd;
}
public function getScheduleEnd()
{
return $this->scheduleEnd;
}
public function setScheduleStart($scheduleStart)
{
$this->scheduleStart = $scheduleStart;
$this->apiParas["schedule_start"] = $scheduleStart;
}
public function getScheduleStart()
{
return $this->scheduleStart;
}
public function setScheduleType($scheduleType)
{
$this->scheduleType = $scheduleType;
$this->apiParas["schedule_type"] = $scheduleType;
}
public function getScheduleType()
{
return $this->scheduleType;
}
public function setSenderInfo($senderInfo)
{
$this->senderInfo = $senderInfo;
$this->apiParas["sender_info"] = $senderInfo;
}
public function getSenderInfo()
{
return $this->senderInfo;
}
public function setServiceFee($serviceFee)
{
$this->serviceFee = $serviceFee;
$this->apiParas["service_fee"] = $serviceFee;
}
public function getServiceFee()
{
return $this->serviceFee;
}
public function setStoreCode($storeCode)
{
$this->storeCode = $storeCode;
$this->apiParas["store_code"] = $storeCode;
}
public function getStoreCode()
{
return $this->storeCode;
}
public function setTmsInfo($tmsInfo)
{
$this->tmsInfo = $tmsInfo;
$this->apiParas["tms_info"] = $tmsInfo;
}
public function getTmsInfo()
{
return $this->tmsInfo;
}
public function setTmsOrderCode($tmsOrderCode)
{
$this->tmsOrderCode = $tmsOrderCode;
$this->apiParas["tms_order_code"] = $tmsOrderCode;
}
public function getTmsOrderCode()
{
return $this->tmsOrderCode;
}
public function setTmsServiceCode($tmsServiceCode)
{
$this->tmsServiceCode = $tmsServiceCode;
$this->apiParas["tms_service_code"] = $tmsServiceCode;
}
public function getTmsServiceCode()
{
return $this->tmsServiceCode;
}
public function setTotalAmount($totalAmount)
{
$this->totalAmount = $totalAmount;
$this->apiParas["total_amount"] = $totalAmount;
}
public function getTotalAmount()
{
return $this->totalAmount;
}
public function getApiMethodName()
{
return "taobao.wlb.order.create";
}
public function getApiParas()
{
return $this->apiParas;
}
public function check()
{
RequestCheckUtil::checkMaxLength($this->buyerNick,64,"buyerNick");
RequestCheckUtil::checkNotNull($this->isFinished,"isFinished");
RequestCheckUtil::checkNotNull($this->orderItemList,"orderItemList");
RequestCheckUtil::checkNotNull($this->orderSubType,"orderSubType");
RequestCheckUtil::checkNotNull($this->orderType,"orderType");
RequestCheckUtil::checkNotNull($this->outBizCode,"outBizCode");
RequestCheckUtil::checkMaxLength($this->outBizCode,128,"outBizCode");
RequestCheckUtil::checkMaxLength($this->remark,4000,"remark");
RequestCheckUtil::checkNotNull($this->storeCode,"storeCode");
RequestCheckUtil::checkMaxLength($this->storeCode,64,"storeCode");
RequestCheckUtil::checkMaxLength($this->tmsServiceCode,64,"tmsServiceCode");
}
public function putOtherTextParam($key, $value) {
$this->apiParas[$key] = $value;
$this->$key = $value;
}
}