Skip to content

上报订单关联信息

从业机构/服务商/渠道商/商户可调用该接口,在商户订单下单完成后,上报订单关联信息,以便后续在支付环节进行风险管控

请求参数类型描述
jsonobject声明请求的JSON数据结构
sp_mchidstring服务商商户号
acquiring_bank_idstring从业机构商户号
channel_idstring渠道号
sub_mchidstring子商户号
out_trade_nostring商户订单号
openidstring用户标识
phonestring用户手机号
certificates_numberstring用户实名证件号
client_ipstring用户终端ip
risk_levelnumber商户判定交易的风险等级
line_typenumber线上线下标识
goods_typenumber虚拟实物标识
seller_typenumber物品发布类型
is_need_deliverboolean是否需要物流发货
device_typenumber用户设备类型
useridstring付款方用户标识
phone_fromnumber手机号来源
seller_useridstring收款方用户标识
scenenumber业务场景
recharge_fieldsobject充值业务场景独有字段
account_typenumber充值账号类型
accountstring充值账号
living_expenses_fieldsobject生活缴费场景独有字段
acc_nostring户号
typenumber费种
citystring缴费城市
addressstring户号对应的地址信息
acc_namestring缴费户名
company_namestring机构名称
amountnumber缴费金额
extra_fields1string扩展字段1,json格式
extra_fields2string扩展字段2,json格式
extra_fields3string扩展字段3,json格式
headersobject声明请求的头参数
Wechatpay-Serialstring微信支付公钥ID/平台证书序列号
php
$instance->v3->merchantRiskManage->reportTradeUnionInformation->postAsync([
  'json' => [
    'sp_mchid'               => '1900000109',
    'acquiring_bank_id'      => '1356485',
    'channel_id'             => '1900000108',
    'sub_mchid'              => '1900009231',
    'out_trade_no'           => '1217752501201407033233368018',
    'openid'                 => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'phone'                  => 'ca775af5f841bdf424b2e6eb86a6e21e',
    'certificates_number'    => 'ca775af5f841bdf424b2e6eb86a6e21e',
    'client_ip'              => '123.12.12.123',
    'risk_level'             => 1,
    'line_type'              => 1,
    'goods_type'             => 1,
    'seller_type'            => 1,
    'is_need_deliver'        => true,
    'device_type'            => 1,
    'userid'                 => '华为的账号:260XXX',
    'phone_from'             => 1,
    'seller_userid'          => '抖音的账号:XXXXX',
    'scene'                  => 1,
    'recharge_fields'        => [
      'account_type' => 1,
      'account'      => 'example_account',
    ],
    'living_expenses_fields' => [
      'acc_no'       => '123456',
      'type'         => 1,
      'city'         => '湖南衡阳',
      'address'      => '广东省深圳市南山区海天二路33号',
      'acc_name'     => '詹讯',
      'company_name' => '深圳电力',
      'amount'       => 500,
    ],
    'extra_fields1'          => '{"key1":"value1"}',
    'extra_fields2'          => '{"key1":"value1"}',
    'extra_fields3'          => '{"key1":"value1"}',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/merchant-risk-manage/report-trade-union-information')->postAsync([
  'json' => [
    'sp_mchid'               => '1900000109',
    'acquiring_bank_id'      => '1356485',
    'channel_id'             => '1900000108',
    'sub_mchid'              => '1900009231',
    'out_trade_no'           => '1217752501201407033233368018',
    'openid'                 => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'phone'                  => 'ca775af5f841bdf424b2e6eb86a6e21e',
    'certificates_number'    => 'ca775af5f841bdf424b2e6eb86a6e21e',
    'client_ip'              => '123.12.12.123',
    'risk_level'             => 1,
    'line_type'              => 1,
    'goods_type'             => 1,
    'seller_type'            => 1,
    'is_need_deliver'        => true,
    'device_type'            => 1,
    'userid'                 => '华为的账号:260XXX',
    'phone_from'             => 1,
    'seller_userid'          => '抖音的账号:XXXXX',
    'scene'                  => 1,
    'recharge_fields'        => [
      'account_type' => 1,
      'account'      => 'example_account',
    ],
    'living_expenses_fields' => [
      'acc_no'       => '123456',
      'type'         => 1,
      'city'         => '湖南衡阳',
      'address'      => '广东省深圳市南山区海天二路33号',
      'acc_name'     => '詹讯',
      'company_name' => '深圳电力',
      'amount'       => 500,
    ],
    'extra_fields1'          => '{"key1":"value1"}',
    'extra_fields2'          => '{"key1":"value1"}',
    'extra_fields3'          => '{"key1":"value1"}',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/merchant-risk-manage/report-trade-union-information']->postAsync([
  'json' => [
    'sp_mchid'               => '1900000109',
    'acquiring_bank_id'      => '1356485',
    'channel_id'             => '1900000108',
    'sub_mchid'              => '1900009231',
    'out_trade_no'           => '1217752501201407033233368018',
    'openid'                 => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'phone'                  => 'ca775af5f841bdf424b2e6eb86a6e21e',
    'certificates_number'    => 'ca775af5f841bdf424b2e6eb86a6e21e',
    'client_ip'              => '123.12.12.123',
    'risk_level'             => 1,
    'line_type'              => 1,
    'goods_type'             => 1,
    'seller_type'            => 1,
    'is_need_deliver'        => true,
    'device_type'            => 1,
    'userid'                 => '华为的账号:260XXX',
    'phone_from'             => 1,
    'seller_userid'          => '抖音的账号:XXXXX',
    'scene'                  => 1,
    'recharge_fields'        => [
      'account_type' => 1,
      'account'      => 'example_account',
    ],
    'living_expenses_fields' => [
      'acc_no'       => '123456',
      'type'         => 1,
      'city'         => '湖南衡阳',
      'address'      => '广东省深圳市南山区海天二路33号',
      'acc_name'     => '詹讯',
      'company_name' => '深圳电力',
      'amount'       => 500,
    ],
    'extra_fields1'          => '{"key1":"value1"}',
    'extra_fields2'          => '{"key1":"value1"}',
    'extra_fields3'          => '{"key1":"value1"}',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->merchantRiskManage->reportTradeUnionInformation->post([
  'json' => [
    'sp_mchid'               => '1900000109',
    'acquiring_bank_id'      => '1356485',
    'channel_id'             => '1900000108',
    'sub_mchid'              => '1900009231',
    'out_trade_no'           => '1217752501201407033233368018',
    'openid'                 => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'phone'                  => 'ca775af5f841bdf424b2e6eb86a6e21e',
    'certificates_number'    => 'ca775af5f841bdf424b2e6eb86a6e21e',
    'client_ip'              => '123.12.12.123',
    'risk_level'             => 1,
    'line_type'              => 1,
    'goods_type'             => 1,
    'seller_type'            => 1,
    'is_need_deliver'        => true,
    'device_type'            => 1,
    'userid'                 => '华为的账号:260XXX',
    'phone_from'             => 1,
    'seller_userid'          => '抖音的账号:XXXXX',
    'scene'                  => 1,
    'recharge_fields'        => [
      'account_type' => 1,
      'account'      => 'example_account',
    ],
    'living_expenses_fields' => [
      'acc_no'       => '123456',
      'type'         => 1,
      'city'         => '湖南衡阳',
      'address'      => '广东省深圳市南山区海天二路33号',
      'acc_name'     => '詹讯',
      'company_name' => '深圳电力',
      'amount'       => 500,
    ],
    'extra_fields1'          => '{"key1":"value1"}',
    'extra_fields2'          => '{"key1":"value1"}',
    'extra_fields3'          => '{"key1":"value1"}',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/merchant-risk-manage/report-trade-union-information')->post([
  'json' => [
    'sp_mchid'               => '1900000109',
    'acquiring_bank_id'      => '1356485',
    'channel_id'             => '1900000108',
    'sub_mchid'              => '1900009231',
    'out_trade_no'           => '1217752501201407033233368018',
    'openid'                 => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'phone'                  => 'ca775af5f841bdf424b2e6eb86a6e21e',
    'certificates_number'    => 'ca775af5f841bdf424b2e6eb86a6e21e',
    'client_ip'              => '123.12.12.123',
    'risk_level'             => 1,
    'line_type'              => 1,
    'goods_type'             => 1,
    'seller_type'            => 1,
    'is_need_deliver'        => true,
    'device_type'            => 1,
    'userid'                 => '华为的账号:260XXX',
    'phone_from'             => 1,
    'seller_userid'          => '抖音的账号:XXXXX',
    'scene'                  => 1,
    'recharge_fields'        => [
      'account_type' => 1,
      'account'      => 'example_account',
    ],
    'living_expenses_fields' => [
      'acc_no'       => '123456',
      'type'         => 1,
      'city'         => '湖南衡阳',
      'address'      => '广东省深圳市南山区海天二路33号',
      'acc_name'     => '詹讯',
      'company_name' => '深圳电力',
      'amount'       => 500,
    ],
    'extra_fields1'          => '{"key1":"value1"}',
    'extra_fields2'          => '{"key1":"value1"}',
    'extra_fields3'          => '{"key1":"value1"}',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/merchant-risk-manage/report-trade-union-information']->post([
  'json' => [
    'sp_mchid'               => '1900000109',
    'acquiring_bank_id'      => '1356485',
    'channel_id'             => '1900000108',
    'sub_mchid'              => '1900009231',
    'out_trade_no'           => '1217752501201407033233368018',
    'openid'                 => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'phone'                  => 'ca775af5f841bdf424b2e6eb86a6e21e',
    'certificates_number'    => 'ca775af5f841bdf424b2e6eb86a6e21e',
    'client_ip'              => '123.12.12.123',
    'risk_level'             => 1,
    'line_type'              => 1,
    'goods_type'             => 1,
    'seller_type'            => 1,
    'is_need_deliver'        => true,
    'device_type'            => 1,
    'userid'                 => '华为的账号:260XXX',
    'phone_from'             => 1,
    'seller_userid'          => '抖音的账号:XXXXX',
    'scene'                  => 1,
    'recharge_fields'        => [
      'account_type' => 1,
      'account'      => 'example_account',
    ],
    'living_expenses_fields' => [
      'acc_no'       => '123456',
      'type'         => 1,
      'city'         => '湖南衡阳',
      'address'      => '广东省深圳市南山区海天二路33号',
      'acc_name'     => '詹讯',
      'company_name' => '深圳电力',
      'amount'       => 500,
    ],
    'extra_fields1'          => '{"key1":"value1"}',
    'extra_fields2'          => '{"key1":"value1"}',
    'extra_fields3'          => '{"key1":"value1"}',
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
sp_mchidstring服务商商户号
acquiring_bank_idstring从业机构商户号
channel_idstring渠道号
sub_mchidstring子商户号
out_trade_nostring商户订单号

参阅 官方文档

Published on the GitHub by TheNorthMemory