您的位置 : 文档中心 -> API信息

com.alibaba.trade:alibaba.trade.general.CreateOrder-1
创建订单(大市场普通订单) 免费

创建大市场订单,支持支付宝担保交易,担保交易、账期交易和交易4.0。建议先试用预创建订单(alibaba.trade.general.preorder),再根据返回的信息调用本API

API用户授权类型

需要授权

系统级输入参数

名称 类型 是否必须 描述
_aop_timestamp String 请求时间戳
_aop_signature String 请求签名
access_token String 用户授权令牌

应用级输入参数

名称 类型 是否必须 描述 示例值 默认值
+ cargoGroups alibaba.openplatform.trade.BizCargoGroup[] 商品信息列表。JSON串,其中:offerId,quantity(数量),specId(sku offer对应的specId),unitPrice(单价)这几个字段必须有值 [ { "buyerCharge": false, "chooseFreeFreight": 0, "free": false, "isVirtual": 0, "offerId": 1234567890, "priceFactor": 1, "quantity": 2, "specId": "891c26ad4c825b5a8b9cddbe383376a8", "unitPrice": 2 } ]
+ invoiceGroup alibaba.openplatform.trade.BizInvoiceGroup 发票信息,若没有可不填。
+ otherInfoGroup alibaba.openplatform.trade.BizOtherInfoGroup 其它信息,针对订单级别。JSON串格式,重要字段:message(买家留言),totalAmount(必填字段,总金额= 货品总金额 + 运费,单位: 元),mixAmount(混批金额,必填),mixNumber(混批数量),sumCarriage(总运费,单位元),filledCarriage(用户填写的运费 单位:元),promotionId(优惠id,如果有订单级别优惠,必须传此值才有效),additionalFee(附加费,单位元) { "additionalFee": 0, "chooseFreeFreight": "0", "discountFee": 0, "filledCarriage": 0, "guaranteeFee": 0, "message": "testCreateOrder", "needCheckCode": false, "needCheckInstant": -1, "needInstallment": false, "needRegist": false, "orderCodFee": 0, "payEntry": "multiStep", "payWay": "42", "sumCarriage": 0, "supportInvoice": false, "toleranceFreight": "0", "totalAmount": 4, "totalProductAmount": 0, "umpSysAvailble": "1", "mixAmount": "3", "mixNumber": "3" }
+ receiveAddressGroup alibaba.openplatform.trade.BizReceiveAddressGroup 收货地址。JSON串,主要字段:addressId(用户在阿里巴巴保存的地址的id。若能提供,其他可以不填。若不能提供,请设为-1),fullName(收货人姓名),areaCode,cityCode,provinceCode(县/区,市,省份编码。参考”行政区划代码“),address(街道地址),mobile(手机),phone(电话),postCode(邮编) "address": "网商路699号", "addressCode": "330108", "areaCode": "330108", "fullName": "张三2222", "group": "123", "isDefault": false, "isTemp": false, "isText": false, "mobile": "15170421517", "postCode": "310052" }

返回结果

名称 类型 是否必须 描述 示例值
+ result alibaba.openplatform.trade.result.TradeCreateGeneralOrderResult
errorCode String 错误码
errorMessage String 错误信息
extErrorMessage String 错误信息扩展

返回结果

成功下单后返回报文示例

  {“result”:{“success”:true,“commitResults”:[{“afterFlowIds”:[“insure”],“customOffer”:false,“orderAmmount”:22400,“orderId”:52305873315498520,“success”:true,“orderModel”:{“sellerAlipayId”:“2088611383470360”,“buyerUserId”:1623492085,“orderEntryModel”:[{“id”:52305873315498520,“tbId”:52305873315498520,“succSumPayment”:0,“outOrderId”:“462330873565”}],“buyerAlipayId”:“2088611492691533”,“buyerMemberId”:“b2b-1623492085”,“id”:52305873315498520,“tradeTypeStr”:“50060”,“sellerMemberId”:“b2b-263139113200ef8”,“succSumPayment”:22400,“sellerUserId”:2631391132,“outOrderId”:“462330873565”}}],“mutilOrderPublicData”:{}}} 

下单入参报文示例

  {"otherInfoGroup":{"additionalFee":0,"chooseFreeFreight":"0","discountFee":0,"filledCarriage":0,"guaranteeFee":0,"message":"testCreateOrder","needCheckCode":false,"needCheckInstant":-1,"needInstallment":false,"needRegist":false,"orderCodFee":0,"payEntry":"multiStep","payWay":"42","sumCarriage":2,"supportInvoice":false,"toleranceFreight":"0","totalAmount":22400,"totalProductAmount":0,"umpSysAvailble":"1"},"cargoGroups":[{"buyerCharge":false,"chooseFreeFreight":0,"free":false,"isVirtual":0,"offerId":557235167116,"priceFactor":1,"quantity":2,"specId":"833f4c93c1d514725808adfb6e9ca5a3","unitPrice":258}],"receiveAddressGroup":{"address":"网商路699号","addressCode":"330108","areaCode":"330108","fullName":"test","group":"123","isDefault":false,"isTemp":false,"isText":false,"mobile":"15170421517","postCode":"310052"}} 

错误码

错误码 错误描述 解决方案
FAIL_BIZ_CARGO_PRICE_AND_DISCOUNT_HAS_CHANGED 您订购的货品价格或者折扣发生变化,请重新确认订单或者联系卖家。 cargoGroups.unitPrice的价格不正确,这里需要填写货品单价,注意:单位为元
PARAM:INVALID_PARAM_VALUE:TotalAmount TotalAmount 和后端计算不一致 订单总价不对,可以通过preOrder接口获得
PARAM:INVALID_PARAM_VALUE:Payway 不支持的交易类型 入参时payWay的值使用preOrder接口返回值中curSelectedTradeMode的tradeWay节点值。
FAIL_BIZ_MIX_CONDITION_HAS_CHANGED 混批条件已发生变化 mixAmount、mixNumber参数可不传
500 {"errorCode":"500","errorMessage":"500"} 参数反序列化失败,检查需要反序列化的参数,如果参数值为空,可不传递该参数。

API工具

SDK 示例