出行券切卡组件预下单
商户在拉起快捷切卡小程序前,需要先调用本接口预下单,下单成功后,通过返回的token拉起小程序,本接口的调用商户需要和拉起组件传入的调用商户是同一个。
请求参数 | 类型 | 描述 |
---|---|---|
json | object | 声明请求的JSON 数据结构 |
open_id | string | 用户标识 |
coupon_list | object[] | 出行券列表 |
stock_id | integer | 批次号 |
coupon_id | string | 券ID |
php
$instance->v3->industryCoupon->tokens->postAsync([
'json' => [
'open_id' => 'obLatjrR8kUDlj4-nofQsPAJAAFI',
'coupon_list' => [[
'stock_id' => 16474341,
'coupon_id' => '11004999626',
],],
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/industry-coupon/tokens')->postAsync([
'json' => [
'open_id' => 'obLatjrR8kUDlj4-nofQsPAJAAFI',
'coupon_list' => [[
'stock_id' => 16474341,
'coupon_id' => '11004999626',
],],
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/industry-coupon/tokens']->postAsync([
'json' => [
'open_id' => 'obLatjrR8kUDlj4-nofQsPAJAAFI',
'coupon_list' => [[
'stock_id' => 16474341,
'coupon_id' => '11004999626',
],],
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->industryCoupon->tokens->post([
'json' => [
'open_id' => 'obLatjrR8kUDlj4-nofQsPAJAAFI',
'coupon_list' => [[
'stock_id' => 16474341,
'coupon_id' => '11004999626',
],],
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/industry-coupon/tokens')->post([
'json' => [
'open_id' => 'obLatjrR8kUDlj4-nofQsPAJAAFI',
'coupon_list' => [[
'stock_id' => 16474341,
'coupon_id' => '11004999626',
],],
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/industry-coupon/tokens']->post([
'json' => [
'open_id' => 'obLatjrR8kUDlj4-nofQsPAJAAFI',
'coupon_list' => [[
'stock_id' => 16474341,
'coupon_id' => '11004999626',
],],
],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典 | 类型 | 描述 |
---|---|---|
token | string | 切卡组件token值 |
expires_time | string | token过期时间 |
参阅 官方文档