5-2. 批量创建退货订单

获取退货服务ID

地址:  http://test.birdsystem.com/client/return-consignment-action

字段注释类型

id

系统ID

INT(10)

name

名称

VARCHAR

price价格DECIMAL(10,2)

type

退货服务类型

ENUM('CONTAINER','SELLER','DISPOSE','CHECK','TRANSFER')

CONTAINER 退货上架,

SELLER 退货等待回国,

DISPOSE 退货销毁

CHECK 退货查验

TRANSFER 退货转运

status

状态


返回

{
    "total": 1,
    "data": [
        {
            "id": 92,
            "company_id": 36,
            "name": "退货上架",
            "cost": "0.000",
            "weight_unit_price": "0.000",
            "volume_unit_price": "0.000",
            "sku_unit_price": "0.000",
            "product_unit_price": "0.000",
            "type": "CONTAINER",
            "return_consignment_type": "SINGLE",
            "status": "ACTIVE",
            "primary_keys": [
                "id"
            ]
        }
    ],
    "success": true,
    "moduleName": "client"
}

创建订单

将上一步获得的服务 id 填入 return_consignment_action-id 参数

url

http://test.birdsystem.com/client/Consignment/Post-Pending-Consignment-With-Products-Json

method

post

body

[
    {
        "contact": "Norman Drury",
        "business_name": null,
        "address_line1": "3, Northam Close",
        "address_line2": "Marshside",
        "address_line3": null,
        "city": "Southport",
        "county": "Merseyside",
        "post_code": "PR9 9GA",
        "country_iso": "GB",
        "telephone": "01704 226830",
        "email": null,
        "return_consignment_action-id": "92",
        "sales_reference": "2",
		"sales_order_id": "110222319566-0",
        "special_instruction": null,
        "type": "RETURN",
        "products":[
        	{"client_sku":"983-494721","quantity":1},
        	{"id":214598,"quantity":1}
        ]
    }
]

返回

{
  "success": true,
  "data": [
    {
      "id": 1612120020000011,
      "company_id": 2,
      "client_id": 1,
      "consignment_product_quantity": 9,
      "consignment_product_reference": "1,2",
      "delivery_service_id": 1471,
      "delivery_service_id_internal": 1471,
      "delivery_package_size_id": 432,
      "delivery_package_size_id_internal": 432,
      "total_price": "0.00",
      "total_cost": "0.00",
      "...": "...",
	  "contact": "Norman Drury",
      "business_name": null,
      "address_line1": "3, Northam Close",
      "address_line2": "Marshside",
      "address_line3": null,
      "city": "Southport",
      "county": "Merseyside",
      "post_code": "PR9 9GA",
      "country_iso": "GB",
      "telephone": "01704 226830",
      "email": null,
      "sales_reference": "2"
    }
  ]
}

参数

is_urgent

是否是紧急订单


TINYINT(1)

return_consignment_action-id退货服务ID必填INT(4)

sales_reference

销售跟踪号


VARCHAR(50)

sales_order_id

eBay或Amazon订单ID

(注:对eBay订单,如果客户有多个eBay账户,那么请把eBay卖家ID信息

也填在这里,可以按以下格式: “SellerUserID : OrderID” )


VARCHAR(50)

delivery_reference

邮递跟踪号(注:此字段能否设置成功还要看邮递服务设置,如果传了这个字段没有设置成功,请咨询客服)


VARCHAR(50)

custom_identity_reference


自定义惟一标识

(注: 如果填写了,会进行检测,同一种类型同一站点下的订单,6个月内不能有重复的标识)

重复的话会返回: {"success":false,"message":"Duplicate consignment identity reference [....]"}


VARCHAR(50)

contact

联系人

必填

VARCHAR(100)

business_name

公司


VARCHAR(255)

address_line1

地址行1


VARCHAR(100)

address_line2

地址行2


VARCHAR(100)

address_line3

地址行3


VARCHAR(100)

city

城市


VARCHAR(50)

county

省/郡


VARCHAR(50)

post_code

邮编


VARCHAR(10)

country_iso

国家

必填

CHAR(2)

telephone

电话


VARCHAR(50)

email

电子邮件


VARCHAR(255)

special_instruction:

备注1


VARCHAR(255)

neighbour_instruction:

备注2


VARCHAR(255)

type

订单类型
'RETURN'

products

产品

必填

包含 

id /client_sku/reference 和quantity的json对象例如:

[
 {"client_sku":”IP-XX3355”,"quantity":5},
 {"id":2,"quantity":4},
{"reference":2,"quantity":4}

]

reference是基于客户对批量订单产品字段的设置, 自动识别为ID或者SKU.

对于代理专线订单, 需要传如下格式的产品:

[
 {"name":”IP-XX3355”,"quantity":5,"weight":5,"price":5},

]

parcel_pieces多包裹信息可选(如果仅一个包裹时可不用填)

数据结构如下:

[

{"weight":500, "length":25, "width":20, "depth":15, "description":"table"},

{"weight":400, "length":22, "width":18, "depth":13, "description":"chair"},

]

备注:重量为克(g),长度为毫米(mm)


此种方式需在POST前确保所有数据都正确,数据不正确的,将报错 不能创建订单。 附上相关用例文件: 创建订单用例.postman_collection.json