Skip to content

普通商户创建及查询微信支付分订单信息

创建支付分订单

用户申请使用服务时,商户可通过此接口申请创建微信支付分订单。

请求参数类型描述
jsonobject声明请求的JSON数据结构
out_order_nostring商户服务订单号
appidstring公众账号ID
service_idstring服务ID
service_introductionstring服务信息
post_paymentsobject[]后付费项目
namestring付费名称
amountnumber付费金额
descriptionstring付费说明
countnumber付费数量
post_discountsobject[]商户优惠
namestring优惠名称
descriptionstring优惠说明
countnumber优惠数量
time_rangeobject服务时间段
start_timestring服务开始时间
end_timestring服务结束时间
start_time_remarkstring服务开始时间备注
end_time_remarkstring服务结束时间备注
locationobject服务位置
start_locationstring服务开始地点
end_locationstring服务结束地点
risk_fundobject服务风险金
namestring风险名称
amountnumber风险金额
descriptionstring风险说明
attachstring商户数据包
notify_urlstring商户回调地址
openidstring用户标识
need_user_confirmboolean是否需要用户确认
php
$instance->v3->payscore->serviceorder->postAsync([
  'json' => [
    'out_order_no'         => '1234323JKHDFE1243252',
    'appid'                => 'wxd678efh567hg6787',
    'service_id'           => '2002000000000558128851361561536',
    'service_introduction' => '某某酒店',
    'post_payments'        => [[
      'name'        => '就餐费用',
      'amount'      => 40000,
      'description' => '就餐人均100元',
      'count'       => 4,
    ],],
    'post_discounts'       => [[
      'name'        => '满20减1元',
      'description' => '不与其他优惠叠加',
      'count'       => 2,
    ],],
    'time_range'           => [
      'start_time'        => '20091225091010',
      'end_time'          => '20091225121010',
      'start_time_remark' => '备注1',
      'end_time_remark'   => '备注2',
    ],
    'location'             => [
      'start_location' => '嗨客时尚主题展餐厅',
      'end_location'   => '嗨客时尚主题展餐厅',
    ],
    'risk_fund'            => [
      'name'        => 'DEPOSIT',
      'amount'      => 10000,
      'description' => '就餐的预估费用',
    ],
    'attach'               => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
    'notify_url'           => 'https://api.test.com',
    'openid'               => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'need_user_confirm'    => true,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/payscore/serviceorder')->postAsync([
  'json' => [
    'out_order_no'         => '1234323JKHDFE1243252',
    'appid'                => 'wxd678efh567hg6787',
    'service_id'           => '2002000000000558128851361561536',
    'service_introduction' => '某某酒店',
    'post_payments'        => [[
      'name'        => '就餐费用',
      'amount'      => 40000,
      'description' => '就餐人均100元',
      'count'       => 4,
    ],],
    'post_discounts'       => [[
      'name'        => '满20减1元',
      'description' => '不与其他优惠叠加',
      'count'       => 2,
    ],],
    'time_range'           => [
      'start_time'        => '20091225091010',
      'end_time'          => '20091225121010',
      'start_time_remark' => '备注1',
      'end_time_remark'   => '备注2',
    ],
    'location'             => [
      'start_location' => '嗨客时尚主题展餐厅',
      'end_location'   => '嗨客时尚主题展餐厅',
    ],
    'risk_fund'            => [
      'name'        => 'DEPOSIT',
      'amount'      => 10000,
      'description' => '就餐的预估费用',
    ],
    'attach'               => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
    'notify_url'           => 'https://api.test.com',
    'openid'               => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'need_user_confirm'    => true,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/payscore/serviceorder']->postAsync([
  'json' => [
    'out_order_no'         => '1234323JKHDFE1243252',
    'appid'                => 'wxd678efh567hg6787',
    'service_id'           => '2002000000000558128851361561536',
    'service_introduction' => '某某酒店',
    'post_payments'        => [[
      'name'        => '就餐费用',
      'amount'      => 40000,
      'description' => '就餐人均100元',
      'count'       => 4,
    ],],
    'post_discounts'       => [[
      'name'        => '满20减1元',
      'description' => '不与其他优惠叠加',
      'count'       => 2,
    ],],
    'time_range'           => [
      'start_time'        => '20091225091010',
      'end_time'          => '20091225121010',
      'start_time_remark' => '备注1',
      'end_time_remark'   => '备注2',
    ],
    'location'             => [
      'start_location' => '嗨客时尚主题展餐厅',
      'end_location'   => '嗨客时尚主题展餐厅',
    ],
    'risk_fund'            => [
      'name'        => 'DEPOSIT',
      'amount'      => 10000,
      'description' => '就餐的预估费用',
    ],
    'attach'               => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
    'notify_url'           => 'https://api.test.com',
    'openid'               => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'need_user_confirm'    => true,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->payscore->serviceorder->post([
  'json' => [
    'out_order_no'         => '1234323JKHDFE1243252',
    'appid'                => 'wxd678efh567hg6787',
    'service_id'           => '2002000000000558128851361561536',
    'service_introduction' => '某某酒店',
    'post_payments'        => [[
      'name'        => '就餐费用',
      'amount'      => 40000,
      'description' => '就餐人均100元',
      'count'       => 4,
    ],],
    'post_discounts'       => [[
      'name'        => '满20减1元',
      'description' => '不与其他优惠叠加',
      'count'       => 2,
    ],],
    'time_range'           => [
      'start_time'        => '20091225091010',
      'end_time'          => '20091225121010',
      'start_time_remark' => '备注1',
      'end_time_remark'   => '备注2',
    ],
    'location'             => [
      'start_location' => '嗨客时尚主题展餐厅',
      'end_location'   => '嗨客时尚主题展餐厅',
    ],
    'risk_fund'            => [
      'name'        => 'DEPOSIT',
      'amount'      => 10000,
      'description' => '就餐的预估费用',
    ],
    'attach'               => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
    'notify_url'           => 'https://api.test.com',
    'openid'               => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'need_user_confirm'    => true,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/payscore/serviceorder')->post([
  'json' => [
    'out_order_no'         => '1234323JKHDFE1243252',
    'appid'                => 'wxd678efh567hg6787',
    'service_id'           => '2002000000000558128851361561536',
    'service_introduction' => '某某酒店',
    'post_payments'        => [[
      'name'        => '就餐费用',
      'amount'      => 40000,
      'description' => '就餐人均100元',
      'count'       => 4,
    ],],
    'post_discounts'       => [[
      'name'        => '满20减1元',
      'description' => '不与其他优惠叠加',
      'count'       => 2,
    ],],
    'time_range'           => [
      'start_time'        => '20091225091010',
      'end_time'          => '20091225121010',
      'start_time_remark' => '备注1',
      'end_time_remark'   => '备注2',
    ],
    'location'             => [
      'start_location' => '嗨客时尚主题展餐厅',
      'end_location'   => '嗨客时尚主题展餐厅',
    ],
    'risk_fund'            => [
      'name'        => 'DEPOSIT',
      'amount'      => 10000,
      'description' => '就餐的预估费用',
    ],
    'attach'               => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
    'notify_url'           => 'https://api.test.com',
    'openid'               => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'need_user_confirm'    => true,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/payscore/serviceorder']->post([
  'json' => [
    'out_order_no'         => '1234323JKHDFE1243252',
    'appid'                => 'wxd678efh567hg6787',
    'service_id'           => '2002000000000558128851361561536',
    'service_introduction' => '某某酒店',
    'post_payments'        => [[
      'name'        => '就餐费用',
      'amount'      => 40000,
      'description' => '就餐人均100元',
      'count'       => 4,
    ],],
    'post_discounts'       => [[
      'name'        => '满20减1元',
      'description' => '不与其他优惠叠加',
      'count'       => 2,
    ],],
    'time_range'           => [
      'start_time'        => '20091225091010',
      'end_time'          => '20091225121010',
      'start_time_remark' => '备注1',
      'end_time_remark'   => '备注2',
    ],
    'location'             => [
      'start_location' => '嗨客时尚主题展餐厅',
      'end_location'   => '嗨客时尚主题展餐厅',
    ],
    'risk_fund'            => [
      'name'        => 'DEPOSIT',
      'amount'      => 10000,
      'description' => '就餐的预估费用',
    ],
    'attach'               => 'Easdfowealsdkjfnlaksjdlfkwqoi&wl3l2sald',
    'notify_url'           => 'https://api.test.com',
    'openid'               => 'oUpF8uMuAJO_M2pxb1Q9zNjWeS6o',
    'need_user_confirm'    => true,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
appidstring公众账号ID
mchidstring商户号
out_order_nostring商户服务订单号
service_idstring服务ID
service_introductionstring服务信息
statestring服务订单状态
state_descriptionstring订单状态说明
post_paymentsobject[]后付费项目
namestring付费名称
amountnumber付费金额
descriptionstring付费说明
countnumber付费数量
post_discountsobject[]后付费商户优惠
namestring优惠名称
descriptionstring优惠说明
amountnumber优惠金额
countnumber优惠数量
risk_fundobject服务风险金
namestring风险名称
amountnumber风险金额
descriptionstring风险说明
time_rangeobject服务时间段
start_timestring服务开始时间
end_timestring服务结束时间
start_time_remarkstring服务开始时间备注
end_time_remarkstring服务结束时间备注
locationobject服务位置
start_locationstring服务开始地点
end_locationstring服务结束地点
attachstring商户数据包
notify_urlstring商户回调地址
order_idstring微信支付服务订单号
packagestring跳转微信侧小程序订单数据

参阅 官方文档 官方文档

查询支付分订单

用于查询单笔微信支付分订单详细信息。

请求参数类型描述
queryobject声明请求的查询参数
out_order_nostring商户服务订单号
query_idstring回跳查询ID
service_idstring服务ID
appidstring公众账号ID
php
$instance->v3->payscore->serviceorder->getAsync([
  'query' => [
    'out_order_no' => '1234323JKHDFE1243252',
    'query_id'     => '',
    'service_id'   => '2002000000000558128851361561536',
    'appid'        => 'wxd678efh567hg6787',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/payscore/serviceorder')->getAsync([
  'query' => [
    'out_order_no' => '1234323JKHDFE1243252',
    'query_id'     => '',
    'service_id'   => '2002000000000558128851361561536',
    'appid'        => 'wxd678efh567hg6787',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/payscore/serviceorder']->getAsync([
  'query' => [
    'out_order_no' => '1234323JKHDFE1243252',
    'query_id'     => '',
    'service_id'   => '2002000000000558128851361561536',
    'appid'        => 'wxd678efh567hg6787',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->payscore->serviceorder->get([
  'query' => [
    'out_order_no' => '1234323JKHDFE1243252',
    'query_id'     => '',
    'service_id'   => '2002000000000558128851361561536',
    'appid'        => 'wxd678efh567hg6787',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/payscore/serviceorder')->get([
  'query' => [
    'out_order_no' => '1234323JKHDFE1243252',
    'query_id'     => '',
    'service_id'   => '2002000000000558128851361561536',
    'appid'        => 'wxd678efh567hg6787',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/payscore/serviceorder']->get([
  'query' => [
    'out_order_no' => '1234323JKHDFE1243252',
    'query_id'     => '',
    'service_id'   => '2002000000000558128851361561536',
    'appid'        => 'wxd678efh567hg6787',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
out_order_nostring商户服务订单号
service_idstring服务ID
appidstring服务商公众号ID
mchidstring服务商商户号
service_introductionstring服务信息
statestring服务订单状态
state_descriptionstring订单状态说明
post_paymentsobject[]后付费项目
namestring付费名称
amountnumber付费金额
descriptionstring付费说明
countnumber付费数量
post_discountsobject[]商户优惠
namestring优惠名称
descriptionstring优惠说明
amountnumber优惠金额
countnumber优惠数量
risk_fundobject服务风险金
namestring风险名称
amountnumber风险金额
descriptionstring风险说明
total_amountnumber总金额
need_collectionboolean是否需要收款
collectionobject收款信息
statestring收款状态
total_amountnumber总收款金额
paying_amountnumber待收金额
paid_amountnumber已收金额
detailsobject[]收款明细列表
seqnumber收款序号
amountnumber单笔收款金额
paid_typestring收款成功渠道
paid_timestring收款成功时间
transaction_idstring微信支付交易单号
promotion_detailobject[]优惠功能
coupon_idstring券ID
namestring优惠名称
scopestring优惠范围
typestring优惠类型
amountnumber优惠券面额
stock_idstring活动ID
wechatpay_contributenumber微信出资
merchant_contributenumber商户出资
other_contributenumber其他出资
currencystring优惠币种
goods_detailobject[]单品列表
goods_idstring商品编码
quantitynumber商品数量
unit_pricenumber商品价格
discount_amountnumber商品优惠金额
goods_remarkstring商品备注
bank_typestring收款银行
time_rangeobject服务时间
start_timestring服务开始时间
end_timestring服务结束时间
start_time_remarkstring服务开始时间备注
end_time_remarkstring服务结束时间备注
locationobject服务位置
start_locationstring服务开始地点
end_locationstring服务结束地点
attachstring附加数据
notify_urlstring商户回调地址
openidstring服务商公众号下的用户标识
order_idstring微信支付服务订单号

参阅 官方文档 官方文档

Published on the GitHub by TheNorthMemory