Skip to content

创建保险订单

商户可通过该接口创建保险订单。

请求参数类型描述
jsonobject声明请求的JSON数据结构
out_order_nostring商户创建保险订单时的凭据号
openidstring微信用户在商户对应appid下的唯一标识
notify_urlstring用于接收保险订单状态变化通知
service_idstring商户在支付分服务下对应的服务ID
php
$instance->v3->hirePowerBank->insuranceOrders->postAsync([
  'json' => [
    'out_order_no' => '6e8369071cd942c0476613f9d1ce9ca3',
    'openid'       => '2323dfsdf342342',
    'notify_url'   => 'https://api.test.com',
    'service_id'   => '实例值',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/hire-power-bank/insurance-orders')->postAsync([
  'json' => [
    'out_order_no' => '6e8369071cd942c0476613f9d1ce9ca3',
    'openid'       => '2323dfsdf342342',
    'notify_url'   => 'https://api.test.com',
    'service_id'   => '实例值',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/hire-power-bank/insurance-orders']->postAsync([
  'json' => [
    'out_order_no' => '6e8369071cd942c0476613f9d1ce9ca3',
    'openid'       => '2323dfsdf342342',
    'notify_url'   => 'https://api.test.com',
    'service_id'   => '实例值',
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->hirePowerBank->insuranceOrders->post([
  'json' => [
    'out_order_no' => '6e8369071cd942c0476613f9d1ce9ca3',
    'openid'       => '2323dfsdf342342',
    'notify_url'   => 'https://api.test.com',
    'service_id'   => '实例值',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/hire-power-bank/insurance-orders')->post([
  'json' => [
    'out_order_no' => '6e8369071cd942c0476613f9d1ce9ca3',
    'openid'       => '2323dfsdf342342',
    'notify_url'   => 'https://api.test.com',
    'service_id'   => '实例值',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/hire-power-bank/insurance-orders']->post([
  'json' => [
    'out_order_no' => '6e8369071cd942c0476613f9d1ce9ca3',
    'openid'       => '2323dfsdf342342',
    'notify_url'   => 'https://api.test.com',
    'service_id'   => '实例值',
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
order_idstring租借充电宝隔夜归还保险订单号,唯一标识一笔保险订单
out_order_nostring商户创建保险订单时的凭据号
openidstring微信用户在商户对应appid下的唯一标识
max_claim_countinteger一笔保险订单对应的最大理赔次数
claimed_countinteger一笔保险订单对应的已理赔次数
order_receive_timestring保险订单领取时间,遵循rfc3339标准格式
order_begin_timestring保险订单开始时间,遵循rfc3339标准格式
order_end_timestring保险订单结束时间,遵循rfc3339标准格式
order_receive_statestring保险订单领取状态

参阅 官方文档

Published on the GitHub by TheNorthMemory