pokepay_partner_ruby_sdk 0.1.18 → 0.1.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/docs/index.md +957 -145
- data/lib/pokepay_partner_ruby_sdk/client.rb +8 -0
- data/lib/pokepay_partner_ruby_sdk/request/get_campaign.rb +15 -0
- data/lib/pokepay_partner_ruby_sdk/request/list_campaigns.rb +15 -0
- data/lib/pokepay_partner_ruby_sdk/request/list_transactions_v2.rb +15 -0
- data/lib/pokepay_partner_ruby_sdk/request/update_account.rb +2 -2
- data/lib/pokepay_partner_ruby_sdk/request/update_campaign.rb +15 -0
- data/lib/pokepay_partner_ruby_sdk/response/account_detail.rb +2 -0
- data/lib/pokepay_partner_ruby_sdk/response/campaign.rb +3 -0
- data/lib/pokepay_partner_ruby_sdk/response/paginated_campaigns.rb +16 -0
- data/lib/pokepay_partner_ruby_sdk/response/paginated_transaction_v2.rb +19 -0
- data/lib/pokepay_partner_ruby_sdk/version.rb +1 -1
- data/lib/pokepay_partner_ruby_sdk.rb +6 -0
- data/partner.yaml +881 -2
- metadata +8 -2
data/partner.yaml
CHANGED
@@ -160,6 +160,10 @@ components:
|
|
160
160
|
$ref: '#/components/schemas/PrivateMoney'
|
161
161
|
user:
|
162
162
|
$ref: '#/components/schemas/User'
|
163
|
+
external_id:
|
164
|
+
type: string
|
165
|
+
nullable: true
|
166
|
+
maxLength: 50
|
163
167
|
ShopAccount:
|
164
168
|
x-pokepay-schema-type: "response"
|
165
169
|
properties:
|
@@ -887,6 +891,33 @@ components:
|
|
887
891
|
minimum: 0
|
888
892
|
pagination:
|
889
893
|
$ref: '#/components/schemas/Pagination'
|
894
|
+
PaginatedTransactionV2:
|
895
|
+
x-pokepay-schema-type: "response"
|
896
|
+
properties:
|
897
|
+
rows:
|
898
|
+
type: array
|
899
|
+
items:
|
900
|
+
$ref: '#/components/schemas/Transaction'
|
901
|
+
per_page:
|
902
|
+
type: integer
|
903
|
+
count:
|
904
|
+
type: integer
|
905
|
+
next_page_cursor_id:
|
906
|
+
type: string
|
907
|
+
format: uuid
|
908
|
+
nullable: true
|
909
|
+
description: |-
|
910
|
+
次ページ取得するためのID。
|
911
|
+
|
912
|
+
実際にはrows末尾
|
913
|
+
prev_page_cursor_id:
|
914
|
+
type: string
|
915
|
+
format: uuid
|
916
|
+
nullable: true
|
917
|
+
description: |-
|
918
|
+
前ページ取得するためのID。
|
919
|
+
|
920
|
+
実際にはrows先頭
|
890
921
|
PaginatedTransfers:
|
891
922
|
x-pokepay-schema-type: "response"
|
892
923
|
properties:
|
@@ -1034,6 +1065,9 @@ components:
|
|
1034
1065
|
private_money:
|
1035
1066
|
title: 'キャンペーンを適用するマネー'
|
1036
1067
|
$ref: '#/components/schemas/PrivateMoney'
|
1068
|
+
dest_private_money:
|
1069
|
+
title: 'ポイントを付与するマネー'
|
1070
|
+
$ref: '#/components/schemas/PrivateMoney'
|
1037
1071
|
point_calculation_rule:
|
1038
1072
|
type: string
|
1039
1073
|
title: 'ポイント計算ルール (banklisp表記)'
|
@@ -1045,6 +1079,18 @@ components:
|
|
1045
1079
|
type: string
|
1046
1080
|
enum: [enabled, disabled]
|
1047
1081
|
title: 'キャンペーンの現在の状態'
|
1082
|
+
PaginatedCampaigns:
|
1083
|
+
x-pokepay-schema-type: "response"
|
1084
|
+
properties:
|
1085
|
+
rows:
|
1086
|
+
type: array
|
1087
|
+
items:
|
1088
|
+
$ref: '#/components/schemas/Campaign'
|
1089
|
+
count:
|
1090
|
+
type: integer
|
1091
|
+
minimum: 0
|
1092
|
+
pagination:
|
1093
|
+
$ref: '#/components/schemas/Pagination'
|
1048
1094
|
BadRequest:
|
1049
1095
|
x-pokepay-schema-type: "response"
|
1050
1096
|
oneOf:
|
@@ -1409,7 +1455,7 @@ paths:
|
|
1409
1455
|
content:
|
1410
1456
|
application/json:
|
1411
1457
|
schema:
|
1412
|
-
$ref: '#/components/schemas/
|
1458
|
+
$ref: '#/components/schemas/AccountDetail'
|
1413
1459
|
'400':
|
1414
1460
|
$ref: '#/components/responses/BadRequest'
|
1415
1461
|
'403':
|
@@ -2359,6 +2405,174 @@ paths:
|
|
2359
2405
|
$ref: '#/components/responses/Forbidden'
|
2360
2406
|
'422':
|
2361
2407
|
$ref: '#/components/responses/UnprocessableEntity'
|
2408
|
+
/transactions-v2:
|
2409
|
+
get:
|
2410
|
+
tags:
|
2411
|
+
- Transaction
|
2412
|
+
summary: '取引履歴を取得する'
|
2413
|
+
description: 取引一覧を返します。
|
2414
|
+
x-pokepay-operator-name: "ListTransactionsV2"
|
2415
|
+
x-pokepay-allow-server-side: true
|
2416
|
+
requestBody:
|
2417
|
+
required: true
|
2418
|
+
content:
|
2419
|
+
application/json:
|
2420
|
+
schema:
|
2421
|
+
required: ["private_money_id"]
|
2422
|
+
properties:
|
2423
|
+
private_money_id:
|
2424
|
+
type: string
|
2425
|
+
format: uuid
|
2426
|
+
title: 'マネーID'
|
2427
|
+
description: |-
|
2428
|
+
マネーIDです。
|
2429
|
+
|
2430
|
+
指定したマネーでの取引が一覧に表示されます。
|
2431
|
+
organization_code:
|
2432
|
+
type: string
|
2433
|
+
pattern: '^[a-zA-Z0-9-]*$'
|
2434
|
+
maxLength: 32
|
2435
|
+
title: '組織コード'
|
2436
|
+
description: |-
|
2437
|
+
組織コードです。
|
2438
|
+
|
2439
|
+
フィルターとして使われ、指定された組織での取引のみ一覧に表示されます。
|
2440
|
+
example: 'pocketchange'
|
2441
|
+
shop_id:
|
2442
|
+
type: string
|
2443
|
+
format: uuid
|
2444
|
+
title: '店舗ID'
|
2445
|
+
description: |-
|
2446
|
+
店舗IDです。
|
2447
|
+
|
2448
|
+
フィルターとして使われ、指定された店舗での取引のみ一覧に表示されます。
|
2449
|
+
terminal_id:
|
2450
|
+
type: string
|
2451
|
+
format: uuid
|
2452
|
+
title: '端末ID'
|
2453
|
+
description: |-
|
2454
|
+
端末IDです。
|
2455
|
+
|
2456
|
+
フィルターとして使われ、指定された端末での取引のみ一覧に表示されます。
|
2457
|
+
customer_id:
|
2458
|
+
type: string
|
2459
|
+
format: uuid
|
2460
|
+
title: 'エンドユーザーID'
|
2461
|
+
description: |-
|
2462
|
+
エンドユーザーIDです。
|
2463
|
+
|
2464
|
+
フィルターとして使われ、指定されたエンドユーザーでの取引のみ一覧に表示されます。
|
2465
|
+
customer_name:
|
2466
|
+
type: string
|
2467
|
+
maxLength: 256
|
2468
|
+
title: 'エンドユーザー名'
|
2469
|
+
description: |-
|
2470
|
+
エンドユーザー名です。
|
2471
|
+
|
2472
|
+
フィルターとして使われ、入力された名前に部分一致するエンドユーザーでの取引のみ一覧に表示されます。
|
2473
|
+
example: 太郎
|
2474
|
+
description:
|
2475
|
+
type: string
|
2476
|
+
maxLength: 200
|
2477
|
+
title: '取引説明文'
|
2478
|
+
description: |-
|
2479
|
+
取引を指定の取引説明文でフィルターします。
|
2480
|
+
|
2481
|
+
取引説明文が完全一致する取引のみ抽出されます。取引説明文は最大200文字で記録されています。
|
2482
|
+
example: 店頭QRコードによる支払い
|
2483
|
+
transaction_id:
|
2484
|
+
type: string
|
2485
|
+
format: uuid
|
2486
|
+
title: '取引ID'
|
2487
|
+
description: |-
|
2488
|
+
取引IDです。
|
2489
|
+
|
2490
|
+
フィルターとして使われ、指定された取引のみ一覧に表示されます。
|
2491
|
+
is_modified:
|
2492
|
+
type: boolean
|
2493
|
+
title: 'キャンセルフラグ'
|
2494
|
+
description: |-
|
2495
|
+
キャンセルフラグです。
|
2496
|
+
|
2497
|
+
これにtrueを指定するとキャンセルされた取引のみ一覧に表示されます。
|
2498
|
+
デフォルト値はfalseで、キャンセルの有無にかかわらず一覧に表示されます。
|
2499
|
+
types:
|
2500
|
+
type: array
|
2501
|
+
title: '取引種別 (複数指定可)、チャージ=topup、支払い=payment'
|
2502
|
+
example: '["topup", "payment"]'
|
2503
|
+
description: |-
|
2504
|
+
取引の種類でフィルターします。
|
2505
|
+
|
2506
|
+
以下の種類を指定できます。
|
2507
|
+
|
2508
|
+
1. topup
|
2509
|
+
店舗からエンドユーザーへの送金取引(チャージ)
|
2510
|
+
|
2511
|
+
2. payment
|
2512
|
+
エンドユーザーから店舗への送金取引(支払い)
|
2513
|
+
|
2514
|
+
3. exchange-outflow
|
2515
|
+
他マネーへの流出
|
2516
|
+
|
2517
|
+
4. exchange-inflow
|
2518
|
+
他マネーからの流入
|
2519
|
+
|
2520
|
+
5. cashback
|
2521
|
+
退会時返金取引
|
2522
|
+
items:
|
2523
|
+
type: string
|
2524
|
+
enum: [topup, payment, exchange_outflow, exchange_inflow, cashback]
|
2525
|
+
from:
|
2526
|
+
type: string
|
2527
|
+
format: date-time
|
2528
|
+
title: '開始日時'
|
2529
|
+
description: |-
|
2530
|
+
抽出期間の開始日時です。
|
2531
|
+
|
2532
|
+
フィルターとして使われ、開始日時以降に発生した取引のみ一覧に表示されます。
|
2533
|
+
to:
|
2534
|
+
type: string
|
2535
|
+
format: date-time
|
2536
|
+
title: '終了日時'
|
2537
|
+
description: |-
|
2538
|
+
抽出期間の終了日時です。
|
2539
|
+
|
2540
|
+
フィルターとして使われ、終了日時以前に発生した取引のみ一覧に表示されます。
|
2541
|
+
next_page_cursor_id:
|
2542
|
+
type: string
|
2543
|
+
format: uuid
|
2544
|
+
title: '次のページへ遷移する際に起点となるtransactionのuuid'
|
2545
|
+
description: |-
|
2546
|
+
次のページへ遷移する際に起点となるtransactionのuuid(前のページの末尾の要素のuuid)です。
|
2547
|
+
|
2548
|
+
prev_page_cursor_idのtransaction自体は次のページには含まれない。
|
2549
|
+
prev_page_cursor_id:
|
2550
|
+
type: string
|
2551
|
+
format: uuid
|
2552
|
+
title: '前のページへ遷移する際に起点となるtransactionのuuid'
|
2553
|
+
description: |-
|
2554
|
+
前のページへ遷移する際に起点となるtransactionのuuid(次のページの先頭の要素のuuid)です。
|
2555
|
+
|
2556
|
+
next_page_cursor_idのtransaction自体は前のページには含まれない。
|
2557
|
+
per_page:
|
2558
|
+
type: integer
|
2559
|
+
minimum: 1
|
2560
|
+
maximum: 100
|
2561
|
+
title: '1ページ分の取引数'
|
2562
|
+
description: |-
|
2563
|
+
1ページ分の取引数です。
|
2564
|
+
|
2565
|
+
デフォルト値は50です。
|
2566
|
+
example: 50
|
2567
|
+
responses:
|
2568
|
+
'200':
|
2569
|
+
description: OK
|
2570
|
+
content:
|
2571
|
+
application/json:
|
2572
|
+
schema:
|
2573
|
+
$ref: '#/components/schemas/PaginatedTransactionV2'
|
2574
|
+
'400':
|
2575
|
+
$ref: '#/components/responses/InvalidParameters'
|
2362
2576
|
/transactions/topup:
|
2363
2577
|
post:
|
2364
2578
|
tags:
|
@@ -4448,6 +4662,7 @@ paths:
|
|
4448
4662
|
title: 'ポイント負担先店舗ID'
|
4449
4663
|
description: |-
|
4450
4664
|
ポイントを負担する店舗のIDです。デフォルトではマネー発行体の本店が設定されます。
|
4665
|
+
ポイント負担先店舗は後から更新することはできません。
|
4451
4666
|
description:
|
4452
4667
|
type: string
|
4453
4668
|
maxLength: 200
|
@@ -4702,7 +4917,7 @@ paths:
|
|
4702
4917
|
// 対象商品を2つ以上購入したら500ポイント付与(固定額付与)
|
4703
4918
|
{
|
4704
4919
|
"point_amount": 500,
|
4705
|
-
"point_amount_unit": absolute",
|
4920
|
+
"point_amount_unit": "absolute",
|
4706
4921
|
"product_code": "4912345678904",
|
4707
4922
|
"required_count": 2
|
4708
4923
|
},
|
@@ -4766,6 +4981,96 @@ paths:
|
|
4766
4981
|
describe: |-
|
4767
4982
|
キャンペーンを適用する店舗IDを指定します (複数指定)。
|
4768
4983
|
指定しなかった場合は全店舗が対象になります。
|
4984
|
+
minimum_number_for_combination_purchase:
|
4985
|
+
type: integer
|
4986
|
+
minimum: 1
|
4987
|
+
title: '複数種類の商品を同時購入するときの商品種別数の下限'
|
4988
|
+
description: |-
|
4989
|
+
複数種別の商品を同時購入したとき、同時購入キャンペーンの対象となる商品種別数の下限です。デフォルトでは未指定で、指定する場合は1以上の整数を指定します。
|
4990
|
+
|
4991
|
+
このパラメータを指定するときは product_based_point_rules で商品毎のルールが指定されている必要があります。
|
4992
|
+
例えば、A商品とB商品とC商品のうち、キャンペーンの発火のために2商品以上が同時購入される必要があるときは 2 を指定します。
|
4993
|
+
|
4994
|
+
例1: 商品A, Bが同時購入されたときに固定ポイント額(200ポイント)付与
|
4995
|
+
```javascript
|
4996
|
+
{
|
4997
|
+
minimum_number_for_combination_purchase: 2,
|
4998
|
+
product_based_point_rules: [
|
4999
|
+
{
|
5000
|
+
"point_amount": 100,
|
5001
|
+
"point_amount_unit": "absolute",
|
5002
|
+
"product_code": "商品Aの商品コード"
|
5003
|
+
},
|
5004
|
+
{
|
5005
|
+
"point_amount": 100,
|
5006
|
+
"point_amount_unit": "absolute",
|
5007
|
+
"product_code": "商品Bの商品コード"
|
5008
|
+
}
|
5009
|
+
]
|
5010
|
+
}
|
5011
|
+
```
|
5012
|
+
|
5013
|
+
例2: 商品A, Bが3個ずつ以上同時購入されたときに固定ポイント額(200ポイント)付与
|
5014
|
+
```javascript
|
5015
|
+
{
|
5016
|
+
minimum_number_for_combination_purchase: 2,
|
5017
|
+
product_based_point_rules: [
|
5018
|
+
{
|
5019
|
+
"point_amount": 100,
|
5020
|
+
"point_amount_unit": "absolute",
|
5021
|
+
"product_code": "商品Aの商品コード",
|
5022
|
+
"required_count": 3
|
5023
|
+
},
|
5024
|
+
{
|
5025
|
+
"point_amount": 100,
|
5026
|
+
"point_amount_unit": "absolute",
|
5027
|
+
"product_code": "商品Bの商品コード",
|
5028
|
+
"required_count": 3
|
5029
|
+
}
|
5030
|
+
]
|
5031
|
+
}
|
5032
|
+
```
|
5033
|
+
|
5034
|
+
例2: 商品A, B, Cのうち2商品以上が同時購入されたときに総額の10%ポイントが付与
|
5035
|
+
```javascript
|
5036
|
+
{
|
5037
|
+
minimum_number_for_combination_purchase: 2,
|
5038
|
+
product_based_point_rules: [
|
5039
|
+
{
|
5040
|
+
"point_amount": 10,
|
5041
|
+
"point_amount_unit": "percent",
|
5042
|
+
"product_code": "商品Aの商品コード",
|
5043
|
+
"is_multiply_by_count": true,
|
5044
|
+
},
|
5045
|
+
{
|
5046
|
+
"point_amount": 10,
|
5047
|
+
"point_amount_unit": "percent",
|
5048
|
+
"product_code": "商品Bの商品コード",
|
5049
|
+
"is_multiply_by_count": true,
|
5050
|
+
},
|
5051
|
+
{
|
5052
|
+
"point_amount": 10,
|
5053
|
+
"point_amount_unit": "percent",
|
5054
|
+
"product_code": "商品Cの商品コード",
|
5055
|
+
"is_multiply_by_count": true,
|
5056
|
+
}
|
5057
|
+
]
|
5058
|
+
}
|
5059
|
+
```
|
5060
|
+
dest_private_money_id:
|
5061
|
+
type: string
|
5062
|
+
format: uuid
|
5063
|
+
title: 'ポイント付与先となるマネーID'
|
5064
|
+
description: |-
|
5065
|
+
キャンペーンを駆動するイベントのマネーとは「別のマネー」に対してポイントを付けたいときに、そのマネーIDを指定します。
|
5066
|
+
|
5067
|
+
ポイント付与先のマネーはキャンペーンを駆動するイベントのマネーと同一発行体が発行しているものに限ります。その他のマネーIDが指定された場合は private_money_not_found (422) が返ります。
|
5068
|
+
エンドユーザー、店舗、ポイント負担先店舗はポイント付与先マネーのウォレットを持っている必要があります。持っていない場合はポイントは付きません。
|
5069
|
+
元のイベントのマネーと異なる複数のマネーに対して同時にポイントを付与することはできません。重複可能に設定されている複数のキャンペーンで別々のポイント付与先マネーを指定した場合は最も優先度の高いものが処理され、残りは無視されます。
|
5070
|
+
キャンペーンのポイント付与先マネーは後から更新することはできません。
|
5071
|
+
デフォルトではポイント付与先はキャンペーンを駆動するイベントのマネー(private_money_idで指定したマネー)になります。
|
5072
|
+
|
5073
|
+
別マネーに対するポイント付与は別のtransactionとなります。 RefundTransaction で元のイベントをキャンセルしたときはポイント付与のtransactionもキャンセルされ、逆にポイント付与のtransactionをキャンセルしたときは連動して元のイベントがキャンセルされます。
|
4769
5074
|
responses:
|
4770
5075
|
'200':
|
4771
5076
|
description: OK
|
@@ -4779,3 +5084,577 @@ paths:
|
|
4779
5084
|
$ref: '#/components/responses/Forbidden'
|
4780
5085
|
'422':
|
4781
5086
|
$ref: '#/components/responses/UnprocessableEntity'
|
5087
|
+
get:
|
5088
|
+
tags:
|
5089
|
+
- Campaign
|
5090
|
+
summary: 'キャンペーン一覧を取得する'
|
5091
|
+
description: |-
|
5092
|
+
マネーIDを指定してキャンペーンを取得します。
|
5093
|
+
発行体の組織マネージャ権限で、自組織が発行するマネーのキャンペーンについてのみ閲覧可能です。
|
5094
|
+
閲覧権限がない場合は unpermitted_admin_user エラー(422)が返ります。
|
5095
|
+
x-pokepay-operator-name: "ListCampaigns"
|
5096
|
+
x-pokepay-allow-server-side: true
|
5097
|
+
requestBody:
|
5098
|
+
required: true
|
5099
|
+
content:
|
5100
|
+
application/json:
|
5101
|
+
schema:
|
5102
|
+
required: ["private_money_id"]
|
5103
|
+
properties:
|
5104
|
+
private_money_id:
|
5105
|
+
type: string
|
5106
|
+
format: uuid
|
5107
|
+
title: 'マネーID'
|
5108
|
+
description: |-
|
5109
|
+
マネーIDです。
|
5110
|
+
|
5111
|
+
フィルターとして使われ、指定したマネーでのキャンペーンのみ一覧に表示されます。
|
5112
|
+
page:
|
5113
|
+
type: integer
|
5114
|
+
minimum: 1
|
5115
|
+
title: 'ページ番号'
|
5116
|
+
description: 取得したいページ番号です。
|
5117
|
+
example: 1
|
5118
|
+
per_page:
|
5119
|
+
type: integer
|
5120
|
+
minimum: 1
|
5121
|
+
title: '1ページ分の取得数'
|
5122
|
+
description: 1ページ分の取得数です。デフォルトでは 20 になっています。
|
5123
|
+
example: 50
|
5124
|
+
responses:
|
5125
|
+
'200':
|
5126
|
+
description: OK
|
5127
|
+
content:
|
5128
|
+
application/json:
|
5129
|
+
schema:
|
5130
|
+
$ref: '#/components/schemas/PaginatedCampaigns'
|
5131
|
+
'400':
|
5132
|
+
$ref: '#/components/responses/InvalidParameters'
|
5133
|
+
'422':
|
5134
|
+
$ref: '#/components/responses/UnprocessableEntity'
|
5135
|
+
/campaigns/{campaign_id}:
|
5136
|
+
get:
|
5137
|
+
tags:
|
5138
|
+
- Campaign
|
5139
|
+
summary: 'キャンペーンを取得する'
|
5140
|
+
description: |-
|
5141
|
+
IDを指定してキャンペーンを取得します。
|
5142
|
+
発行体の組織マネージャ権限で、自組織が発行するマネーのキャンペーンについてのみ閲覧可能です。
|
5143
|
+
閲覧権限がない場合は unpermitted_admin_user エラー(422)が返ります。
|
5144
|
+
x-pokepay-operator-name: "GetCampaign"
|
5145
|
+
x-pokepay-allow-server-side: true
|
5146
|
+
parameters:
|
5147
|
+
- in: path
|
5148
|
+
name: campaign_id
|
5149
|
+
required: true
|
5150
|
+
schema:
|
5151
|
+
type: string
|
5152
|
+
format: uuid
|
5153
|
+
title: 'キャンペーンID'
|
5154
|
+
description: |-
|
5155
|
+
キャンペーンIDです。
|
5156
|
+
|
5157
|
+
指定したIDのキャンペーンを取得します。存在しないIDを指定した場合は404エラー(NotFound)が返ります。
|
5158
|
+
responses:
|
5159
|
+
'200':
|
5160
|
+
description: OK
|
5161
|
+
content:
|
5162
|
+
application/json:
|
5163
|
+
schema:
|
5164
|
+
$ref: '#/components/schemas/Campaign'
|
5165
|
+
'400':
|
5166
|
+
$ref: '#/components/responses/InvalidParameters'
|
5167
|
+
'422':
|
5168
|
+
$ref: '#/components/responses/Forbidden'
|
5169
|
+
'404':
|
5170
|
+
$ref: '#/components/responses/NotFound'
|
5171
|
+
patch:
|
5172
|
+
tags:
|
5173
|
+
- Campaign
|
5174
|
+
summary: 'ポイント付与キャンペーンを更新する'
|
5175
|
+
description: |
|
5176
|
+
ポイント付与キャンペーンを更新します。
|
5177
|
+
x-pokepay-operator-name: "UpdateCampaign"
|
5178
|
+
x-pokepay-allow-server-side: true
|
5179
|
+
parameters:
|
5180
|
+
- in: path
|
5181
|
+
name: campaign_id
|
5182
|
+
required: true
|
5183
|
+
schema:
|
5184
|
+
type: string
|
5185
|
+
format: uuid
|
5186
|
+
title: 'キャンペーンID'
|
5187
|
+
description: |-
|
5188
|
+
キャンペーンIDです。
|
5189
|
+
|
5190
|
+
指定したIDのキャンペーンを更新します。存在しないIDを指定した場合は404エラー(NotFound)が返ります。
|
5191
|
+
requestBody:
|
5192
|
+
required: true
|
5193
|
+
content:
|
5194
|
+
application/json:
|
5195
|
+
schema:
|
5196
|
+
properties:
|
5197
|
+
name:
|
5198
|
+
title: 'キャンペーン名'
|
5199
|
+
type: string
|
5200
|
+
maxLength: 256
|
5201
|
+
description: |-
|
5202
|
+
キャンペーン名です。
|
5203
|
+
|
5204
|
+
ポイント付与によってできるチャージ取引の説明文に転記されます。取引説明文はエンドユーザーからも確認できます。
|
5205
|
+
starts_at:
|
5206
|
+
type: string
|
5207
|
+
format: date-time
|
5208
|
+
title: 'キャンペーン開始日時'
|
5209
|
+
description: |-
|
5210
|
+
キャンペーン開始日時です。
|
5211
|
+
キャンペーン期間中のみポイントが付与されます。
|
5212
|
+
開始日時よりも終了日時が前のときはcampaign_invalid_periodエラー(422)になります。
|
5213
|
+
ends_at:
|
5214
|
+
type: string
|
5215
|
+
format: date-time
|
5216
|
+
title: 'キャンペーン終了日時'
|
5217
|
+
description: |-
|
5218
|
+
キャンペーン終了日時です。
|
5219
|
+
キャンペーン期間中のみポイントが付与されます。
|
5220
|
+
開始日時よりも終了日時が前のときはcampaign_invalid_periodエラー(422)になります。
|
5221
|
+
priority:
|
5222
|
+
type: integer
|
5223
|
+
title: 'キャンペーンの適用優先度'
|
5224
|
+
description: |-
|
5225
|
+
キャンペーンの適用優先度です。
|
5226
|
+
|
5227
|
+
優先度が大きいものから順に適用判定されていきます。
|
5228
|
+
キャンペーン期間が重なっている同一の優先度のキャンペーンが存在するとcampaign_period_overlapsエラー(422)になります。
|
5229
|
+
event:
|
5230
|
+
type: string
|
5231
|
+
enum: [topup, payment, external-transaction]
|
5232
|
+
title: 'イベント種別'
|
5233
|
+
description: |-
|
5234
|
+
キャンペーンのトリガーとなるイベントの種類を指定します。
|
5235
|
+
|
5236
|
+
以下のいずれかを指定できます。
|
5237
|
+
|
5238
|
+
1. topup
|
5239
|
+
店舗からエンドユーザーへの送金取引(チャージ)
|
5240
|
+
2. payment
|
5241
|
+
エンドユーザーから店舗への送金取引(支払い)
|
5242
|
+
3. external-transaction
|
5243
|
+
ポケペイ外の取引(現金決済など)
|
5244
|
+
description:
|
5245
|
+
type: string
|
5246
|
+
maxLength: 200
|
5247
|
+
title: 'キャンペーンの説明文'
|
5248
|
+
description: |-
|
5249
|
+
キャンペーンの内容を記載します。管理画面などでキャンペーンを管理するための説明文になります。
|
5250
|
+
status:
|
5251
|
+
type: string
|
5252
|
+
enum: [enabled, disabled]
|
5253
|
+
title: 'キャンペーン作成時の状態'
|
5254
|
+
description: |-
|
5255
|
+
キャンペーン作成時の状態を指定します。デフォルトではenabledです。
|
5256
|
+
|
5257
|
+
以下のいずれかを指定できます。
|
5258
|
+
|
5259
|
+
1. enabled
|
5260
|
+
有効
|
5261
|
+
2. disabled
|
5262
|
+
無効
|
5263
|
+
point_expires_at:
|
5264
|
+
type: string
|
5265
|
+
format: date-time
|
5266
|
+
nullable: true
|
5267
|
+
title: 'ポイント有効期限(絶対日時指定)'
|
5268
|
+
description: |-
|
5269
|
+
キャンペーンによって付与されるポイントの有効期限を絶対日時で指定します。
|
5270
|
+
省略した場合はマネーに設定された有効期限と同じものがポイントの有効期限となります。
|
5271
|
+
point_expires_in_days:
|
5272
|
+
type: integer
|
5273
|
+
minimum: 1
|
5274
|
+
nullable: true
|
5275
|
+
title: 'ポイント有効期限(相対日数指定)'
|
5276
|
+
description: |-
|
5277
|
+
キャンペーンによって付与されるポイントの有効期限を相対日数で指定します。
|
5278
|
+
省略した場合はマネーに設定された有効期限と同じものがポイントの有効期限となります。
|
5279
|
+
is_exclusive:
|
5280
|
+
type: boolean
|
5281
|
+
title: 'キャンペーンの重複設定'
|
5282
|
+
description: |-
|
5283
|
+
キャンペーンの重ね掛けを行うかどうかのフラグです。
|
5284
|
+
|
5285
|
+
これにtrueを指定すると他のキャンペーンと同時適用されません。デフォルト値はtrueです。
|
5286
|
+
falseを指定すると次の優先度の重ね掛け可能なキャンペーンの適用判定に進みます。
|
5287
|
+
subject:
|
5288
|
+
type: string
|
5289
|
+
enum: [money, all]
|
5290
|
+
title: 'ポイント付与の対象金額の種別'
|
5291
|
+
description: |-
|
5292
|
+
ポイント付与額を計算する対象となる金額の種類を指定します。デフォルト値はallです。
|
5293
|
+
eventとしてexternal-transactionを指定した場合はポイントとマネーの区別がないためsubjectの指定に関わらず常にallとなります。
|
5294
|
+
|
5295
|
+
以下のいずれかを指定できます。
|
5296
|
+
|
5297
|
+
1. money
|
5298
|
+
moneyを指定すると決済額の中で「マネー」を使って支払った額を対象にします
|
5299
|
+
|
5300
|
+
2. all
|
5301
|
+
all を指定すると決済額全体を対象にします (「ポイント」での取引額を含む)
|
5302
|
+
注意: event を topup にしたときはポイントの付与に対しても適用されます
|
5303
|
+
amount_based_point_rules:
|
5304
|
+
type: array
|
5305
|
+
items:
|
5306
|
+
type: object
|
5307
|
+
properties:
|
5308
|
+
point_amount:
|
5309
|
+
type: number
|
5310
|
+
format: decimal
|
5311
|
+
minimum: 0
|
5312
|
+
title: '付与ポイント量'
|
5313
|
+
description: |-
|
5314
|
+
キャンペーンにより付与するポイント量。(必須項目)
|
5315
|
+
|
5316
|
+
point_amount_unitにより指定される単位が絶対額のときは小数点以下が切り捨てられ整数として扱われます。
|
5317
|
+
パーセント指定の時は小数を許容し、割合計算後に小数点以下が切り捨てられます。
|
5318
|
+
いずれの場合も実際に付与されるポイントは整数のみです。
|
5319
|
+
point_amount_unit:
|
5320
|
+
type: string
|
5321
|
+
enum: [percent, absolute]
|
5322
|
+
title: '付与ポイント量の単位'
|
5323
|
+
description: |-
|
5324
|
+
キャンペーンにより付与するポイント量の単位を指定します。(必須項目)
|
5325
|
+
|
5326
|
+
以下のいずれかを指定できます。
|
5327
|
+
|
5328
|
+
1. percent
|
5329
|
+
付与するポイント量が元取引の取引額に応じて割合で変化するときに指定します。
|
5330
|
+
|
5331
|
+
2. absolute
|
5332
|
+
付与するポイント量が元取引の取引額に依存しない絶対額であるときに指定します。
|
5333
|
+
subject_more_than:
|
5334
|
+
type: integer
|
5335
|
+
minimum: 0
|
5336
|
+
title: '対象金額の下限値 (x <)'
|
5337
|
+
description: |-
|
5338
|
+
対象金額の下限値 (x <) を指定します (ただし、指定された金額は含まない)。
|
5339
|
+
subject_more_than_or_equal といずれかのみ指定できます。
|
5340
|
+
subject_more_than_or_equal:
|
5341
|
+
type: integer
|
5342
|
+
minimum: 0
|
5343
|
+
title: '対象金額の下限値 (x <=)'
|
5344
|
+
description: |-
|
5345
|
+
対象金額の下限値 (x <=) を指定します。
|
5346
|
+
subject_more_than といずれかのみ指定できます。
|
5347
|
+
subject_less_than:
|
5348
|
+
type: integer
|
5349
|
+
minimum: 0
|
5350
|
+
title: '対象金額の上限値 (< x)'
|
5351
|
+
description: |-
|
5352
|
+
対象金額の上限値 (< x) を指定します (ただし、指定された金額は含まない)。
|
5353
|
+
subject_less_than_or_equal といずれかのみ指定できます。
|
5354
|
+
subject_less_than_or_equal:
|
5355
|
+
type: integer
|
5356
|
+
minimum: 0
|
5357
|
+
title: '対象金額の上限値 (<= x)'
|
5358
|
+
description: |-
|
5359
|
+
対象金額の上限値 (<= x) を指定します。
|
5360
|
+
subject_less_than といずれかのみ指定できます。
|
5361
|
+
example: |-
|
5362
|
+
{
|
5363
|
+
"point_amount": 5,
|
5364
|
+
"point_amount_unit": "percent",
|
5365
|
+
"subject_more_than_or_equal": 1000,
|
5366
|
+
"subject_less_than": 5000
|
5367
|
+
}
|
5368
|
+
|
5369
|
+
title: '取引金額ベースのポイント付与ルール'
|
5370
|
+
nullable: true
|
5371
|
+
description: |-
|
5372
|
+
金額をベースとしてポイント付与を行うルールを指定します。
|
5373
|
+
amount_based_point_rules と product_based_point_rules はどちらか一方しか指定できません。
|
5374
|
+
各ルールは一つのみ適用され、条件に重複があった場合は先に記載されたものが優先されます。
|
5375
|
+
|
5376
|
+
例:
|
5377
|
+
```javascript
|
5378
|
+
[
|
5379
|
+
// 1000円以上、5000円未満の決済には 5%
|
5380
|
+
{
|
5381
|
+
"point_amount": 5,
|
5382
|
+
"point_amount_unit": "percent",
|
5383
|
+
"subject_more_than_or_equal": 1000,
|
5384
|
+
"subject_less_than": 5000
|
5385
|
+
},
|
5386
|
+
// 5000円以上の決済には 10%
|
5387
|
+
{
|
5388
|
+
"point_amount": 10,
|
5389
|
+
"point_amount_unit": "percent",
|
5390
|
+
"subject_more_than_or_equal": 5000
|
5391
|
+
},
|
5392
|
+
]
|
5393
|
+
```
|
5394
|
+
|
5395
|
+
product_based_point_rules:
|
5396
|
+
type: array
|
5397
|
+
items:
|
5398
|
+
type: object
|
5399
|
+
properties:
|
5400
|
+
point_amount:
|
5401
|
+
type: number
|
5402
|
+
format: decimal
|
5403
|
+
minimum: 0
|
5404
|
+
title: '付与ポイント量'
|
5405
|
+
description: |-
|
5406
|
+
キャンペーンにより付与するポイント量。単位は point_amount_unit で指定します。(必須項目)
|
5407
|
+
|
5408
|
+
point_amount_unitにより指定される単位が絶対額のときは小数点以下が切り捨てられ整数として扱われます。
|
5409
|
+
パーセント指定の時は小数を許容し、割合計算後に小数点以下が切り捨てられます。
|
5410
|
+
いずれの場合も実際に付与されるポイントは整数のみです。
|
5411
|
+
point_amount_unit:
|
5412
|
+
type: string
|
5413
|
+
enum: [percent, absolute]
|
5414
|
+
title: '付与ポイント量の単位'
|
5415
|
+
description: |-
|
5416
|
+
キャンペーンにより付与するポイント量の単位を指定します。(必須項目)
|
5417
|
+
|
5418
|
+
以下のいずれかを指定できます。
|
5419
|
+
|
5420
|
+
1. percent
|
5421
|
+
付与するポイント量が元取引の取引額に応じて割合で変化するときに指定します。
|
5422
|
+
|
5423
|
+
2. absolute
|
5424
|
+
付与するポイント量が元取引の取引額に依存しない絶対額であるときに指定します。
|
5425
|
+
product_code:
|
5426
|
+
type: string
|
5427
|
+
maxLength: 64
|
5428
|
+
title: '対象の製品コード'
|
5429
|
+
description: |-
|
5430
|
+
対象の製品コード (JANコードやISBNコードなど) を指定します。(必須項目)
|
5431
|
+
|
5432
|
+
SQLのLIKE文のようにワイルドカードを使った製品コードのパターンを指定することもできます (例: 978-% でISBNコード)
|
5433
|
+
items:
|
5434
|
+
type: string
|
5435
|
+
required_count:
|
5436
|
+
type: integer
|
5437
|
+
minimum: 1
|
5438
|
+
title: '必要購入個数'
|
5439
|
+
description: |-
|
5440
|
+
キャンペーン適用のための対象商品の必要購入個数を指定します (例:商品Aを2個以上購入するとn%ポイント)。
|
5441
|
+
デフォルト値は1です。
|
5442
|
+
is_multiply_by_count:
|
5443
|
+
type: boolean
|
5444
|
+
title: '複数個購入したときにポイント付与額に個数を掛けるかどうか'
|
5445
|
+
description: |-
|
5446
|
+
キャンペーン対象の商品を複数個購入したときに、個数に応じてポイント付与額を増やすかどうかのフラグです。
|
5447
|
+
デフォルト値は false です。
|
5448
|
+
starts_at:
|
5449
|
+
type: string
|
5450
|
+
format: date-time
|
5451
|
+
title: '商品個別のキャンペーン開始日時'
|
5452
|
+
description: |-
|
5453
|
+
このルールを適用する開始日時を指定します。
|
5454
|
+
デフォルトではキャンペーン全体の開始日時が指定されます。
|
5455
|
+
商品個別にキャンペーン期間指定をする場合は、キャンペーン全体の期間指定の範囲内に入っている必要があります。
|
5456
|
+
ends_at:
|
5457
|
+
type: string
|
5458
|
+
format: date-time
|
5459
|
+
title: '商品個別のキャンペーン終了日時'
|
5460
|
+
description: |-
|
5461
|
+
このルールを適用する終了日時を指定します。
|
5462
|
+
デフォルトではキャンペーン全体の終了日時が指定されます。
|
5463
|
+
商品個別にキャンペーン期間指定をする場合は、キャンペーン全体の期間指定の範囲内に入っている必要があります。
|
5464
|
+
example: |-
|
5465
|
+
{
|
5466
|
+
"point_amount": 5,
|
5467
|
+
"point_amount_unit": "percent",
|
5468
|
+
"product_code": "4912345678904",
|
5469
|
+
"is_multiply_by_count": true,
|
5470
|
+
"required_count": 2
|
5471
|
+
}
|
5472
|
+
|
5473
|
+
title: '商品情報ベースのポイント付与ルール'
|
5474
|
+
nullable: true
|
5475
|
+
description: |-
|
5476
|
+
商品情報をベースとしてポイント付与を行うルールを指定します。
|
5477
|
+
ルールは商品ごとに設定可能で、ルールの配列として指定します。
|
5478
|
+
amount_based_point_rules と product_based_point_rules はどちらか一方しか指定できません。
|
5479
|
+
event が payment か external-transaction の時のみ有効です。
|
5480
|
+
各ルールの順序は問わず、適用可能なものは全て適用されます。
|
5481
|
+
一つの決済の中で複数の商品がキャンペーン適用可能な場合はそれぞれの商品についてのルールが適用され、ポイント付与額はその合算になります。
|
5482
|
+
|
5483
|
+
例:
|
5484
|
+
```javascript
|
5485
|
+
[
|
5486
|
+
// 対象商品の購入額から5%ポイント付与。複数購入時は単価の5%が付与される。
|
5487
|
+
{
|
5488
|
+
"point_amount": 5,
|
5489
|
+
"point_amount_unit": "percent",
|
5490
|
+
"product_code": "4912345678904",
|
5491
|
+
},
|
5492
|
+
// 対象商品の購入額から5%ポイント付与。複数購入時は購入総額の5%が付与される。
|
5493
|
+
{
|
5494
|
+
"point_amount": 5,
|
5495
|
+
"point_amount_unit": "percent",
|
5496
|
+
"product_code": "4912345678904",
|
5497
|
+
"is_multiply_by_count": true,
|
5498
|
+
},
|
5499
|
+
// 対象商品を2つ以上購入したら500ポイント付与(固定額付与)
|
5500
|
+
{
|
5501
|
+
"point_amount": 500,
|
5502
|
+
"point_amount_unit": absolute",
|
5503
|
+
"product_code": "4912345678904",
|
5504
|
+
"required_count": 2
|
5505
|
+
},
|
5506
|
+
// 書籍は10%ポイント付与
|
5507
|
+
// ※ISBNの形式はレジがポケペイに送信する形式に準じます
|
5508
|
+
{
|
5509
|
+
"point_amount": 10,
|
5510
|
+
"point_amount_unit": "percent",
|
5511
|
+
"product_code": "978-%",
|
5512
|
+
},
|
5513
|
+
// 一部の出版社の書籍は10%ポイント付与
|
5514
|
+
{
|
5515
|
+
"point_amount": 10,
|
5516
|
+
"point_amount_unit": "percent",
|
5517
|
+
"product_code": "978-4-01-%", // 旺文社
|
5518
|
+
}
|
5519
|
+
]
|
5520
|
+
```
|
5521
|
+
|
5522
|
+
applicable_days_of_week:
|
5523
|
+
type: array
|
5524
|
+
items:
|
5525
|
+
type: integer
|
5526
|
+
minimun: 0
|
5527
|
+
maximum: 6
|
5528
|
+
nullable: true
|
5529
|
+
title: 'キャンペーンを適用する曜日 (複数指定)'
|
5530
|
+
describe: |-
|
5531
|
+
キャンペーンを適用する曜日を指定します (複数指定)。
|
5532
|
+
曜日は整数で表します。月曜を 0 とし、日曜を 6 とします。
|
5533
|
+
指定しなかった場合は全日を対象にします (曜日による適用条件なし)
|
5534
|
+
applicable_time_ranges:
|
5535
|
+
type: array
|
5536
|
+
items:
|
5537
|
+
type: object
|
5538
|
+
properties:
|
5539
|
+
from:
|
5540
|
+
type: string
|
5541
|
+
description: |-
|
5542
|
+
時間帯の開始時刻 (HH:mmの形式)
|
5543
|
+
to:
|
5544
|
+
type: string
|
5545
|
+
description: |-
|
5546
|
+
時間帯の終了時刻 (HH:mmの形式)
|
5547
|
+
example: |-
|
5548
|
+
{
|
5549
|
+
"from": "12:00",
|
5550
|
+
"to": "23:59"
|
5551
|
+
}
|
5552
|
+
|
5553
|
+
nullable: true
|
5554
|
+
title: 'キャンペーンを適用する時間帯 (複数指定)'
|
5555
|
+
describe: |-
|
5556
|
+
キャンペーンを適用する時間帯を指定します (複数指定可)。
|
5557
|
+
時間帯はfromとtoからなるオブジェクトで指定します。
|
5558
|
+
fromとtoは両方必要です。
|
5559
|
+
applicable_shop_ids:
|
5560
|
+
type: array
|
5561
|
+
items:
|
5562
|
+
type: string
|
5563
|
+
format: uuid
|
5564
|
+
nullable: true
|
5565
|
+
title: 'キャンペーン適用対象となる店舗IDのリスト'
|
5566
|
+
describe: |-
|
5567
|
+
キャンペーンを適用する店舗IDを指定します (複数指定)。
|
5568
|
+
指定しなかった場合は全店舗が対象になります。
|
5569
|
+
minimum_number_for_combination_purchase:
|
5570
|
+
type: integer
|
5571
|
+
minimum: 1
|
5572
|
+
nullable: true
|
5573
|
+
title: '複数種類の商品を同時購入するときの商品種別数の下限'
|
5574
|
+
description: |-
|
5575
|
+
複数種別の商品を同時購入したとき、同時購入キャンペーンの対象となる商品種別数の下限です。
|
5576
|
+
|
5577
|
+
このパラメータを指定するときは product_based_point_rules で商品毎のルールが指定されている必要があります。
|
5578
|
+
例えば、A商品とB商品とC商品のうち、キャンペーンの発火のために2商品以上が同時購入される必要があるときは 2 を指定します。
|
5579
|
+
|
5580
|
+
例1: 商品A, Bが同時購入されたときに固定ポイント額(200ポイント)付与
|
5581
|
+
```javascript
|
5582
|
+
{
|
5583
|
+
minimum_number_for_combination_purchase: 2,
|
5584
|
+
product_based_point_rules: [
|
5585
|
+
{
|
5586
|
+
"point_amount": 100,
|
5587
|
+
"point_amount_unit": "absolute",
|
5588
|
+
"product_code": "商品Aの商品コード"
|
5589
|
+
},
|
5590
|
+
{
|
5591
|
+
"point_amount": 100,
|
5592
|
+
"point_amount_unit": "absolute",
|
5593
|
+
"product_code": "商品Bの商品コード"
|
5594
|
+
}
|
5595
|
+
]
|
5596
|
+
}
|
5597
|
+
```
|
5598
|
+
|
5599
|
+
例2: 商品A, Bが3個ずつ以上同時購入されたときに固定ポイント額(200ポイント)付与
|
5600
|
+
```javascript
|
5601
|
+
{
|
5602
|
+
minimum_number_for_combination_purchase: 2,
|
5603
|
+
product_based_point_rules: [
|
5604
|
+
{
|
5605
|
+
"point_amount": 100,
|
5606
|
+
"point_amount_unit": "absolute",
|
5607
|
+
"product_code": "商品Aの商品コード",
|
5608
|
+
"required_count": 3
|
5609
|
+
},
|
5610
|
+
{
|
5611
|
+
"point_amount": 100,
|
5612
|
+
"point_amount_unit": "absolute",
|
5613
|
+
"product_code": "商品Bの商品コード",
|
5614
|
+
"required_count": 3
|
5615
|
+
}
|
5616
|
+
]
|
5617
|
+
}
|
5618
|
+
```
|
5619
|
+
|
5620
|
+
例2: 商品A, B, Cのうち2商品以上が同時購入されたときに総額の10%ポイントが付与
|
5621
|
+
```javascript
|
5622
|
+
{
|
5623
|
+
minimum_number_for_combination_purchase: 2,
|
5624
|
+
product_based_point_rules: [
|
5625
|
+
{
|
5626
|
+
"point_amount": 10,
|
5627
|
+
"point_amount_unit": "percent",
|
5628
|
+
"product_code": "商品Aの商品コード",
|
5629
|
+
"is_multiply_by_count": true,
|
5630
|
+
},
|
5631
|
+
{
|
5632
|
+
"point_amount": 10,
|
5633
|
+
"point_amount_unit": "percent",
|
5634
|
+
"product_code": "商品Bの商品コード",
|
5635
|
+
"is_multiply_by_count": true,
|
5636
|
+
},
|
5637
|
+
{
|
5638
|
+
"point_amount": 10,
|
5639
|
+
"point_amount_unit": "percent",
|
5640
|
+
"product_code": "商品Cの商品コード",
|
5641
|
+
"is_multiply_by_count": true,
|
5642
|
+
}
|
5643
|
+
]
|
5644
|
+
}
|
5645
|
+
```
|
5646
|
+
responses:
|
5647
|
+
'200':
|
5648
|
+
description: OK
|
5649
|
+
content:
|
5650
|
+
application/json:
|
5651
|
+
schema:
|
5652
|
+
$ref: '#/components/schemas/Campaign'
|
5653
|
+
'400':
|
5654
|
+
$ref: '#/components/responses/BadRequest'
|
5655
|
+
'403':
|
5656
|
+
$ref: '#/components/responses/Forbidden'
|
5657
|
+
'404':
|
5658
|
+
$ref: '#/components/responses/NotFound'
|
5659
|
+
'422':
|
5660
|
+
$ref: '#/components/responses/UnprocessableEntity'
|