注意, 使用批量添加, 订单状态默认是到"已完成", 自己出单就不用管了, 如果包裹发到鸟仓再出单, 则需要给每个consignment添加"status":"PENDING"的参数
获取预置信息
创建订单的时候, 需要邮递服务和包裹尺寸, 可以预存到你们系统里, 不经常改变, 不需要每次都请求.
获取邮递服务
地址: GET http://test.birdsystem.com/client/delivery-service?status=ACTIVE
返回
{ "total":2, "success":true, "data":[ { "id": 2667, "company_id": 36, "restrict_max_length_contact": "35", "restrict_max_length_address_line1": "35", "restrict_max_length_address_line2": "35", "restrict_max_length_address_line3": "35", "restrict_max_length_post_code": null, "restrict_regex_post_code": null, "restrict_regex_telephone": null, "name": "代理平邮UK24", "locale_name": "AGENT UNTRACK UK 24", "is_signature": "0", "is_tracking": "0", "is_express": "0", "is_international": "0", "is_customs_required": "0", "is_check_post_code": "1", "is_check_telephone": "0", "is_allow_urgent_consignment": "1", "is_hide_delivery_reference_to_consignment": "1", "special_type": "RM2", "consignment_type": "AGENT_DIRECT", "consignment_notice_enable": "0", "consignment_notice": "", "status": "ACTIVE" }, { "id": 2668, "company_id": 36, "restrict_max_length_contact": "35", "restrict_max_length_address_line1": "35", "restrict_max_length_address_line2": "35", "restrict_max_length_address_line3": "35", "restrict_max_length_post_code": "0", "restrict_regex_post_code": null, "restrict_regex_telephone": null, "name": "代理跟踪UK48", "locale_name": "AGENT TRACK UK 48", "is_signature": "0", "is_tracking": "1", "is_express": "0", "is_international": "0", "is_customs_required": "0", "is_check_post_code": "1", "is_check_telephone": "0", "is_allow_urgent_consignment": "1", "is_hide_delivery_reference_to_consignment": "1", "special_type": "RM2", "consignment_type": "AGENT_DIRECT", "consignment_notice_enable": "0", "consignment_notice": "", "status": "ACTIVE" } ], "moduleName":"client" }
注意 is_hide_delivery_reference_to_consignment 的值为1时,没有跟踪号。
获取可用的海关属性
往代理专线订单添加产品的时候, 需要产品海关属性, 可以预存到你们系统里, 不经常改变, 不需要每次都请求.
创建订单
地址: POST http://test.birdsystem.com/client/consignment/Post-Pending-Consignment-With-Products-Json
参数 说明
product_customs_property: 海关属性可以用名称,也可以用ID。 [必填]
product_name_cn:产品中文名称 ,不填写会影响清关文件 [必填]
sales_price: 订单在销售平台的价格,(不填的话会自动调用产品申报价格)。 [选填]
sales_reference:需要填写销售跟踪号请自行添加参数 sales_reference, 例如 "sales_reference":"12345"
weight:重量,单位为g
price_customs_export:海关出口报关价,单位为美元。(用product_name或name、product_name_cn,或name_cn、price_customs_export或 price都可以上传对应的值)
client_ref:对应客户sku,有传则可配置面单显示此字段,便于拣货。 [必填]
custom_identity_reference:自定义唯一跟踪号,属于排重字段,防止重复订单,填写后会检查同一订单类型下6个月内是否有重复订单,重复则报错提示。
brand:品牌 (非必填)
attachment-url:产品图片URL,传送图片链接供飞鸟质检审核产品。新产品图片URL为必填,已存在的产品不用传图片URL(只能传网上的图片,不能传本地的)
[ { "delivery_service_id": "5198", "type":"AGENT_DIRECT", "business_name": "", "contact": "Rochelle Kerr", "address_line1": "23 Portelet Court", "city": "London", "county": "London", "post_code": "N1 5TL", "country_iso": "GB", "telephone": "07983-467763-467763", "custom_identity_reference":"224SF242321", "line": "1", "products": [ { "product_name": "3apple29", "product_name_cn":"3苹果29", "brand":"asd品牌", "client_ref":"a4624", "price_customs_export": "3", "sales_price":"10", "weight": "300", "quantity": "1", "product_customs_property":["其它"], "attachment-url":"http://www.qqma.com/imgpic2/cpimagenew/2018/4/5/6e1de60ce43d4bf4b9671d7661024e7a.jpg" }, { "product_name": "4apple29", "product_name_cn":"4苹果29", "brand":"asd品牌", "client_ref":"a5456", "price_customs_export": "3", "sales_price":"10", "weight": "300", "quantity": "1", "product_customs_property":["其它"], "attachment-url":"http://www.qqma.com/imgpic2/cpimagenew/2018/4/5/6e1de60ce43d4bf4b9671d7661024e7a.jpg" } ] } ]
line: 创建失败的时候, 会告知是哪一个line出错.
返回
data是创建成功的订单号和跟踪号的键值对 json对象
内部下单逻辑:
1.正常服务未设置需要预审产品的,下单用这个服务不用填attachment-url:图片URL;(此图片URL字段,对于无需预审的服务,不用填;有些需要预审的,且需要传图片URL的,对于已经在系统备案的产品,下单不用传,填的是新的client_ref:客户sku,这个客户sku第一次要传,所以图片URL字段可设置为非必填字段,但必须对接到贵司erp)
2.有些服务,我们系统会勾选上产品需要预审的限制,这类服务下单,从erp推单过来,系统会内部判断client_ref:客户sku是否在我们系统这个客户下存在,且是正常状态;
2.1.如果是正常状态的产品,客户传的订单除了客户sku与数量不变外,其余与系统备案的产品信息不一致的,到我们系统会自动以系统备案的产品信息为准,并将备案的产品信息更新到订单的产品中;
2.2.如果是非正常状态的产品,且非待预审状态的产品,会弹出报错提示,提示这个产品有问题;
2.3.如果判断在本系统没有此client_ref:客户sku,则会通过客户传的产品信息自动创建一个新产品,新产品状态为待预审状态,允许用此产品下单;之后质检部会在24小时检查此产品是否有问题;