Skip to main content

createOrders:创建订单

注意:创建订单后,需要同步订单里面所有商品所有仓库的库存

入参

参数名称

是否必须

类型

描述

sKey

Y

String

用户令牌

client_num

Y

String

下单客户编号

status

N

String

订单状态,可选pending(待审核),stock_up(待出库);当指定为stock_up的时候相当于对订单做自动审核,默认pending

distrib_mode

N

String

配送方式,可选值(快递、顺丰快递、送货上门、上门自取、物流货运、其他)和系统设置->配送方式设置有关,默认快递

address_id

N

Int

客户收货地址ID,当配送方式不为上门自取时有效;默认值为下单客户的默认地址,收货地址ID的获取可以参考 收货地址

freight

N

Float

订单运费,当配送方式不为上门自取时有效;精度和系统设置->数字精度->订单金额精度有关,最多两位小数

delivery_date

N

String

交货日期,YYYY-MM-DD的格式

discount_total

N

Float

强制指定订单的结算价,如果传入明细的价格和传入的结算价不能反算,则会开启特批价进行兼容,精度和系统设置->数字精度->订单金额精度有关,最多两位小数

remark

N

String

订单备注

body

Y

Object

订单明细

body

参数名称

是否必须

类型

描述

options_goods_num

Y

String

规格商品编码

orders_price

Y

Float

订货价格,精度和系统设置->数字精度->商品价格精度有关,最多四位小数

orders_number

Y

Float

订货数量,精度和系统设置->数字精度->商品数量精度有关,最多四位小数

list_type

N

String

订购方式,标记是否是赠品;buy:正常购买,gift:赠品;默认buy

remark

N

String

订单商品备注

入参示例
{
    "f": "createOrders",
    "v": {
        "sKey": "e5fbdb372f95d10b5986cf0ce6defba1",
        "client_num": "10331",
        "status": "pending",
        "distrib_mode": "快递",
        "address_id": 3619,
        "freight": 3.55,
        "delivery_date": "2020-08-30",
        "discount_total": 255.56,
        "remark": "erp create",
        "body": [
            {
                "options_goods_num": "00021002",
                "orders_price": "11.5555",
                "orders_number": "5.5555",
                "list_type": "buy",
                "remark": "erp创建订单商品1"
            },
            {
                "options_goods_num": "00021002",
                "orders_price": "11.4444",
                "orders_number": "4.4444",
                "list_type": "gift",
                "remark": "erp创建订单赠品1"
            },
            {
                "options_goods_num": "00021003",
                "orders_price": "11.3333",
                "orders_number": "3.3333",
                "list_type": "buy",
                "remark": "erp创建订单商品2"
            },
            {
                "options_goods_num": "00031003",
                "orders_price": "11.2222",
                "orders_number": "2.2222",
                "list_type": "buy",
                "remark": "erp创建订单商品3"
            }
        ]
    }
}
返参

参数名称

类型

描述、 返回字段

rStatus

String

100:正常 其他:异常

message

String

信息描述

rData

Object

具体信息

返参示例
{
    "rStatus": 100,
    "message": "订单创建成功",
    "rData": []
}