Skip to content

创建先用后付订单

请求参数类型描述
jsonobject声明请求的JSON数据结构
out_order_nostring商户服务订单号
appidstring公众账号ID
service_idstring服务ID
service_introductionstring服务信息
post_paymentsobject[]后付费项目
namestring付费项目名称
amountinteger金额
descriptionstring计费说明
countinteger付费数量
post_discountsobject[]后付费商户优惠
namestring优惠名称
descriptionstring优惠说明
amountinteger优惠金额
countinteger优惠数量
time_rangeobject服务时间段
start_timestring
start_time_remarkstring
end_timestring
end_time_remarkstring
locationobject服务位置
start_locationstring
end_locationstring
risk_fundobject订单风险金
namestring风险金名称
DEPOSIT | ADVANCE | CASH_DEPOSIT | ESTIMATE_ORDER_COST 枚举值之一
amountinteger风险金额
descriptionstring风险说明
attachstring商户数据包
notify_urlstring商户回调地址
openidstring用户标识
need_user_confirmboolean是否需要用户确认
mchidstring商户号
shopping_infoobject
real_merchant_appidstring实际购物商家公众号ID
jump_linkobject
jump_link_typestring跳转链接类型
JUMP_LINK_MINI_PROGRAM 枚举值
appidstring小程序跳转AppID
pathstring小程序跳转path
goodsobject[]
namestring商品名称
picturestring商品图片链接
amountinteger商品单价金额
countinteger商品数量
category_idstring[]
php
$instance->v3->payscore->servicepayondeliveryorder->postAsync([
  'json' => [
    'out_order_no' => '1234323JKHDFE1243252',
    'appid' => 'wxd678efh567hg6787',
    'service_id' => '500001',
    'service_introduction' => '某某酒店',
    'post_payments' => [[
      'name' => '就餐费用, 服务费',
      'amount' => 40000,
      'description' => '就餐人均100元,服务费:100/小时',
      'count' => 4,
    ],],
    'post_discounts' => [[
      'name' => '满20减1元',
      'description' => '不与其他优惠叠加',
      'amount' => 100,
      'count' => 2,
    ],],
    'time_range' => [
      'start_time' => '',
      'start_time_remark' => '',
      'end_time' => '',
      'end_time_remark' => '',
    ],
    '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,
    'mchid' => '1230000109',
    'shopping_info' => [
      'real_merchant_appid' => 'wxd678efh567hg6787',
      'jump_link' => [
        'jump_link_type' => 'JUMP_LINK_MINI_PROGRAM',
        'appid' => '',
        'path' => '',
      ],
      'goods' => [[
        'name' => '森海塞尔 MOMENTUM 4 无线耳机大馒头4 头戴式蓝牙音乐耳机自适应降噪',
        'picture' => 'http://mmbiz.qpic.cn/mmbiz_png/ldTw9dg46zkjOrzyTkbQAvQkysliaiblZhdthZWewgQMyqLZwStaNEsJrYmjwh2MlK7G4wibAFOEuISQKplSnxMWA/640?wx_fmt=png&wxfrom=200',
        'amount' => 40000,
        'count' => 4,
        'category_id' => ['string'],
      ],],
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/payscore/servicepayondeliveryorder')->postAsync([
  'json' => [
    'out_order_no' => '1234323JKHDFE1243252',
    'appid' => 'wxd678efh567hg6787',
    'service_id' => '500001',
    'service_introduction' => '某某酒店',
    'post_payments' => [[
      'name' => '就餐费用, 服务费',
      'amount' => 40000,
      'description' => '就餐人均100元,服务费:100/小时',
      'count' => 4,
    ],],
    'post_discounts' => [[
      'name' => '满20减1元',
      'description' => '不与其他优惠叠加',
      'amount' => 100,
      'count' => 2,
    ],],
    'time_range' => [
      'start_time' => '',
      'start_time_remark' => '',
      'end_time' => '',
      'end_time_remark' => '',
    ],
    '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,
    'mchid' => '1230000109',
    'shopping_info' => [
      'real_merchant_appid' => 'wxd678efh567hg6787',
      'jump_link' => [
        'jump_link_type' => 'JUMP_LINK_MINI_PROGRAM',
        'appid' => '',
        'path' => '',
      ],
      'goods' => [[
        'name' => '森海塞尔 MOMENTUM 4 无线耳机大馒头4 头戴式蓝牙音乐耳机自适应降噪',
        'picture' => 'http://mmbiz.qpic.cn/mmbiz_png/ldTw9dg46zkjOrzyTkbQAvQkysliaiblZhdthZWewgQMyqLZwStaNEsJrYmjwh2MlK7G4wibAFOEuISQKplSnxMWA/640?wx_fmt=png&wxfrom=200',
        'amount' => 40000,
        'count' => 4,
        'category_id' => ['string'],
      ],],
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/payscore/servicepayondeliveryorder']->postAsync([
  'json' => [
    'out_order_no' => '1234323JKHDFE1243252',
    'appid' => 'wxd678efh567hg6787',
    'service_id' => '500001',
    'service_introduction' => '某某酒店',
    'post_payments' => [[
      'name' => '就餐费用, 服务费',
      'amount' => 40000,
      'description' => '就餐人均100元,服务费:100/小时',
      'count' => 4,
    ],],
    'post_discounts' => [[
      'name' => '满20减1元',
      'description' => '不与其他优惠叠加',
      'amount' => 100,
      'count' => 2,
    ],],
    'time_range' => [
      'start_time' => '',
      'start_time_remark' => '',
      'end_time' => '',
      'end_time_remark' => '',
    ],
    '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,
    'mchid' => '1230000109',
    'shopping_info' => [
      'real_merchant_appid' => 'wxd678efh567hg6787',
      'jump_link' => [
        'jump_link_type' => 'JUMP_LINK_MINI_PROGRAM',
        'appid' => '',
        'path' => '',
      ],
      'goods' => [[
        'name' => '森海塞尔 MOMENTUM 4 无线耳机大馒头4 头戴式蓝牙音乐耳机自适应降噪',
        'picture' => 'http://mmbiz.qpic.cn/mmbiz_png/ldTw9dg46zkjOrzyTkbQAvQkysliaiblZhdthZWewgQMyqLZwStaNEsJrYmjwh2MlK7G4wibAFOEuISQKplSnxMWA/640?wx_fmt=png&wxfrom=200',
        'amount' => 40000,
        'count' => 4,
        'category_id' => ['string'],
      ],],
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->payscore->servicepayondeliveryorder->post([
  'json' => [
    'out_order_no' => '1234323JKHDFE1243252',
    'appid' => 'wxd678efh567hg6787',
    'service_id' => '500001',
    'service_introduction' => '某某酒店',
    'post_payments' => [[
      'name' => '就餐费用, 服务费',
      'amount' => 40000,
      'description' => '就餐人均100元,服务费:100/小时',
      'count' => 4,
    ],],
    'post_discounts' => [[
      'name' => '满20减1元',
      'description' => '不与其他优惠叠加',
      'amount' => 100,
      'count' => 2,
    ],],
    'time_range' => [
      'start_time' => '',
      'start_time_remark' => '',
      'end_time' => '',
      'end_time_remark' => '',
    ],
    '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,
    'mchid' => '1230000109',
    'shopping_info' => [
      'real_merchant_appid' => 'wxd678efh567hg6787',
      'jump_link' => [
        'jump_link_type' => 'JUMP_LINK_MINI_PROGRAM',
        'appid' => '',
        'path' => '',
      ],
      'goods' => [[
        'name' => '森海塞尔 MOMENTUM 4 无线耳机大馒头4 头戴式蓝牙音乐耳机自适应降噪',
        'picture' => 'http://mmbiz.qpic.cn/mmbiz_png/ldTw9dg46zkjOrzyTkbQAvQkysliaiblZhdthZWewgQMyqLZwStaNEsJrYmjwh2MlK7G4wibAFOEuISQKplSnxMWA/640?wx_fmt=png&wxfrom=200',
        'amount' => 40000,
        'count' => 4,
        'category_id' => ['string'],
      ],],
    ],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/payscore/servicepayondeliveryorder')->post([
  'json' => [
    'out_order_no' => '1234323JKHDFE1243252',
    'appid' => 'wxd678efh567hg6787',
    'service_id' => '500001',
    'service_introduction' => '某某酒店',
    'post_payments' => [[
      'name' => '就餐费用, 服务费',
      'amount' => 40000,
      'description' => '就餐人均100元,服务费:100/小时',
      'count' => 4,
    ],],
    'post_discounts' => [[
      'name' => '满20减1元',
      'description' => '不与其他优惠叠加',
      'amount' => 100,
      'count' => 2,
    ],],
    'time_range' => [
      'start_time' => '',
      'start_time_remark' => '',
      'end_time' => '',
      'end_time_remark' => '',
    ],
    '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,
    'mchid' => '1230000109',
    'shopping_info' => [
      'real_merchant_appid' => 'wxd678efh567hg6787',
      'jump_link' => [
        'jump_link_type' => 'JUMP_LINK_MINI_PROGRAM',
        'appid' => '',
        'path' => '',
      ],
      'goods' => [[
        'name' => '森海塞尔 MOMENTUM 4 无线耳机大馒头4 头戴式蓝牙音乐耳机自适应降噪',
        'picture' => 'http://mmbiz.qpic.cn/mmbiz_png/ldTw9dg46zkjOrzyTkbQAvQkysliaiblZhdthZWewgQMyqLZwStaNEsJrYmjwh2MlK7G4wibAFOEuISQKplSnxMWA/640?wx_fmt=png&wxfrom=200',
        'amount' => 40000,
        'count' => 4,
        'category_id' => ['string'],
      ],],
    ],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/payscore/servicepayondeliveryorder']->post([
  'json' => [
    'out_order_no' => '1234323JKHDFE1243252',
    'appid' => 'wxd678efh567hg6787',
    'service_id' => '500001',
    'service_introduction' => '某某酒店',
    'post_payments' => [[
      'name' => '就餐费用, 服务费',
      'amount' => 40000,
      'description' => '就餐人均100元,服务费:100/小时',
      'count' => 4,
    ],],
    'post_discounts' => [[
      'name' => '满20减1元',
      'description' => '不与其他优惠叠加',
      'amount' => 100,
      'count' => 2,
    ],],
    'time_range' => [
      'start_time' => '',
      'start_time_remark' => '',
      'end_time' => '',
      'end_time_remark' => '',
    ],
    '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,
    'mchid' => '1230000109',
    'shopping_info' => [
      'real_merchant_appid' => 'wxd678efh567hg6787',
      'jump_link' => [
        'jump_link_type' => 'JUMP_LINK_MINI_PROGRAM',
        'appid' => '',
        'path' => '',
      ],
      'goods' => [[
        'name' => '森海塞尔 MOMENTUM 4 无线耳机大馒头4 头戴式蓝牙音乐耳机自适应降噪',
        'picture' => 'http://mmbiz.qpic.cn/mmbiz_png/ldTw9dg46zkjOrzyTkbQAvQkysliaiblZhdthZWewgQMyqLZwStaNEsJrYmjwh2MlK7G4wibAFOEuISQKplSnxMWA/640?wx_fmt=png&wxfrom=200',
        'amount' => 40000,
        'count' => 4,
        'category_id' => ['string'],
      ],],
    ],
  ],
]);
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跳转微信侧小程序订单数据
shopping_infoobject先用后付购物详情
real_merchant_appidstring实际购物商家公众号ID
jump_linkobject单详跳转链接
jump_link_typestring跳转链接类型
appidstring小程序跳转AppID
pathstring小程序跳转path
goodsobject[]商品列表
namestring商品名称
picturestring商品图片链接
amountnumber商品单价金额
countnumber商品数量
category_idstring[]

参阅 官方文档

Published on the GitHub by TheNorthMemory