导入会员Code
如果会员卡的code分配类型是“预存code”模式,商户可向特定会员卡card_id导入code,导入后自动将会员卡库存数量更新成code数量。用户领取会员卡时,将从这些code里随机分配。
请求参数 | 类型 | 描述 |
---|---|---|
card_id | string | 会员卡id |
json | object | 声明请求的JSON 数据结构 |
code | string[] |
php
$instance->v3->marketing->membercardOpen->cards->_card_id_->codes->deposit->postAsync([
'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
'json' => [
'code' => ['string'],
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/marketing/membercard-open/cards/{card_id}/codes/deposit')->postAsync([
'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
'json' => [
'code' => ['string'],
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/marketing/membercard-open/cards/{card_id}/codes/deposit']->postAsync([
'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
'json' => [
'code' => ['string'],
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->marketing->membercardOpen->cards->_card_id_->codes->deposit->post([
'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
'json' => [
'code' => ['string'],
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/marketing/membercard-open/cards/{card_id}/codes/deposit')->post([
'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
'json' => [
'code' => ['string'],
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/marketing/membercard-open/cards/{card_id}/codes/deposit']->post([
'card_id' => 'pbLatjvWOibDc5-TBnbUk1pD12o0',
'json' => [
'code' => ['string'],
],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典 | 类型 | 描述 |
---|---|---|
data | object[] | 导入结果 |
code | string | 会员卡code |
参阅 官方文档