Skip to content

医保自费混合收款下单

从业机构调用该接口向微信医保后台下单

请求参数类型描述
jsonobject声明请求的JSON数据结构
mix_pay_typestring混合支付类型
UNKNOWN_MIX_PAY_TYPE | CASH_ONLY | INSURANCE_ONLY | CASH_AND_INSURANCE 枚举值之一
order_typestring订单类型
UNKNOWN_ORDER_TYPE | REG_PAY | DIAG_PAY | COVID_EXAM_PAY | IN_HOSP_PAY | PHARMACY_PAY | INSURANCE_PAY | INT_REG_PAY | INT_RE_DIAG_PAY | INT_RX_PAY | COVID_ANTIGEN_PAY | MED_PAY 枚举值之一
appidstring从业机构的公众号ID
sub_appidstring医疗机构的公众号ID
sub_mchidstring医疗机构的商户号
sub_openidstring用户在医疗机构AppID下的唯一标识
payerobject支付人身份信息
namestring真实姓名
id_digeststring个人身份ID摘要
card_typestring证件类型
UNKNOWN_USER_CARD_TYPE | ID_CARD | HOUSEHOLD_REGISTRATION | FOREIGNER_PASSPORT | MAINLAND_TRAVEL_PERMIT_FOR_TW | MAINLAND_TRAVEL_PERMIT_FOR_MO | MAINLAND_TRAVEL_PERMIT_FOR_HK | FOREIGN_PERMANENT_RESIDENT 枚举值之一
pay_for_relativesboolean是否代亲属支付
relativeobject亲属身份信息
namestring真实姓名
id_digeststring个人身份ID摘要
card_typestring证件类型
UNKNOWN_USER_CARD_TYPE | ID_CARD | HOUSEHOLD_REGISTRATION | FOREIGNER_PASSPORT | MAINLAND_TRAVEL_PERMIT_FOR_TW | MAINLAND_TRAVEL_PERMIT_FOR_MO | MAINLAND_TRAVEL_PERMIT_FOR_HK | FOREIGN_PERMANENT_RESIDENT 枚举值之一
out_trade_nostring从业机构订单号
serial_nostring医疗机构订单号
pay_order_idstring医保局返回的支付单ID
geo_locationstring用户定位信息
city_idstring城市ID
med_inst_namestring医疗机构名称
med_inst_nostring医疗机构编码
med_ins_order_create_timestring医保下单时间
total_feeinteger使用该接口下单的总金额
med_ins_gov_feeinteger医保局结算后,医保统筹支付金额
med_ins_self_feeinteger医保局结算后,医保个账支付金额
med_ins_other_feeinteger医保局结算后,医保其他支付金额
med_ins_cash_feeinteger医保局结算后,需要自费的金额
wechat_pay_cash_feeinteger实际需要用户微信支付的金额
cash_add_detailobject[]现金补充列表
cash_add_feeinteger现金补充金额
cash_add_typestring现金补充类型
DEFAULT_ADD_TYPE | FREIGHT | OTHER_MEDICAL_EXPENSES 枚举值之一
cash_reduce_detailobject[]现金减免列表
cash_reduce_feeinteger现金减免金额
cash_reduce_typestring现金减免类型
DEFAULT_REDUCE_TYPE | HOSPITAL_REDUCE | PHARMACY_DISCOUNT | DISCOUNT | PRE_PAYMENT | DEPOSIT_DEDUCTION 枚举值之一
callback_urlstring回调通知URL
prepay_idstring自费预下单ID
passthrough_request_contentstring医疗机构透传给医保的数据
payAuthNostring
payOrdIdstring
setlLatlntstring
extendsstring扩展字段
attachstring附加数据
channel_nostring渠道号
med_ins_test_envboolean是否到医保局测试环境下单
headersobject声明请求的头参数
Wechatpay-Serialstring微信支付公钥ID/平台证书序列号
php
$instance->v3->medIns->orders->postAsync([
  'json' => [
    'mix_pay_type'                => 'CASH_AND_INSURANCE',
    'order_type'                  => 'REG_PAY',
    'appid'                       => 'wx8888888888888888',
    'sub_appid'                   => 'wxd678efh567hg6999',
    'sub_mchid'                   => '1900000109',
    'sub_openid'                  => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'payer'                       => [
      'name'      => '',
      'id_digest' => '',
      'card_type' => 'ID_CARD',
    ],
    'pay_for_relatives'           => true,
    'relative'                    => [
      'name'      => '',
      'id_digest' => '',
      'card_type' => 'ID_CARD',
    ],
    'out_trade_no'                => '202204022005169952975171534816',
    'serial_no'                   => '1217752501201',
    'pay_order_id'                => 'ORD530100202204022006350000021',
    'geo_location'                => '102.682296,25.054260',
    'city_id'                     => '530100',
    'med_inst_name'               => '北大医院',
    'med_inst_no'                 => '1217752501201407033233368318',
    'med_ins_order_create_time'   => '2018-06-08T10:34:56+08:00',
    'total_fee'                   => 202000,
    'med_ins_gov_fee'             => 100000,
    'med_ins_self_fee'            => 45000,
    'med_ins_other_fee'           => 5000,
    'med_ins_cash_fee'            => 50000,
    'wechat_pay_cash_fee'         => 42000,
    'cash_add_detail'             => [[
      'cash_add_fee'  => 2000,
      'cash_add_type' => 'FREIGHT',
    ],],
    'cash_reduce_detail'          => [[
      'cash_reduce_fee'  => 10000,
      'cash_reduce_type' => 'DEFAULT_REDUCE_TYPE',
    ],],
    'callback_url'                => 'https://www.weixin.qq.com/wxpay/pay.php',
    'prepay_id'                   => 'wx201410272009395522657a690389285100',
    'passthrough_request_content' => \json_encode([
      'payAuthNo'  => 'AUTH****',
      'payOrdId'   => 'ORD****',
      'setlLatlnt' => '118.096435,24.485407',
    ]),
    'extends'                     => '{}',
    'attach'                      => '{}',
    'channel_no'                  => 'AAGN9uhZc5EGyRdairKW7Qnu',
    'med_ins_test_env'            => true,
  ],
  '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/med-ins/orders')->postAsync([
  'json' => [
    'mix_pay_type'                => 'CASH_AND_INSURANCE',
    'order_type'                  => 'REG_PAY',
    'appid'                       => 'wx8888888888888888',
    'sub_appid'                   => 'wxd678efh567hg6999',
    'sub_mchid'                   => '1900000109',
    'sub_openid'                  => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'payer'                       => [
      'name'      => '',
      'id_digest' => '',
      'card_type' => 'ID_CARD',
    ],
    'pay_for_relatives'           => true,
    'relative'                    => [
      'name'      => '',
      'id_digest' => '',
      'card_type' => 'ID_CARD',
    ],
    'out_trade_no'                => '202204022005169952975171534816',
    'serial_no'                   => '1217752501201',
    'pay_order_id'                => 'ORD530100202204022006350000021',
    'geo_location'                => '102.682296,25.054260',
    'city_id'                     => '530100',
    'med_inst_name'               => '北大医院',
    'med_inst_no'                 => '1217752501201407033233368318',
    'med_ins_order_create_time'   => '2018-06-08T10:34:56+08:00',
    'total_fee'                   => 202000,
    'med_ins_gov_fee'             => 100000,
    'med_ins_self_fee'            => 45000,
    'med_ins_other_fee'           => 5000,
    'med_ins_cash_fee'            => 50000,
    'wechat_pay_cash_fee'         => 42000,
    'cash_add_detail'             => [[
      'cash_add_fee'  => 2000,
      'cash_add_type' => 'FREIGHT',
    ],],
    'cash_reduce_detail'          => [[
      'cash_reduce_fee'  => 10000,
      'cash_reduce_type' => 'DEFAULT_REDUCE_TYPE',
    ],],
    'callback_url'                => 'https://www.weixin.qq.com/wxpay/pay.php',
    'prepay_id'                   => 'wx201410272009395522657a690389285100',
    'passthrough_request_content' => \json_encode([
      'payAuthNo'  => 'AUTH****',
      'payOrdId'   => 'ORD****',
      'setlLatlnt' => '118.096435,24.485407',
    ]),
    'extends'                     => '{}',
    'attach'                      => '{}',
    'channel_no'                  => 'AAGN9uhZc5EGyRdairKW7Qnu',
    'med_ins_test_env'            => true,
  ],
  '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/med-ins/orders']->postAsync([
  'json' => [
    'mix_pay_type'                => 'CASH_AND_INSURANCE',
    'order_type'                  => 'REG_PAY',
    'appid'                       => 'wx8888888888888888',
    'sub_appid'                   => 'wxd678efh567hg6999',
    'sub_mchid'                   => '1900000109',
    'sub_openid'                  => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'payer'                       => [
      'name'      => '',
      'id_digest' => '',
      'card_type' => 'ID_CARD',
    ],
    'pay_for_relatives'           => true,
    'relative'                    => [
      'name'      => '',
      'id_digest' => '',
      'card_type' => 'ID_CARD',
    ],
    'out_trade_no'                => '202204022005169952975171534816',
    'serial_no'                   => '1217752501201',
    'pay_order_id'                => 'ORD530100202204022006350000021',
    'geo_location'                => '102.682296,25.054260',
    'city_id'                     => '530100',
    'med_inst_name'               => '北大医院',
    'med_inst_no'                 => '1217752501201407033233368318',
    'med_ins_order_create_time'   => '2018-06-08T10:34:56+08:00',
    'total_fee'                   => 202000,
    'med_ins_gov_fee'             => 100000,
    'med_ins_self_fee'            => 45000,
    'med_ins_other_fee'           => 5000,
    'med_ins_cash_fee'            => 50000,
    'wechat_pay_cash_fee'         => 42000,
    'cash_add_detail'             => [[
      'cash_add_fee'  => 2000,
      'cash_add_type' => 'FREIGHT',
    ],],
    'cash_reduce_detail'          => [[
      'cash_reduce_fee'  => 10000,
      'cash_reduce_type' => 'DEFAULT_REDUCE_TYPE',
    ],],
    'callback_url'                => 'https://www.weixin.qq.com/wxpay/pay.php',
    'prepay_id'                   => 'wx201410272009395522657a690389285100',
    'passthrough_request_content' => \json_encode([
      'payAuthNo'  => 'AUTH****',
      'payOrdId'   => 'ORD****',
      'setlLatlnt' => '118.096435,24.485407',
    ]),
    'extends'                     => '{}',
    'attach'                      => '{}',
    'channel_no'                  => 'AAGN9uhZc5EGyRdairKW7Qnu',
    'med_ins_test_env'            => true,
  ],
  '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->medIns->orders->post([
  'json' => [
    'mix_pay_type'                => 'CASH_AND_INSURANCE',
    'order_type'                  => 'REG_PAY',
    'appid'                       => 'wx8888888888888888',
    'sub_appid'                   => 'wxd678efh567hg6999',
    'sub_mchid'                   => '1900000109',
    'sub_openid'                  => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'payer'                       => [
      'name'      => '',
      'id_digest' => '',
      'card_type' => 'ID_CARD',
    ],
    'pay_for_relatives'           => true,
    'relative'                    => [
      'name'      => '',
      'id_digest' => '',
      'card_type' => 'ID_CARD',
    ],
    'out_trade_no'                => '202204022005169952975171534816',
    'serial_no'                   => '1217752501201',
    'pay_order_id'                => 'ORD530100202204022006350000021',
    'geo_location'                => '102.682296,25.054260',
    'city_id'                     => '530100',
    'med_inst_name'               => '北大医院',
    'med_inst_no'                 => '1217752501201407033233368318',
    'med_ins_order_create_time'   => '2018-06-08T10:34:56+08:00',
    'total_fee'                   => 202000,
    'med_ins_gov_fee'             => 100000,
    'med_ins_self_fee'            => 45000,
    'med_ins_other_fee'           => 5000,
    'med_ins_cash_fee'            => 50000,
    'wechat_pay_cash_fee'         => 42000,
    'cash_add_detail'             => [[
      'cash_add_fee'  => 2000,
      'cash_add_type' => 'FREIGHT',
    ],],
    'cash_reduce_detail'          => [[
      'cash_reduce_fee'  => 10000,
      'cash_reduce_type' => 'DEFAULT_REDUCE_TYPE',
    ],],
    'callback_url'                => 'https://www.weixin.qq.com/wxpay/pay.php',
    'prepay_id'                   => 'wx201410272009395522657a690389285100',
    'passthrough_request_content' => \json_encode([
      'payAuthNo'  => 'AUTH****',
      'payOrdId'   => 'ORD****',
      'setlLatlnt' => '118.096435,24.485407',
    ]),
    'extends'                     => '{}',
    'attach'                      => '{}',
    'channel_no'                  => 'AAGN9uhZc5EGyRdairKW7Qnu',
    'med_ins_test_env'            => true,
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/med-ins/orders')->post([
  'json' => [
    'mix_pay_type'                => 'CASH_AND_INSURANCE',
    'order_type'                  => 'REG_PAY',
    'appid'                       => 'wx8888888888888888',
    'sub_appid'                   => 'wxd678efh567hg6999',
    'sub_mchid'                   => '1900000109',
    'sub_openid'                  => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'payer'                       => [
      'name'      => '',
      'id_digest' => '',
      'card_type' => 'ID_CARD',
    ],
    'pay_for_relatives'           => true,
    'relative'                    => [
      'name'      => '',
      'id_digest' => '',
      'card_type' => 'ID_CARD',
    ],
    'out_trade_no'                => '202204022005169952975171534816',
    'serial_no'                   => '1217752501201',
    'pay_order_id'                => 'ORD530100202204022006350000021',
    'geo_location'                => '102.682296,25.054260',
    'city_id'                     => '530100',
    'med_inst_name'               => '北大医院',
    'med_inst_no'                 => '1217752501201407033233368318',
    'med_ins_order_create_time'   => '2018-06-08T10:34:56+08:00',
    'total_fee'                   => 202000,
    'med_ins_gov_fee'             => 100000,
    'med_ins_self_fee'            => 45000,
    'med_ins_other_fee'           => 5000,
    'med_ins_cash_fee'            => 50000,
    'wechat_pay_cash_fee'         => 42000,
    'cash_add_detail'             => [[
      'cash_add_fee'  => 2000,
      'cash_add_type' => 'FREIGHT',
    ],],
    'cash_reduce_detail'          => [[
      'cash_reduce_fee'  => 10000,
      'cash_reduce_type' => 'DEFAULT_REDUCE_TYPE',
    ],],
    'callback_url'                => 'https://www.weixin.qq.com/wxpay/pay.php',
    'prepay_id'                   => 'wx201410272009395522657a690389285100',
    'passthrough_request_content' => \json_encode([
      'payAuthNo'  => 'AUTH****',
      'payOrdId'   => 'ORD****',
      'setlLatlnt' => '118.096435,24.485407',
    ]),
    'extends'                     => '{}',
    'attach'                      => '{}',
    'channel_no'                  => 'AAGN9uhZc5EGyRdairKW7Qnu',
    'med_ins_test_env'            => true,
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/med-ins/orders']->post([
  'json' => [
    'mix_pay_type'                => 'CASH_AND_INSURANCE',
    'order_type'                  => 'REG_PAY',
    'appid'                       => 'wx8888888888888888',
    'sub_appid'                   => 'wxd678efh567hg6999',
    'sub_mchid'                   => '1900000109',
    'sub_openid'                  => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'payer'                       => [
      'name'      => '',
      'id_digest' => '',
      'card_type' => 'ID_CARD',
    ],
    'pay_for_relatives'           => true,
    'relative'                    => [
      'name'      => '',
      'id_digest' => '',
      'card_type' => 'ID_CARD',
    ],
    'out_trade_no'                => '202204022005169952975171534816',
    'serial_no'                   => '1217752501201',
    'pay_order_id'                => 'ORD530100202204022006350000021',
    'geo_location'                => '102.682296,25.054260',
    'city_id'                     => '530100',
    'med_inst_name'               => '北大医院',
    'med_inst_no'                 => '1217752501201407033233368318',
    'med_ins_order_create_time'   => '2018-06-08T10:34:56+08:00',
    'total_fee'                   => 202000,
    'med_ins_gov_fee'             => 100000,
    'med_ins_self_fee'            => 45000,
    'med_ins_other_fee'           => 5000,
    'med_ins_cash_fee'            => 50000,
    'wechat_pay_cash_fee'         => 42000,
    'cash_add_detail'             => [[
      'cash_add_fee'  => 2000,
      'cash_add_type' => 'FREIGHT',
    ],],
    'cash_reduce_detail'          => [[
      'cash_reduce_fee'  => 10000,
      'cash_reduce_type' => 'DEFAULT_REDUCE_TYPE',
    ],],
    'callback_url'                => 'https://www.weixin.qq.com/wxpay/pay.php',
    'prepay_id'                   => 'wx201410272009395522657a690389285100',
    'passthrough_request_content' => \json_encode([
      'payAuthNo'  => 'AUTH****',
      'payOrdId'   => 'ORD****',
      'setlLatlnt' => '118.096435,24.485407',
    ]),
    'extends'                     => '{}',
    'attach'                      => '{}',
    'channel_no'                  => 'AAGN9uhZc5EGyRdairKW7Qnu',
    'med_ins_test_env'            => true,
  ],
  'headers' => [
    'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
mix_trade_nostring医保自费混合订单号
mix_pay_statusstring医保自费混合订单支付状态
UNKNOWN_MIX_PAY_STATUS | MIX_PAY_CREATED | MIX_PAY_SUCCESS | MIX_PAY_REFUND | MIX_PAY_FAIL 枚举值之一
self_pay_statusstring混合订单中自费部分的支付状态
UNKNOWN_SELF_PAY_STATUS | SELF_PAY_CREATED | SELF_PAY_SUCCESS | SELF_PAY_REFUND | SELF_PAY_FAIL | NO_SELF_PAY 枚举值之一
med_ins_pay_statusstring混合订单中自费部分的支付状态
UNKNOWN_MED_INS_PAY_STATUS | MED_INS_PAY_CREATED | MED_INS_PAY_SUCCESS | MED_INS_PAY_REFUND | MED_INS_PAY_FAIL | NO_MED_INS_PAY 枚举值之一
paid_timestring订单支付时间
passthrough_response_contentstring支付完成后医保局返回内容
payAuthNostring
payOrdIdstring
setlLatlntstring
mix_pay_typestring混合支付类型
UNKNOWN_MIX_PAY_TYPE | CASH_ONLY | INSURANCE_ONLY | CASH_AND_INSURANCE 枚举值之一
order_typestring订单类型
UNKNOWN_ORDER_TYPE | REG_PAY | DIAG_PAY | COVID_EXAM_PAY | IN_HOSP_PAY | PHARMACY_PAY | INSURANCE_PAY | INT_REG_PAY | INT_RE_DIAG_PAY | INT_RX_PAY | COVID_ANTIGEN_PAY | MED_PAY 枚举值之一
appidstring从业机构的公众号ID
sub_appidstring医疗机构的公众号ID
sub_mchidstring医疗机构的商户号
sub_openidstring用户在医疗机构AppID下的唯一标识
pay_for_relativesboolean是否代亲属支付
out_trade_nostring从业机构订单号
serial_nostring医疗机构订单号
pay_order_idstring医保局返回的支付单ID
pay_auth_nostring医保局返回的支付授权码
geo_locationstring用户定位信息
city_idstring城市ID
med_inst_namestring医疗机构名称
med_inst_nostring医疗机构编码
med_ins_order_create_timestring医保下单时间
total_feeinteger使用该接口下单的总金额
med_ins_gov_feeinteger医保局结算后,医保统筹支付金额
med_ins_self_feeinteger医保局结算后,医保个账支付金额
med_ins_other_feeinteger医保局结算后,医保其他支付金额
med_ins_cash_feeinteger医保局结算后,需要自费的金额
wechat_pay_cash_feeinteger实际需要用户微信支付的金额
cash_add_detailobject[]现金补充列表
cash_add_feeinteger现金补充金额
cash_add_typestring现金补充类型
DEFAULT_ADD_TYPE | FREIGHT | OTHER_MEDICAL_EXPENSES 枚举值之一
cash_reduce_detailobject[]现金减免列表
cash_reduce_feeinteger现金减免金额
cash_reduce_typestring现金减免类型
DEFAULT_REDUCE_TYPE | HOSPITAL_REDUCE | PHARMACY_DISCOUNT | DISCOUNT | PRE_PAYMENT | DEPOSIT_DEDUCTION 枚举值之一
callback_urlstring回调通知URL
prepay_idstring自费预下单ID
passthrough_request_contentstring医疗机构透传给医保的数据
payAuthNostring
payOrdIdstring
setlLatlntstring
extendsstring扩展字段
attachstring附加数据
channel_nostring渠道号
med_ins_test_envboolean是否到医保局测试环境下单

参阅 官方文档

Published on the GitHub by TheNorthMemory