向ERP写入订单
简要描述:
- 此接口用于向ERP系统直接写入一张订单。
请求URL:
- 沙箱环境
http://api.mall.sandbox.yhsms.com.cn/Mall/Erp/ErpService.svc/TradeTransferToErp - 生产环境
http://api.mall.yhsms.com.cn/Mall/Erp/ErpService.svc/TradeTransferToErp
请求方式:
- POST
参数:
| 参数名 | 必选 | 类型 | 说明 |
|---|---|---|---|
| PlatformID | 是 | string | YHDT号 |
| UserAccessToken | 是 | string | 接口授权数据 |
| UID | 是 | string | 益华云用户UID,指明该笔订单所属用户 |
| MasterXml | 是 | string | 订单主表数据,XML格式,详见下方说明 |
| DetailXml | 是 | string | 订单明细数据,XML数组格式,详见下方说明 |
| PayXml | 是 | string | 订单支付数据,XML数组格式,详见下方说明 |
| TH | 是 | int | 是否退货,0为否,1为是 |
| Audit | 是 | int | 是否自动审核及出库,0为否,1为是 |
| StoredProcedureName | 是 | string | ERP接收方法,详见下方说明 |
- MasterXml,订单主表数据结构说明
| XML节点名 | 类型 | 必选 | 说明 |
|---|---|---|---|
| TradeType | string | 订单类型(数据结构参见TradeType基本信息) | |
| CreateTime | datetime | 是 | 创建时间 |
| OriginalMoney | decimal | 是 | 订单码洋 |
| TotalMoney | decimal | 是 | 订单总价 |
| FactMoney | decimal | 是 | 实际支付金额 |
| PayStatus | String(32) | 是 | 支付状态 |
| ContractFeeBefore | decimal | 是 | 订单优惠(营销策略,会员卡折扣等) |
| ContractFee | decimal | 是 | 结算优惠(卡券、积分等抵扣) |
| OtherFee | decimal | 否 | 其它优惠 |
| ReductionFee | decimal | 否 | 减免金额 |
| Freight | decimal | 是 | 邮费 |
| LateFee | decimal | 否 | 滞纳金(用于租借类订单) |
| PayTime | datetime | 是 | 支付时间 |
| RefundFee | decimal | 否 | 退款金额 |
| RefundTime | datetime | 否 | 退款时间 |
| TradeSource | String(32) | 是 | 订单来源(数据结构参见TradeSource基本信息) |
| ProvinceID | String(32) | 否 | 买家省份 |
| CityID | String(32) | 否 | 买家城市 |
| DistrictID | String(32) | 否 | 买家区域 |
| BuyerAddress | String(128) | 是 | 买家详细地址 |
| BuyerName | String(32) | 是 | 买家姓名 |
| BuyerPhone | String(32) | 是 | 买家电话 |
| OuterID | String(32) | 否 | 外部订单号 |
| ReceiptID | String(32) | 否 | 结算单据号 |
| Remark | String(MAX) | 否 | 订单备注 |
| SaleUID | String(32) | 否 | 销售员UID |
MasterXml参数示例
<master><master TradeType=\"Fixed\" TradeID=\"6647762366539116544\" CreateTime=\"2020/3/23 15:54:17\" OriginalMoney=\"106.4000\" FactMoney=\"79.8\" ContractFeeBefore=\"26.6000\" ContractFee=\"0.0000\" OtherFee=\"0.0000\" ReductionFee=\"0.0000\" Freight=\"0.0000\" LateFee=\"0.0\" PayTime=\"2020/3/23 15:55:15\" RefundFee=\"0.0000\" RefundTime=\"1900/1/1 0:00:00\" TradeSource=\"TS_WX\" ProvinceID=\"山东\" CityID=\"泰安\" DistrictID=\"泰山区\" BuyerAddress=\"泰安\" BuyerName=\"未设置昵称\" BuyerPhone=\"15618937285\" OuterID=\"\" ReceiptID=\"6647762547544305664\" Remark=\"\" SaleUID=\"\" PayStatus=\"2\" TotalMoney=\"79.8000\" ZipCode=\"\" DelayTime=\"1900/1/1 0:00:00\" ThirdPartyData=\"\" /></master>- DetailXml,订单明细数据结构说明
| XML节点名 | 类型 | 必选 | 说明 |
|---|---|---|---|
| GoodsID | string | 商品编码 | |
| yhProductID | string | 是 | 益华商品全局唯一码 |
| GoodsNumber | decimal | 是 | 商品数量 |
| OldPrice | decimal | 是 | 商品原价 |
| Price | decimal | 是 | 商品销价 |
| ContractFeeItem | decimal | 是 | 订单优惠分摊金额 |
| ReductionFeeItem | decimal | 是 | 结算优惠分摊金额 |
| OtherFeeItem | decimal | 是 | 其它优惠分摊金额 |
| CreateTime | datetime | 是 | 创建时间 |
| Remark | String(MAX) | 否 | 明细备注 |
DetailXml参数示例
<detail><detail GoodsID=\"6646654848093933568\" yhProductID=\"268E6E1D13754EE9878E31A6F7EB9C43\" GoodsNumber=\"1\" OldPrice=\"32.8000\" Price=\"24.6000\" ContractFeeItem=\"8.2000\" OtherFeeItem=\"0.0000\" ReductionFeeItem=\"0.0000\" CreateTime=\"2020/3/23 15:54:20\" Remark=\"\" /><detail GoodsID=\"6645888394863984640\" yhProductID=\"3F303A1104AC4A80A438E306F8AFCCA3\" GoodsNumber=\"1\" OldPrice=\"36.8000\" Price=\"27.6000\" ContractFeeItem=\"9.2000\" OtherFeeItem=\"0.0000\" ReductionFeeItem=\"0.0000\" CreateTime=\"2020/3/23 15:54:20\" Remark=\"\" /><detail GoodsID=\"6645888392884273152\" yhProductID=\"E580F5216E604C50A0D7472298FEEC60\" GoodsNumber=\"1\" OldPrice=\"36.8000\" Price=\"27.6000\" ContractFeeItem=\"9.2000\" OtherFeeItem=\"0.0000\" ReductionFeeItem=\"0.0000\" CreateTime=\"2020/3/23 15:54:20\" Remark=\"\" /></detail>- StoredProcedureName,ERP接收方法说明
| XML节点名 | 类型 | 必选 | 说明 |
|---|---|---|---|
| UP_TradeTransferToSale | string | 是 | 传输至ERP订单 |
| UP_TradeTransferToRetail | string | 是 | 传输至ERP零售 |
| UP_TradeTransferToWholesale | string | 是 | 传输至ERP批销 |
PayXml参数示例
<pay><pay FactMoney=\"79.8\" PayChannel=\"PC_WX\" /></pay>- PayXml,订单支付数据结构说明
| XML节点名 | 类型 | 必选 | 说明 |
|---|---|---|---|
| FactMoney | decimal | 是 | 支付金额 |
| PayChannel | string | 是 | 支付渠道 |
返回示例
{
"Code":"0",
"Method":0,
"Compressed":false,
"Encrypted":false,
"Message":{"OuterTradeID":"6359657698853654528"}
}返回参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| Message | string | ERP订单编号 |
备注
- 更多返回错误代码请看首页的错误代码描述
文档更新时间: 2020-05-09 17:25 作者:张国伟