向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   作者:张国伟