交易请求报文
JSON:
{
"request_type": "barcode_pay_request",
"isspid": "39493002",
"pos_id": "1511300001",
"store_id": "1511300001",
"pos_seq": "1511300000002",
"user_id": "user01",
"system_id": "8888",
"device_ip": "127.0.0.1",
"latitude": "+37.12",
"longitude": "-121.213",
"memo": "订单备注",
"barcode_pay_request": {
"barcode_info": "1234567890123456",
"pay_type": "502",
"tx_amt": "1000",
"goods_detail": [
{
"goods_id": "apple-01",
"payment_goods_id": "20010001",
"goods_name": "ipad",
"quantity": 1,
"price": 200000,
"goods_category": "34543238",
"body": "特价手机",
"show_url": "http://www.alipay.com/xxx.jpg"
},
{
"goods_id": "apple-02",
"payment_goods_id": "20010002",
"goods_name": "ipad2",
"quantity": 1,
"price": 200000,
"goods_category": "34543239",
"body": "特价手机2",
"show_url": "http://www.alipay.com/xxx2.jpg"
}
],
"extend_params": {
"hb_fq_num": "3",
"hb_fq_seller_percent": "100",
"split_flag": "R",
"plan_split_date": "20230418",
"split_info": {
"keep_amt": "800",
"split_list": [
{
"merchant_id": "10000000000001",
"div_amt": "150"
},
{
"merchant_id": "10000000000002",
"div_amt": "50"
}
]
}
},
"use_coupon": "1"
},
"sign": "EB0F3B9404AAFC27C520C1D64A69C169"
}
XML:
<?xml version="1.0" encoding="GBK"?>
<business_trans>
<request_type>barcode_pay_request</request_type>
<isspid>39493002</isspid>
<pos_id>1511300001</pos_id>
<store_id>1511300001</store_id>
<pos_seq>1511300000002</pos_seq>
<user_id>user01</user_id>
<system_id>8888</system_id>
<device_ip>127.0.0.1</device_ip>
<latitude>+37.12</latitude>
<longitude>-121.213</longitude>
<memo>订单备注</memo>
<barcode_pay_request>
<barcode_info>1234567890123456</barcode_info>
<pay_type>502</pay_type>
<tx_amt>10</tx_amt>
<goods_detail><![CDATA[商品信息(JSON)]]></goods_detail>
<extend_params><![CDATA[扩展参数(JSON)]]></extend_params>
<use_coupon>1</use_coupon>
</barcode_pay_request>
</business_trans>
交易请求报文说明
节点名称 | 中文名称 | 类型 | 说明 | 是否必填 |
---|---|---|---|---|
sign | 报文签名 | String(32) | 请求报文格式为JSON时必填 计算签名方式请看2.1章节 | 可空 |
request_type | 请求类型 | String(32) | 固定值:barcode_pay_request | 必填 |
isspid | 商户号 | String(8) | 翼码商户号,由翼码提供 | 必填 |
pos_id | 终端号 | String(20) | 商户自定义终端号 | 必填 |
store_id | 门店号 | String(20) | 商户自定义门店号 | 必填 |
pos_seq | 支付请求流水号 | String(32) | 同一个翼码商户号下唯一,不可重复使用,且大于12位 | 必填 |
user_id | 操作员标识 | String(20) | 操作员号 | 可空 |
system_id | 系统平台号 | String(4) | 由翼码提供 | 必填 |
device_ip | 设备IP | String(15) | 发起交易的门店或设备公网IP(仅支持IPv4) 根据央行要求必须传真实公网IP 否则商家会被风控!!! | 可空 |
latitude | 纬度 | String(9) | 发起交易的门店的经纬度信息 纬度格式:+表示北纬,-表示南纬;纬度整数位不超过2位,小数位不超过6位。 经纬度需同时传入 根据银联要求,银联二维码交易时,经纬度信息必填。 若为空将根据ip地址转换,不精确的情况可能会触发风控 | 可空 |
longitude | 经度 | String(9) | 发起交易的门店的经纬度信息 经度格式:+表示东经,-表示西经;经度整数位不超过3位,小数位不超过5位。 经纬度需同时传入 根据银联要求,银联二维码交易时,经纬度信息必填。 若为空将根据ip地址转换,不精确的情况可能会触发风控 | 可空 |
memo | 订单备注 | String(128) | 可空 | |
barcode_pay_request ->barcode_info | 条码支付动态码 | String(64) | 条码支付动态码 | 必填 |
barcode_pay_request ->pay_type | 支付类型 | String(3) | 502:支付宝 503:微信支付 512:银联二维码 516:数字人民币 519:会员余额支付 传空则根据付款码规则自动识别类型 | 可空 |
barcode_pay_request ->tx_amt | 交易金额 | Number(9) | 支付金额,单位为分,不支持小数点 | 必填 |
barcode_pay_request ->goods_detail | 商品信息 | JSONArray | 订单包含的商品信息列表,详细参数见下表 使用XML格式报文时,建议使用CDATA标签包裹内容 | 可空 |
barcode_pay_request ->extend_params | 扩展参数 | JSON | 用于扩展一些特殊的支付参数字段,详细参数见下表 使用XML格式报文时,建议使用CDATA标签包裹内容 | 可空 |
barcode_pay_request ->use_coupon | 是否使用优惠券 | String(1) | 0:不使用优惠 1:可使用优惠 传空默认为1 具体应用: a.微信可使用优惠时,翼码传送已配置的订单优惠标记(goods_tag)给微信 b.支付宝不可使用优惠时,翼码将不参与优惠计算的金额(undiscountable_amount)取订单金额传送给支付宝 | 可空 |
自定义门店号(store_id)和自定义终端号(pos_id)需经过4.1终端绑定交易接口绑定成功过的值才可以调用,绑定一次即可不需要重复绑定。
goods_detail 商品信息 (JSONArray)
JSON节点 | 类型 | 说明 | 是否必填 | 范例 |
---|---|---|---|---|
goods_id | String(32) | 商品的编号 | 必填 | apple-01 |
payment_goods_id | String(32) | 支付平台商品编号 | 可空 | 20010001 |
goods_name | String(256) | 商品名称 | 必填 | ipad |
quantity | Number(9) | 商品数量 | 必填 | 1 |
price | Number(8) | 商品单价,单位为分 | 必填 | 200000 |
goods_category | String(24) | 商品类目 仅支付宝、银联二维码时生效 | 可空 | 34543238 |
body | String(1000) | 商品描述信息 仅支付宝时生效 | 可空 | 特价手机 |
show_url | String(400) | 商品的展示地址 仅支付宝时生效 | 可空 | http://www.alipay.com/xxx.jpg |
addn_info | String(100) | 附加信息 仅银联二维码时生效 | 可空 | 商品图片 http://www.95516.com/xxx.jpg |
goods_detail 样例:
[
{
"goods_id" : "apple-01",
"payment_goods_id" : "20010001",
"goods_name" : "ipad",
"quantity" : 1,
"price" : 200000,
"goods_category" : "34543238",
"body" : "特价手机",
"show_url" : "http://www.alipay.com/xxx.jpg",
"addn_info" : "商品图片 http://www.95516.com/xxx.jpg"
},
{
"goods_id" : "apple-02",
"payment_goods_id" : "20010002",
"goods_name" : "ipad2",
"quantity" : 1,
"price" : 200000,
"goods_category" : "34543239",
"body" : "特价手机2",
"show_url" : "http://www.alipay.com/xxx2.jpg",
"addn_info" : "商品图片 http://www.95516.com/xxx.jpg"
}
]
extend_params 扩展参数 (JSON)
JSON节点 | 类型 | 说明 | 是否必填 | 范例 |
---|---|---|---|---|
hb_fq_num | String | 花呗分期数,仅支持传入3、6、12,其他期数暂不支持 仅支付宝时生效 hb_fq_num与hb_fq_seller_percent必须同时传入且使用花呗分期商品明细必传 | 可空 | 3 |
hb_fq_seller_percent | String | 花呗卖家承担收费比例,商家承担手续费传入100,用户承担手续费传入0,仅支持传入100、0两种,其他比例暂不支持 仅支付宝时生效 hb_fq_num与hb_fq_seller_percent必须同时传入且使用花呗分期商品明细必传 | 可空 | 100 |
split_flag | String | 分账标识 N:不分账 R:实时分账 D:延时分账 不传该节点时,将按控制台配置处理 该节点与分账功能相关具体联系业务确认开通功能 | 可空 | R |
plan_split_date | String | 预分账日期,格式:yyyymmdd 仅延时分账类型(split_flag=D)时支持传入 | 可空 | 20230418 |
split_info | JSON | 分账信息 仅支持请求实时分账split_flag=R 该节点与分账功能相关具体联系业务确认开通功能 | 可空 |
分账业务相关的特别说明:
1. split_flag=N 不分账时,split_info不允许传入;
2. split_flag=R 实时分账时,split_info必传,其中keep_amt与div_amt叠加必须全额分完整笔订单;
3. split_flag=D 延时分账时,split_info不允许传入,在后续流程中调用延迟交易确认接口完成分账,或使用翼码分账系统界面进行分账。
split_info 分账信息
JSON节点 | 类型 | 说明 | 是否必填 | 范例 |
---|---|---|---|---|
is_clean_split | String | N:不使用净值分账 Y:使用净值分账 不传默认为N,即不使用净值分账 净值分账目前仅对部分通道开放,使用此能力前请先与技术支持确认 净值分账仅在交易手续费内扣时才起作用 当使用净值分账时,分账信息和分账明细必须要传分账比例,且分账方自留比例(keep_percentage)与所有分账比例(div_percentage)之和必须要为100% | 可空 | Y |
keep_amt | String | 分账方自留金额,单位为分,可传0表示不自留 不使用净值分账(is_clean_split=N)时,该节点必填,分账方自留比例(keep_percentage)节点无效 | 可空 | 1000 |
keep_percentage | String | 分账方自留比例,单位为%,最多支持小数点后两位,可传0表示不自留 使用净值分账(is_clean_split=Y)时,该节点必填,分账方自留金额(keep_amt)节点无效 | 可空 | 50.26 |
split_list | Array | 分账明细 | 必填 |
split_list 分账明细
JSON节点 | 类型 | 说明 | 是否必填 | 范例 |
---|---|---|---|---|
merchant_id | String | 分账接收方的分账商户号 | 必填 | 10000000000001 |
div_amt | String | 分账金额,单位为分,必须大于0 不使用净值分账(is_clean_split=N)时,该节点必填,分账比例(div_percentage)节点无效 | 可空 | 1000 |
div_percentage | String | 分账比例,单位为%,最多支持小数点后两位,必须大于0 使用净值分账(is_clean_split=Y)时,该节点必填,分账金额(div_amt)节点无效 | 可空 | 23.55 |
若业务涉及100%分账给接收方,请于业务对接人联系申请使用净值分账功能。
extend_params 样例:
{
"hb_fq_num": "3",
"hb_fq_seller_percent": "100",
"split_flag": "R",
"plan_split_date": "20230418",
"split_info": {
"keep_amt": "800",
"split_list": [
{
"merchant_id": "10000000000001",
"div_amt": "150"
},
{
"merchant_id": "10000000000002",
"div_amt": "50"
}
]
}
}
交易返回报文
JSON:
{
"response_type": "barcode_pay_response",
"isspid": "39493002",
"pos_id": "8888888888",
"pos_seq": "2018121400000001",
"trans_time": "20181214135756",
"pay_type": "502",
"extend": "<![CDATA[]]>",
"sys_seq": "5d170b6b78a0cb13",
"buss_discount_amt": 0,
"platform_discount_amt": 0,
"discount_amt": 0,
"mdiscount_amt": 0,
"coupon_amt": 0,
"mcard_amt": 0,
"mcoupon_amt": 0,
"point_amt": 0,
"memo": "订单备注",
"alipay_res_info": {
"trade_no": "2018121422001429700548119225",
"out_trade_no": "0001056562600000122014",
"atu_trade_no": "2018121422001429700548119225",
"atu_out_trade_no": "0001056562600000122014",
"buy_user_id": "",
"buy_logon_id": "",
"gmt_payment": "20181214135757",
"total_fee": "1",
"receipt_amount": "1",
"invoice_amount": "1",
"buyer_pay_amount": "1",
"charge_amount": "0",
"fund_bill_list": [
{
"amount": "1",
"fund_channel": "ALIPAYACCOUNT"
},
{
"amount": "1",
"fund_channel": "COUPON"
}
],
"voucher_detail_list": [
{
"amount": "1000",
"id": "2015102600073002039000002D5O",
"memo": "学生专用优惠",
"merchant_contribute": "900",
"name": "XX超市5折优惠",
"other_contribute": "100",
"type": "ALIPAY_FIX_VOUCHER",
"discount_goods_detail": [
{
"goods_id": "STANDARD1026181538",
"goods_name": "雪碧",
"discount_amount": "10000",
"voucher_id": "2015102600073002039000002D5O"
}
]
},
{
"amount": "1000",
"id": "2015102600073002039000002D5O",
"memo": "学生专用优惠",
"merchant_contribute": "900",
"name": "XX超市5折优惠",
"other_contribute": "100",
"type": "ALIPAY_FIX_VOUCHER",
"discount_goods_detail": [
{
"goods_id": "STANDARD1026181538",
"goods_name": "雪碧",
"discount_amount": "10000",
"voucher_id": "2015102600073002039000002D5O"
}
]
}
],
"detail_error_code": "10000",
"detail_error_desc": "Success"
},
"wxpay_res_info": {
"buyer_pay_amount": 1,
"trade_no": "4200000196201812146252898537",
"out_trade_no": "2018121400000002",
"atu_trade_no": "4200000196201812146252898537",
"atu_out_trade_no": "2018121400000002",
"app_id": "wx5acb63e448b4fc22",
"mch_id": "1241109502",
"open_id": "oVTJstwEIdlt3ExaSCxF_cfdRADE",
"is_subscribe": "N",
"sub_openid": "oXI_E5KN-FJi1Hf65mWeiBF8fUlU",
"sub_is_subscribe": "",
"trade_type": "MICROPAY",
"bank_type": "CFT",
"total_fee": "1",
"coupon_fee": "",
"charge_amount": "0",
"gmt_payment": "20181214141132",
"detail_error_code": "SUCCESS",
"detail_error_desc": "OK",
"settlement_total_fee": "1",
"promotion_detail": {
"promotion_detail": [
{
"promotion_id": "109519",
"name": "单品惠-6",
"scope": "SINGLE",
"type": "DISCOUNT",
"amount": 5,
"activity_id": "931386",
"wxpay_contribute": 0,
"merchant_contribute": 0,
"other_contribute": 5,
"goods_detail": [
{
"goods_id": "a_goods1",
"goods_remark": "商品备注",
"quantity": 7,
"price": 1,
"discount_amount": 4
},
{
"goods_id": "a_goods2",
"goods_remark": "商品备注",
"quantity": 1,
"price": 2,
"discount_amount": 1
}
]
}
]
}
},
"upay_res_info": {
"trade_no": "20180504050741694554",
"out_trade_no": "1805040000021",
"atu_trade_no": "20180504050741694554",
"atu_out_trade_no": "1805040000021",
"buyer_pay_amount": "1",
"total_fee": "1",
"charge_amount": "0"
},
"ecny_res_info": {
"trade_no": "20180504050741694554",
"out_trade_no": "1805040000021",
"buyer_pay_amount": "1"
"total_fee": "1",
"receipt_fee": "1",
"charge_amount": "0",
"gmt_payment": "20210205113225",
"detail_error_code": "",
"detail_error_desc": ""
},
"balpay_res_info": {
"trade_no": "20180504050741694554",
"out_trade_no": "1805040000021",
"total_fee": "25",
"charge_amount": "0",
"gmt_payment": "20230530105300",
"member_id": "1542"
},
"result": {
"id": "0000",
"comment": "交易成功"
},
"sign": "C557C5D68AA5D803B2E6FF54AA28E5DF"
}
XML:
<?xml version="1.0" encoding="GBK"?>
<business_trans>
<response_type>barcode_pay_response</response_type>
<isspid>39493002</isspid>
<pos_id>123456789</pos_id>
<pos_seq>000000000001</pos_seq>
<sys_seq>000000000244</sys_seq>
<trans_time>20090405010104</trans_time>
<pay_type>502</pay_type>
<extend><![CDATA[扩展字段(json格式)]]></extend>
<buss_discount_amt>2</buss_discount_amt>
<platform_discount_amt>2</platform_discount_amt>
<discount_amt>0</discount_amt>
<mdiscount_amt>0</mdiscount_amt>
<coupon_amt>0</coupon_amt>
<mcard_amt>0</mcard_amt>
<mcoupon_amt>0</mcoupon_amt>
<point_amt>0</point_amt>
<memo>订单备注</memo>
<alipay_res_info>
<trade_no>2018111522001429701012895360</trade_no>
<out_trade_no>1811150000001</out_trade_no>
<atu_trade_no>2018111522001429701012895360</atu_trade_no>
<atu_out_trade_no>1811150000001</atu_out_trade_no>
<buy_user_id>2088123456789012</buy_user_id>
<buy_logon_id>502***@qq.com</buy_logon_id>
<total_fee>1</total_fee>
<receipt_amount>1</receipt_amount>
<invoice_amount>1</invoice_amount>
<buyer_pay_amount>1</buyer_pay_amount>
<charge_amount>0</charge_amount>
<fund_bill_list></fund_bill_list>
<gmt_payment>20181115085738</gmt_payment>
<detail_error_code></detail_error_code>
<detail_error_desc></detail_error_desc>
<voucher_detail_list>[{单品优惠信息(JOSN)}]</voucher_detail_list>
</alipay_res_info>
<wxpay_res_info>
<trade_no>4001172001201604144821605495</trade_no>
<out_trade_no>1811150000002</out_trade_no>
<atu_trade_no>4001172001201604144821605495</atu_trade_no>
<atu_out_trade_no>1811150000002</atu_out_trade_no>
<app_id>wx5acb63e448b4fc22</app_id>
<mch_id>1241109502</mch_id>
<open_id>oVTJstwEIdlt3ExaSCxF_cfdRADE</open_id>
<is_subscribe>N</is_subscribe>
<sub_openid>oXI_E5KN-FJi1Hf65mWeiBF8fUlU</sub_openid>
<sub_is_subscribe>N</sub_is_subscribe>
<trade_type>MICROPAY</trade_type>
<bank_type>CCB_DEBIT</bank_type>
<total_fee>1</total_fee>
<coupon_fee>0</coupon_fee>
<charge_amount>0</charge_amount>
<gmt_payment>20181115090351</gmt_payment>
<detail_error_code>SUCCESS</detail_error_code>
<detail_error_desc>OK</detail_error_desc>
<promotion_detail>[{单品优惠信息(JOSN)}]</promotion_detail>
<buyer_pay_amount>1</buyer_pay_amount>
<settlement_total_fee>1</settlement_total_fee>
</wxpay_res_info>
<upay_res_info>
<trade_no>20180504050741694554</trade_no>
<out_trade_no>1805040000021</out_trade_no>
<atu_trade_no>20180504050741694554</atu_trade_no>
<atu_out_trade_no>1805040000021</atu_out_trade_no>
<buyer_pay_amount>1</buyer_pay_amount>
<total_fee>1</total_fee>
<charge_amount>0</charge_amount>
</upay_res_info>
<ecny_res_info>
<trade_no>20180504050741694554</trade_no>
<out_trade_no>1805040000021</out_trade_no>
<buyer_pay_amount>1</buyer_pay_amount>
<total_fee>1</total_fee>
<receipt_fee>1</receipt_fee>
<charge_amount>0</charge_amount>
<gmt_payment>20210205113225</gmt_payment>
<detail_error_code></detail_error_code>
<detail_error_desc></detail_error_desc>
</ecny_res_info>
<balpay_res_info>
<trade_no>20180504050741694554</trade_no>
<out_trade_no>1805040000021</out_trade_no>
<total_fee>25</total_fee>
<charge_amount>0</charge_amount>
<gmt_payment>20230530105300</gmt_payment>
<member_id>1542</member_id>
</balpay_res_info>
<result>
<id>0000</id>
<comment>成功</comment>
</result>
</business_trans>
交易返回报文说明
标准接口会因业务升级需要而新增节点,请在解析返回报文时避免新增未知节点产生的程序出错!
节点名称 | 中文名称 | 类型 | 说明 | 是否必填 |
---|---|---|---|---|
sign | 报文签名 | String(32) | 返回报文格式为JSON时必填 计算签名方式请看2.1章节 | 可选 |
response_type | 返回类型 | String(32) | 固定值:barcode_pay_response | 必填 |
isspid | 商户号 | String(8) | 翼码商户号,由翼码提供 | 必填 |
pos_id | 终端号 | String(20) | 商户自定义终端号 | 必填 |
pos_seq | 支付请求流水号 | String(32) | 支付请求流水号,和请求报文相同 | 必填 |
sys_seq | 随机串号 | String(16) | 随机生成串号,仅用于日志跟踪用,不保存 | 必填 |
trans_time | 接口返回时间 | String(14) | 接口返回时间,格式:yyyyMMddHHmmss | 必填 |
pay_type | 支付类型 | String(3) | 502:支付宝 503:微信支付 512:银联二维码 516:数字人民币 519:会员余额支付 | 可空 |
extend | 扩展信息 | String | 扩展信息字段内容为json格式 预留字段后续业务扩展使用 | 可空 |
buss_discount_amt | 商家优惠金额 | String(16) | 商家优惠金额,单位为分 | 可空 |
platform_discount_amt | 平台优惠金额 | String(16) | 平台优惠金额,单位为分 | 可空 |
discount_amt | 支付宝折扣券 | String(16) | 仅支付宝时返回,单位为分 | 可空 |
mdiscount_amt | 商户优惠券 | String(16) | 仅支付宝时返回,单位为分 | 可空 |
coupon_amt | 支付宝红包 | String(16) | 仅支付宝时返回,单位为分 | 可空 |
mcard_amt | 商户店铺卡 | String(16) | 仅支付宝时返回,单位为分 | 可空 |
mcoupon_amt | 商户红包 | String(16) | 仅支付宝时返回,单位为分 | 可空 |
point_amt | 支付宝积分 | String(16) | 仅支付宝时返回,单位为分 | 可空 |
memo | 订单备注 | String(128) | 返回支付请求时内容 | 可空 |
result ->id | 响应码 | String(4) | 0000:成功 9998:等待付款,需要调用支付查询交易确认结果 其它代表失败,错误信息说明见“响应码解释”字段 | 必填 |
result ->comment | 响应码解释 | String(64) | 响应码对应中文注解,用于显示提示 | 必填 |
支付宝返回以下数据 | ||||
alipay_res_info ->trade_no | 支付通道订单号 | String(64) | 直连为支付宝订单号 间连为通道订单号 | 可空 |
alipay_res_info ->out_trade_no | 支付通道商户单号 | String(64) | 直连为支付宝商户订单号 间连为请求通道订单号 | 可空 |
alipay_res_info ->atu_trade_no | ATU订单号 | String(64) | 支付宝/微信/银联订单号 客户手机支付凭证上的订单号 | 可空 |
alipay_res_info ->atu_out_trade_no | ATU商户订单号 | String(64) | 支付宝/微信/银联商户订单号 客户手机支付凭证上的商户订单号 | 可空 |
alipay_res_info ->buy_user_id | 买家支付宝用户号 | String(30) | 直连通道交易成功时候,必填 | 可空 |
alipay_res_info ->buy_logon_id | 买家支付宝帐号 | String(100) | 直连通道交易成功时候,必填 | 可空 |
alipay_res_info ->total_fee | 交易总金额 | String(16) | 直连通道交易成功时候,必填 | 可空 |
alipay_res_info ->receipt_amount | 实收金额 | String(16) | 直连通道交易成功时候,必填 | 可空 |
alipay_res_info ->invoice_amount | 交易中可给用户开具发票的金额 | String(16) | 可空 | 可空 |
alipay_res_info ->buyer_pay_amount | 买家付款的金额 | String(16) | 直连通道交易成功时候,必填,单位为分 | 可空 |
alipay_res_info ->charge_amount | 交易手续费 | String(9) | 单位为分,交易成功时必填 | 可空 |
alipay_res_info ->fund_bill_list ->amount | 支付金额 | String(16) | 支付金额,单位为分,不支持小数点 | 可空 |
alipay_res_info ->fund_bill_list ->fund_channel | 支付渠道 | String(2) | 支付宝支付渠道说明 使用xml报文时不支持,返回为空 | 可空 |
alipay_res_info ->gmt_payment | 支付完成时间 | String(14) | 支付完成时间 | 可空 |
alipay_res_info ->detail_error_code | 支付详细错误码 | String(48) | 可空 | |
alipay_res_info ->detail_error_desc | 支付详细错误码说明 | String(64) | 可空 | |
alipay_res_info ->voucher_detail_list | 单品优惠信息 | JSON | 本交易支付时使用的所有单品优惠信息,以JSON格式返回 详细参数见下表 | 可空 |
微信支付返回以下数据 | ||||
wxpay_res_info ->trade_no | 支付通道订单号 | String(64) | 直连为微信订单号 间连为通道订单号 | 可空 |
wxpay_res_info ->out_trade_no | 支付通道商户单号 | String(64) | 直连为微信商户订单号 间连为请求通道订单号 | 可空 |
wxpay_res_info ->atu_trade_no | ATU订单号 | String(64) | 支付宝/微信/银联订单号 客户手机支付凭证上的订单号 | 可空 |
wxpay_res_info ->atu_out_trade_no | ATU商户订单号 | String(64) | 支付宝/微信/银联商户订单号 客户手机支付凭证上的商户订单号 | 可空 |
wxpay_res_info ->app_id | 服务商公众号ID | String(32) | 直连通道交易成功时候,必填 | 可空 |
wxpay_res_info ->mch_id | 服务商商户号 | String(32) | 直连通道交易成功时候,必填 | 可空 |
wxpay_res_info ->open_id | 用户相对服务商公众号标识 | String(128) | 直连通道交易成功时候,必填 | 可空 |
wxpay_res_info ->is_subscribe | 是否已关注服务商公众帐号 | String(1) | 直连通道交易成功时候,必填 Y-已关注 N-未关注 | 可空 |
wxpay_res_info ->sub_openid | 用户相对子商户公众号标识 | String(128) | 可空 | |
wxpay_res_info ->sub_is_subscribe | 是否已关注子商户公众帐号 | String(1) | Y-已关注 N-未关注 | 可空 |
wxpay_res_info ->trade_type | 交易类型 | String(16) | 直连通道交易成功时候,必填 | 可空 |
wxpay_res_info ->bank_type | 付款银行 | String(16) | 直连通道交易成功时候,必填 | 可空 |
wxpay_res_info ->total_fee | 总金额 | String(64) | 直连通道交易成功时候,必填 | 可空 |
wxpay_res_info ->coupon_fee | 代金券金额 | String(64) | 直连通道交易成功时候,必填 | 可空 |
wxpay_res_info ->charge_amount | 交易手续费 | String(9) | 单位为分,交易成功时必填 | 可空 |
wxpay_res_info ->gmt_payment | 支付完成时间 | String(14) | 直连通道交易成功时候,必填 | 可空 |
wxpay_res_info ->detail_error_code | 支付详细错误码 | String(48) | 直连通道交易成功时候,必填 | 可空 |
wxpay_res_info ->detail_error_desc | 支付详细错误码说明 | String(128) | 直连通道交易成功时候,必填 | 可空 |
wxpay_res_info ->promotion_detail | 单品优惠信息 | JSON | 本次交易支付的单品优惠信息,以JSON格式返回 详细参数见下表 | 可空 |
wxpay_res_info ->buyer_pay_amount | 买家实付金额 | String(16) | 直连通道交易成功时候,必填,单位为分 | 可空 |
wxpay_res_info ->settlement_total_fee | 应结订单金额 | String(16) | 单位为分 当订单使用了免充值型优惠券后返回该参数,应结订单金额=订单金额-免充值优惠券金额。 | 可空 |
银联二维码返回以下数据 | ||||
upay_res_info ->trade_no | 支付通道订单号 | String(64) | 直连为银联订单号 间连为通道订单号 | 可空 |
upay_res_info ->out_trade_no | 支付通道商户单号 | String(64) | 直连为银联商户订单号 间连为请求通道订单号 | 可空 |
upay_res_info ->atu_trade_no | ATU订单号 | String(64) | 支付宝/微信/银联订单号 客户手机支付凭证上的订单号 | 可空 |
upay_res_info ->atu_out_trade_no | ATU商户订单号 | String(64) | 支付宝/微信/银联商户订单号 客户手机支付凭证上的商户订单号 | 可空 |
upay_res_info ->buyer_pay_amount | 买家实付金额 | String(16) | 直连通道交易成功时候,必填,单位为分 | 可空 |
upay_res_info ->total_fee | 订单总金额 | String(9) | 单位为分 标准银联/合利宝/星POS通道,交易成功时候,必填 | 可空 |
upay_res_info ->charge_amount | 交易手续费 | String(9) | 单位为分,交易成功时必填 | 可空 |
数字人民币返回以下数据 | ||||
ecny_res_info ->trade_no | 平台订单号 | String(64) | 直连通道交易成功时候,必填 | 可空 |
ecny_res_info ->out_trade_no | 支付商户订单号 | String(64) | 直连通道交易成功时候,必填 | 可空 |
ecny_res_info ->buyer_pay_amount | 买家实付金额 | String(64) | 直连通道交易成功时候,必填,单位为分 | 可空 |
ecny_res_info ->total_fee | 订单金额 | String(64) | 直连通道交易成功时候,必填 | 可空 |
ecny_res_info ->receipt_fee | 实付金额 | String(64) | 直连通道交易成功时候,必填 | 可空 |
ecny_res_info ->charge_amount | 交易手续费 | String(9) | 单位为分,交易成功时必填 | 可空 |
ecny_res_info ->gmt_payment | 交易时间 | String(64) | 直连通道交易成功时候,必填 | 可空 |
ecny_res_info ->detail_error_code | 通道原始应答码,直连通道交易成功时候 | String(64) | 直连通道交易失败时候 | 可空 |
ecny_res_info ->detail_error_desc | 通道原始应答说明,直连通道交易成功时候 | String(64) | 直连通道交易失败时候 | 可空 |
会员余额支付返回以下数据 | ||||
balpay_res_info ->trade_no | 支付平台订单号 | String(64) | 可空 | |
balpay_res_info ->out_trade_no | 支付商户订单号 | String(64) | 可空 | |
balpay_res_info ->total_fee | 订单总金额 | String(9) | 单位为分 | 可空 |
balpay_res_info ->charge_amount | 交易手续费 | String(9) | 单位为分,交易成功时必填 | 可空 |
balpay_res_info ->gmt_payment | 支付完成时间 | String(14) | 格式:yyyyMMddHHmmss | 可空 |
balpay_res_info ->member_id | 会员id | String(9) | 可空 |
标准接口会因业务升级需要而新增节点,请在解析返回报文时避免新增未知节点产生的程序出错!
voucher_detail_list 优惠券信息
JSON节点 | 类型 | 说明 | 是否必填 | 范例 |
---|---|---|---|---|
id | String(32) | 券id | 必填 | 2015102600073002039000002D5O |
name | String(64) | 券名称 | 必填 | xx超市5折优惠 |
type | String(32) | 当前有三种类型: ALIPAY_FIX_VOUCHER - 全场代金券 ALIPAY_DISCOUNT_VOUCHER - 折扣券 ALIPAY_ITEM_VOUCHER - 单品优惠 注:不排除将来新增其他类型的可能,商家接入时注意兼容性避免硬编码 | 必填 | ALIPAY_FIX_VOUCHER |
amount | String(16) | 优惠券面额,它应该会等于商家出资加上其他出资方出资,单位为分 | 必填 | 1000 |
merchant_contribute | String(16) | 商家出资(特指发起交易的商家出资金额,单位为分) | 可空 | 900 |
other_contribute | String(16) | 其他出资方出资金额,可能是支付宝,可能是品牌商,或者其他方,也可能是他们的一起出资,单位为分 | 可空 | 100 |
memo | String(256) | 优惠券备注信息 | 可空 | 学生专用优惠 |
discount_goods_detail | String | 单品信息 | 必填 | |
discount_goods_detail ->goods_id | String(32) | 商品的编号 | 必填 | apple-01 |
discount_goods_detail ->goods_name | String(256) | 商品名称 | 必填 | ipad |
discount_goods_detail ->discount_amount | String(16) | 优惠金额,单位为分 | 必填 | 200000 |
discount_goods_detail ->voucher_id | String(32) | 优惠券id | 必填 | 2015102600073002039000002D5O |
voucher_detail_list 样例:
[
{
"amount":"1000",
"id":"2015102600073002039000002D5O",
"memo":"学生专用优惠",
"merchant_contribute":"900",
"name":"XX超市5折优惠",
"other_contribute":"100",
"type":"ALIPAY_FIX_VOUCHER",
"discount_goods_detail":[
{
"goods_id":"STANDARD1026181538",
"goods_name":"雪碧",
"discount_amount":"10000",
"voucher_id":"2015102600073002039000002D5O"
}
]
},
{
"amount":"1000",
"id":"2015102600073002039000002D5O",
"memo":"学生专用优惠",
"merchant_contribute":"900",
"name":"XX超市5折优惠",
"other_contribute":"100",
"type":"ALIPAY_FIX_VOUCHER",
"discount_goods_detail":[
{
"goods_id":"STANDARD1026181538",
"goods_name":"雪碧",
"discount_amount":"10000",
"voucher_id":"2015102600073002039000002D5O"
}
]
}
]
promotion_detail 优惠活动信息
JSON节点 | 类型 | 说明 | 是否必填 | 范例 |
---|---|---|---|---|
promotion_id | String(32) | 券或者立减优惠id | 必填 | 109519 |
name | String(64) | 优惠名称 | 可空 | 单品惠-6 |
scope | String(32) | 优惠范围 GLOBAL - 全场代金券 SINGLE - 单品优惠 | 可空 | SINGLE |
type | String(32) | 优惠类型 COUPON - 代金券,需要走结算资金的充值型代金券,(境外商户券币种与支付币种一致) DISCOUNT - 优惠券,不走结算资金的免充值型优惠券,(境外商户券币种与标价币种一致) | 可空 | DISCOUNT |
amount | Number(16) | 优惠券面额,用户享受的优惠的金额 | 必填 | 5 |
activity_id | String(32) | 活动ID 在微信商户后台配置的批次ID | 必填 | 931386 |
wxpay_contribute | Number(16) | 微信出资(特指由微信支付商户平台创建的优惠,出资金额等于本项优惠总金额,单位为分) | 可空 | 0 |
merchant_contribute | Number(16) | 商家出资(特指商户自己创建的优惠,出资金额等于本项优惠总金额,单位为分) | 可空 | 0 |
other_contribute | Number(16) | 其他出资方出资金额,单位为分 | 可空 | 5 |
goods_detail | String | 单品列表 | 可空 | |
goods_detail ->goods_id | String(32) | 商品编码 | 必填 | a_goods1 |
goods_detail ->goods_remark | String(128) | 商品备注 | 可选 | 1001 |
goods_detail ->discount_amount | Number(16) | 商品优惠金额,单位为分 | 必填 | 100 |
goods_detail ->quantity | Number(10) | 商品数量 | 必填 | 1 |
goods_detail ->price | Number(16) | 商品价格,单位为分 如果商户有优惠,需传输商户优惠后的单价(例如:用户对一笔100元的订单使用了商场发的纸质优惠券100-50,则活动商品的单价应为原单价-50) | 必填 | 528800 |
promotion_detail 样例:
{
"promotion_detail": [
{
"promotion_id": "109519",
"name": "单品惠-6",
"scope": "SINGLE",
"type": "DISCOUNT",
"amount": 5,
"activity_id": "931386",
"wxpay_contribute": 0,
"merchant_contribute": 0,
"other_contribute": 5,
"goods_detail": [
{
"goods_id": "a_goods1",
"goods_remark": "商品备注",
"quantity": 7,
"price": 1,
"discount_amount": 4
},
{
"goods_id": "a_goods2",
"goods_remark": "商品备注",
"quantity": 1,
"price": 2,
"discount_amount": 1
}
]
}
]
}