pokepay_partner_ruby_sdk 0.1.18 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/docs/index.md +1011 -225
- 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/get_private_money_summary.rb +15 -0
- data/lib/pokepay_partner_ruby_sdk/request/get_transaction_by_request_id.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.rb +1 -2
- data/lib/pokepay_partner_ruby_sdk/response/account_detail.rb +3 -2
- data/lib/pokepay_partner_ruby_sdk/response/account_with_user.rb +1 -2
- data/lib/pokepay_partner_ruby_sdk/response/account_without_private_money_detail.rb +1 -2
- 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/response/private_money_summary.rb +27 -0
- data/lib/pokepay_partner_ruby_sdk/version.rb +1 -1
- data/lib/pokepay_partner_ruby_sdk.rb +9 -1
- data/partner.yaml +1031 -32
- metadata +11 -3
- data/lib/pokepay_partner_ruby_sdk/response/account_status.rb +0 -11
data/partner.yaml
CHANGED
@@ -96,11 +96,6 @@ components:
|
|
96
96
|
type: array
|
97
97
|
items:
|
98
98
|
$ref: '#/components/schemas/PrivateMoney'
|
99
|
-
AccountStatus:
|
100
|
-
x-pokepay-schema-type: "response"
|
101
|
-
type: string
|
102
|
-
enum: [active, suspended, pre-closed, closed]
|
103
|
-
title: 'ウォレット状態'
|
104
99
|
Account:
|
105
100
|
x-pokepay-schema-type: "response"
|
106
101
|
properties:
|
@@ -115,7 +110,8 @@ components:
|
|
115
110
|
type: boolean
|
116
111
|
title: 'ウォレットが凍結されているかどうか'
|
117
112
|
status:
|
118
|
-
|
113
|
+
type: string
|
114
|
+
enum: [active, suspended, pre-closed, closed]
|
119
115
|
private_money:
|
120
116
|
$ref: '#/components/schemas/PrivateMoney'
|
121
117
|
title: '設定マネー情報'
|
@@ -130,7 +126,8 @@ components:
|
|
130
126
|
is_suspended:
|
131
127
|
type: boolean
|
132
128
|
status:
|
133
|
-
|
129
|
+
type: string
|
130
|
+
enum: [active, suspended, pre-closed, closed]
|
134
131
|
private_money:
|
135
132
|
$ref: '#/components/schemas/PrivateMoney'
|
136
133
|
user:
|
@@ -146,7 +143,8 @@ components:
|
|
146
143
|
is_suspended:
|
147
144
|
type: boolean
|
148
145
|
status:
|
149
|
-
|
146
|
+
type: string
|
147
|
+
enum: [active, suspended, pre-closed, closed]
|
150
148
|
balance:
|
151
149
|
type: number
|
152
150
|
format: decimal
|
@@ -160,6 +158,10 @@ components:
|
|
160
158
|
$ref: '#/components/schemas/PrivateMoney'
|
161
159
|
user:
|
162
160
|
$ref: '#/components/schemas/User'
|
161
|
+
external_id:
|
162
|
+
type: string
|
163
|
+
nullable: true
|
164
|
+
maxLength: 50
|
163
165
|
ShopAccount:
|
164
166
|
x-pokepay-schema-type: "response"
|
165
167
|
properties:
|
@@ -743,7 +745,8 @@ components:
|
|
743
745
|
is_suspended:
|
744
746
|
type: boolean
|
745
747
|
status:
|
746
|
-
|
748
|
+
type: string
|
749
|
+
enum: [active, suspended, pre-closed, closed]
|
747
750
|
private_money_id:
|
748
751
|
type: string
|
749
752
|
format: uuid
|
@@ -776,7 +779,7 @@ components:
|
|
776
779
|
format: date-time
|
777
780
|
type:
|
778
781
|
type: string
|
779
|
-
enum: [topup, payment, refund-topup, refund-payment, transfer, exchange-inflow, exchange-outflow, campaign-topup, refund-campaign, use-coupon, refund-coupon, cashback, expire]
|
782
|
+
enum: [topup, payment, refund-topup, refund-payment, transfer, exchange-inflow, exchange-outflow, refund-exchange-inflow, refund-exchange-outflow, campaign-topup, refund-campaign, use-coupon, refund-coupon, cashback, expire]
|
780
783
|
description:
|
781
784
|
type: string
|
782
785
|
transaction_id:
|
@@ -875,6 +878,35 @@ components:
|
|
875
878
|
minimum: 0
|
876
879
|
pagination:
|
877
880
|
$ref: '#/components/schemas/Pagination'
|
881
|
+
PrivateMoneySummary:
|
882
|
+
x-pokepay-schema-type: "response"
|
883
|
+
properties:
|
884
|
+
topup_amount:
|
885
|
+
type: number
|
886
|
+
format: decimal
|
887
|
+
refunded_topup_amount:
|
888
|
+
type: number
|
889
|
+
format: decimal
|
890
|
+
payment_amount:
|
891
|
+
type: number
|
892
|
+
format: decimal
|
893
|
+
refunded_payment_amount:
|
894
|
+
type: number
|
895
|
+
format: decimal
|
896
|
+
added_point_amount:
|
897
|
+
type: number
|
898
|
+
format: decimal
|
899
|
+
refunded_added_point_amount:
|
900
|
+
type: number
|
901
|
+
format: decimal
|
902
|
+
exchange_inflow_amount:
|
903
|
+
type: number
|
904
|
+
format: decimal
|
905
|
+
exchange_outflow_amount:
|
906
|
+
type: number
|
907
|
+
format: decimal
|
908
|
+
transaction_count:
|
909
|
+
type: integer
|
878
910
|
PaginatedTransaction:
|
879
911
|
x-pokepay-schema-type: "response"
|
880
912
|
properties:
|
@@ -887,6 +919,33 @@ components:
|
|
887
919
|
minimum: 0
|
888
920
|
pagination:
|
889
921
|
$ref: '#/components/schemas/Pagination'
|
922
|
+
PaginatedTransactionV2:
|
923
|
+
x-pokepay-schema-type: "response"
|
924
|
+
properties:
|
925
|
+
rows:
|
926
|
+
type: array
|
927
|
+
items:
|
928
|
+
$ref: '#/components/schemas/Transaction'
|
929
|
+
per_page:
|
930
|
+
type: integer
|
931
|
+
count:
|
932
|
+
type: integer
|
933
|
+
next_page_cursor_id:
|
934
|
+
type: string
|
935
|
+
format: uuid
|
936
|
+
nullable: true
|
937
|
+
description: |-
|
938
|
+
次ページ取得するためのID。
|
939
|
+
|
940
|
+
実際にはrows末尾
|
941
|
+
prev_page_cursor_id:
|
942
|
+
type: string
|
943
|
+
format: uuid
|
944
|
+
nullable: true
|
945
|
+
description: |-
|
946
|
+
前ページ取得するためのID。
|
947
|
+
|
948
|
+
実際にはrows先頭
|
890
949
|
PaginatedTransfers:
|
891
950
|
x-pokepay-schema-type: "response"
|
892
951
|
properties:
|
@@ -1034,6 +1093,9 @@ components:
|
|
1034
1093
|
private_money:
|
1035
1094
|
title: 'キャンペーンを適用するマネー'
|
1036
1095
|
$ref: '#/components/schemas/PrivateMoney'
|
1096
|
+
dest_private_money:
|
1097
|
+
title: 'ポイントを付与するマネー'
|
1098
|
+
$ref: '#/components/schemas/PrivateMoney'
|
1037
1099
|
point_calculation_rule:
|
1038
1100
|
type: string
|
1039
1101
|
title: 'ポイント計算ルール (banklisp表記)'
|
@@ -1045,6 +1107,18 @@ components:
|
|
1045
1107
|
type: string
|
1046
1108
|
enum: [enabled, disabled]
|
1047
1109
|
title: 'キャンペーンの現在の状態'
|
1110
|
+
PaginatedCampaigns:
|
1111
|
+
x-pokepay-schema-type: "response"
|
1112
|
+
properties:
|
1113
|
+
rows:
|
1114
|
+
type: array
|
1115
|
+
items:
|
1116
|
+
$ref: '#/components/schemas/Campaign'
|
1117
|
+
count:
|
1118
|
+
type: integer
|
1119
|
+
minimum: 0
|
1120
|
+
pagination:
|
1121
|
+
$ref: '#/components/schemas/Pagination'
|
1048
1122
|
BadRequest:
|
1049
1123
|
x-pokepay-schema-type: "response"
|
1050
1124
|
oneOf:
|
@@ -1409,7 +1483,7 @@ paths:
|
|
1409
1483
|
content:
|
1410
1484
|
application/json:
|
1411
1485
|
schema:
|
1412
|
-
$ref: '#/components/schemas/
|
1486
|
+
$ref: '#/components/schemas/AccountDetail'
|
1413
1487
|
'400':
|
1414
1488
|
$ref: '#/components/responses/BadRequest'
|
1415
1489
|
'403':
|
@@ -2048,7 +2122,6 @@ paths:
|
|
2048
2122
|
- Check
|
2049
2123
|
summary: 'チャージQRコードの発行'
|
2050
2124
|
x-pokepay-operator-name: "CreateCheck"
|
2051
|
-
x-pokepay-allow-server-side: true
|
2052
2125
|
requestBody:
|
2053
2126
|
required: true
|
2054
2127
|
content:
|
@@ -2151,7 +2224,7 @@ paths:
|
|
2151
2224
|
get:
|
2152
2225
|
tags:
|
2153
2226
|
- Transaction
|
2154
|
-
summary: '
|
2227
|
+
summary: '【廃止】取引履歴を取得する'
|
2155
2228
|
description: 取引一覧を返します。
|
2156
2229
|
x-pokepay-operator-name: "ListTransactions"
|
2157
2230
|
x-pokepay-allow-server-side: true
|
@@ -2224,12 +2297,11 @@ paths:
|
|
2224
2297
|
フィルターとして使われ、指定された端末での取引のみ一覧に表示されます。
|
2225
2298
|
transaction_id:
|
2226
2299
|
type: string
|
2227
|
-
format: uuid
|
2228
2300
|
title: '取引ID'
|
2229
2301
|
description: |-
|
2230
2302
|
取引IDです。
|
2231
2303
|
|
2232
|
-
|
2304
|
+
フィルターとして使われ、指定された取引IDに部分一致(前方一致)する取引のみが一覧に表示されます。
|
2233
2305
|
organization_code:
|
2234
2306
|
type: string
|
2235
2307
|
pattern: '^[a-zA-Z0-9-]*$'
|
@@ -2306,7 +2378,7 @@ paths:
|
|
2306
2378
|
post:
|
2307
2379
|
tags:
|
2308
2380
|
- Transaction
|
2309
|
-
summary: '
|
2381
|
+
summary: '【廃止】チャージする'
|
2310
2382
|
description: |-
|
2311
2383
|
チャージ取引を作成します。このAPIは廃止予定です。以降は `CreateTopupTransaction` を使用してください。
|
2312
2384
|
x-pokepay-operator-name: "CreateTransaction"
|
@@ -2359,6 +2431,184 @@ paths:
|
|
2359
2431
|
$ref: '#/components/responses/Forbidden'
|
2360
2432
|
'422':
|
2361
2433
|
$ref: '#/components/responses/UnprocessableEntity'
|
2434
|
+
/transactions-v2:
|
2435
|
+
get:
|
2436
|
+
tags:
|
2437
|
+
- Transaction
|
2438
|
+
summary: '取引履歴を取得する'
|
2439
|
+
description: 取引一覧を返します。
|
2440
|
+
x-pokepay-operator-name: "ListTransactionsV2"
|
2441
|
+
x-pokepay-allow-server-side: true
|
2442
|
+
requestBody:
|
2443
|
+
required: true
|
2444
|
+
content:
|
2445
|
+
application/json:
|
2446
|
+
schema:
|
2447
|
+
properties:
|
2448
|
+
private_money_id:
|
2449
|
+
type: string
|
2450
|
+
format: uuid
|
2451
|
+
title: 'マネーID'
|
2452
|
+
description: |-
|
2453
|
+
マネーIDです。
|
2454
|
+
|
2455
|
+
指定したマネーでの取引が一覧に表示されます。
|
2456
|
+
organization_code:
|
2457
|
+
type: string
|
2458
|
+
pattern: '^[a-zA-Z0-9-]*$'
|
2459
|
+
maxLength: 32
|
2460
|
+
title: '組織コード'
|
2461
|
+
description: |-
|
2462
|
+
組織コードです。
|
2463
|
+
|
2464
|
+
フィルターとして使われ、指定された組織の店舗での取引のみ一覧に表示されます。
|
2465
|
+
example: 'pocketchange'
|
2466
|
+
shop_id:
|
2467
|
+
type: string
|
2468
|
+
format: uuid
|
2469
|
+
title: '店舗ID'
|
2470
|
+
description: |-
|
2471
|
+
店舗IDです。
|
2472
|
+
|
2473
|
+
フィルターとして使われ、指定された店舗での取引のみ一覧に表示されます。
|
2474
|
+
terminal_id:
|
2475
|
+
type: string
|
2476
|
+
format: uuid
|
2477
|
+
title: '端末ID'
|
2478
|
+
description: |-
|
2479
|
+
端末IDです。
|
2480
|
+
|
2481
|
+
フィルターとして使われ、指定された端末での取引のみ一覧に表示されます。
|
2482
|
+
customer_id:
|
2483
|
+
type: string
|
2484
|
+
format: uuid
|
2485
|
+
title: 'エンドユーザーID'
|
2486
|
+
description: |-
|
2487
|
+
エンドユーザーIDです。
|
2488
|
+
|
2489
|
+
フィルターとして使われ、指定されたエンドユーザーの取引のみ一覧に表示されます。
|
2490
|
+
customer_name:
|
2491
|
+
type: string
|
2492
|
+
maxLength: 256
|
2493
|
+
title: 'エンドユーザー名'
|
2494
|
+
description: |-
|
2495
|
+
エンドユーザー名です。
|
2496
|
+
|
2497
|
+
フィルターとして使われ、入力された名前に部分一致するエンドユーザーでの取引のみ一覧に表示されます。
|
2498
|
+
example: 太郎
|
2499
|
+
description:
|
2500
|
+
type: string
|
2501
|
+
maxLength: 200
|
2502
|
+
title: '取引説明文'
|
2503
|
+
description: |-
|
2504
|
+
取引を指定の取引説明文でフィルターします。
|
2505
|
+
|
2506
|
+
取引説明文が完全一致する取引のみ抽出されます。取引説明文は最大200文字で記録されています。
|
2507
|
+
example: 店頭QRコードによる支払い
|
2508
|
+
transaction_id:
|
2509
|
+
type: string
|
2510
|
+
title: '取引ID'
|
2511
|
+
description: |-
|
2512
|
+
取引IDです。
|
2513
|
+
|
2514
|
+
フィルターとして使われ、指定された取引IDに部分一致(前方一致)する取引のみが一覧に表示されます。
|
2515
|
+
is_modified:
|
2516
|
+
type: boolean
|
2517
|
+
title: 'キャンセルフラグ'
|
2518
|
+
description: |-
|
2519
|
+
キャンセルフラグです。
|
2520
|
+
|
2521
|
+
これにtrueを指定するとキャンセルされた取引のみ一覧に表示されます。
|
2522
|
+
デフォルト値はfalseで、キャンセルの有無にかかわらず一覧に表示されます。
|
2523
|
+
types:
|
2524
|
+
type: array
|
2525
|
+
title: '取引種別 (複数指定可)、チャージ=topup、支払い=payment'
|
2526
|
+
example: '["topup", "payment"]'
|
2527
|
+
description: |-
|
2528
|
+
取引の種類でフィルターします。
|
2529
|
+
|
2530
|
+
以下の種類を指定できます。
|
2531
|
+
|
2532
|
+
1. topup
|
2533
|
+
店舗からエンドユーザーへの送金取引(チャージ)
|
2534
|
+
|
2535
|
+
2. payment
|
2536
|
+
エンドユーザーから店舗への送金取引(支払い)
|
2537
|
+
|
2538
|
+
3. exchange-outflow
|
2539
|
+
他マネーへの流出
|
2540
|
+
private_money_idが指定されたとき、そのマネーから見て流出方向の交換取引が抽出されます。
|
2541
|
+
private_money_idを省略した場合は表示されません。
|
2542
|
+
|
2543
|
+
4. exchange-inflow
|
2544
|
+
他マネーからの流入
|
2545
|
+
private_money_idが指定されたとき、そのマネーから見て流入方向の交換取引が抽出されます。
|
2546
|
+
private_money_idを省略した場合は表示されません。
|
2547
|
+
|
2548
|
+
5. cashback
|
2549
|
+
退会時返金取引
|
2550
|
+
|
2551
|
+
6. expire
|
2552
|
+
退会時失効取引
|
2553
|
+
items:
|
2554
|
+
type: string
|
2555
|
+
enum: [topup, payment, exchange_outflow, exchange_inflow, cashback, expire]
|
2556
|
+
from:
|
2557
|
+
type: string
|
2558
|
+
format: date-time
|
2559
|
+
title: '開始日時'
|
2560
|
+
description: |-
|
2561
|
+
抽出期間の開始日時です。
|
2562
|
+
|
2563
|
+
フィルターとして使われ、開始日時以降に発生した取引のみ一覧に表示されます。
|
2564
|
+
to:
|
2565
|
+
type: string
|
2566
|
+
format: date-time
|
2567
|
+
title: '終了日時'
|
2568
|
+
description: |-
|
2569
|
+
抽出期間の終了日時です。
|
2570
|
+
|
2571
|
+
フィルターとして使われ、終了日時以前に発生した取引のみ一覧に表示されます。
|
2572
|
+
next_page_cursor_id:
|
2573
|
+
type: string
|
2574
|
+
format: uuid
|
2575
|
+
title: '次ページへ遷移する際に起点となるtransactionのID'
|
2576
|
+
description: |-
|
2577
|
+
次ページへ遷移する際に起点となるtransactionのID(前ページの末尾要素のID)です。
|
2578
|
+
本APIのレスポンスにもnext_page_cursor_idが含まれており、これがnull値の場合は最後のページであることを意味します。
|
2579
|
+
UUIDである場合は次のページが存在することを意味し、このnext_page_cursor_idをリクエストパラメータに含めることで次ページに遷移します。
|
2580
|
+
|
2581
|
+
next_page_cursor_idのtransaction自体は次のページには含まれません。
|
2582
|
+
prev_page_cursor_id:
|
2583
|
+
type: string
|
2584
|
+
format: uuid
|
2585
|
+
title: '前ページへ遷移する際に起点となるtransactionのID'
|
2586
|
+
description: |-
|
2587
|
+
前ページへ遷移する際に起点となるtransactionのID(次ページの先頭要素のID)です。
|
2588
|
+
|
2589
|
+
本APIのレスポンスにもprev_page_cursor_idが含まれており、これがnull値の場合は先頭のページであることを意味します。
|
2590
|
+
UUIDである場合は前のページが存在することを意味し、このprev_page_cursor_idをリクエストパラメータに含めることで前ページに遷移します。
|
2591
|
+
|
2592
|
+
prev_page_cursor_idのtransaction自体は前のページには含まれません。
|
2593
|
+
per_page:
|
2594
|
+
type: integer
|
2595
|
+
minimum: 1
|
2596
|
+
maximum: 1000
|
2597
|
+
title: '1ページ分の取引数'
|
2598
|
+
description: |-
|
2599
|
+
1ページ分の取引数です。
|
2600
|
+
|
2601
|
+
デフォルト値は50です。
|
2602
|
+
example: 50
|
2603
|
+
responses:
|
2604
|
+
'200':
|
2605
|
+
description: OK
|
2606
|
+
content:
|
2607
|
+
application/json:
|
2608
|
+
schema:
|
2609
|
+
$ref: '#/components/schemas/PaginatedTransactionV2'
|
2610
|
+
'400':
|
2611
|
+
$ref: '#/components/responses/InvalidParameters'
|
2362
2612
|
/transactions/topup:
|
2363
2613
|
post:
|
2364
2614
|
tags:
|
@@ -3128,6 +3378,39 @@ paths:
|
|
3128
3378
|
$ref: '#/components/responses/Forbidden'
|
3129
3379
|
'422':
|
3130
3380
|
$ref: '#/components/responses/UnprocessableEntity'
|
3381
|
+
/transactions/requests/{request_id}:
|
3382
|
+
get:
|
3383
|
+
tags:
|
3384
|
+
- Transaction
|
3385
|
+
summary: 'リクエストIDから取引情報を取得する'
|
3386
|
+
description: 取引を取得します。
|
3387
|
+
x-pokepay-operator-name: "GetTransactionByRequestId"
|
3388
|
+
x-pokepay-allow-server-side: true
|
3389
|
+
parameters:
|
3390
|
+
- in: path
|
3391
|
+
name: request_id
|
3392
|
+
required: true
|
3393
|
+
schema:
|
3394
|
+
type: string
|
3395
|
+
format: uuid
|
3396
|
+
title: 'リクエストID'
|
3397
|
+
description: |-
|
3398
|
+
取引作成時にクライアントが生成し指定するリクエストIDです。
|
3399
|
+
|
3400
|
+
リクエストIDに対応する取引が存在すればその取引を返し、無ければNotFound(404)を返します。
|
3401
|
+
responses:
|
3402
|
+
'200':
|
3403
|
+
description: OK
|
3404
|
+
content:
|
3405
|
+
application/json:
|
3406
|
+
schema:
|
3407
|
+
$ref: '#/components/schemas/TransactionDetail'
|
3408
|
+
'400':
|
3409
|
+
$ref: '#/components/responses/InvalidParameters'
|
3410
|
+
'403':
|
3411
|
+
$ref: '#/components/responses/Forbidden'
|
3412
|
+
'422':
|
3413
|
+
$ref: '#/components/responses/UnprocessableEntity'
|
3131
3414
|
/external-transactions:
|
3132
3415
|
post:
|
3133
3416
|
tags:
|
@@ -3589,7 +3872,7 @@ paths:
|
|
3589
3872
|
post:
|
3590
3873
|
tags:
|
3591
3874
|
- Shop
|
3592
|
-
summary: '
|
3875
|
+
summary: '【廃止】新規店舗を追加する'
|
3593
3876
|
description: |-
|
3594
3877
|
新規店舗を追加します。このAPIは廃止予定です。以降は `CreateShopV2` を使用してください。
|
3595
3878
|
x-pokepay-operator-name: "CreateShop"
|
@@ -3986,29 +4269,73 @@ paths:
|
|
3986
4269
|
$ref: '#/components/responses/Forbidden'
|
3987
4270
|
'404':
|
3988
4271
|
$ref: '#/components/responses/NotFound'
|
3989
|
-
/
|
4272
|
+
/private-moneys/{private_money_id}/summary:
|
3990
4273
|
get:
|
3991
4274
|
tags:
|
3992
|
-
-
|
3993
|
-
summary:
|
3994
|
-
|
3995
|
-
x-pokepay-operator-name: "ListCustomerTransactions"
|
4275
|
+
- Private Money
|
4276
|
+
summary: 取引サマリを取得する
|
4277
|
+
x-pokepay-operator-name: "GetPrivateMoneySummary"
|
3996
4278
|
x-pokepay-allow-server-side: true
|
3997
4279
|
requestBody:
|
3998
4280
|
required: true
|
3999
4281
|
content:
|
4000
4282
|
application/json:
|
4001
4283
|
schema:
|
4002
|
-
required: ["private_money_id"]
|
4003
4284
|
properties:
|
4004
|
-
|
4005
|
-
type: string
|
4006
|
-
format:
|
4007
|
-
title: '
|
4008
|
-
|
4009
|
-
|
4010
|
-
|
4011
|
-
|
4285
|
+
from:
|
4286
|
+
type: string
|
4287
|
+
format: date-time
|
4288
|
+
title: '開始日時'
|
4289
|
+
to:
|
4290
|
+
type: string
|
4291
|
+
format: date-time
|
4292
|
+
title: '終了日時'
|
4293
|
+
parameters:
|
4294
|
+
- in: path
|
4295
|
+
name: private_money_id
|
4296
|
+
required: true
|
4297
|
+
schema:
|
4298
|
+
type: string
|
4299
|
+
format: uuid
|
4300
|
+
title: マネーID
|
4301
|
+
responses:
|
4302
|
+
'200':
|
4303
|
+
description: OK
|
4304
|
+
content:
|
4305
|
+
application/json:
|
4306
|
+
schema:
|
4307
|
+
$ref: '#/components/schemas/PrivateMoneySummary'
|
4308
|
+
'400':
|
4309
|
+
$ref: '#/components/responses/InvalidParameters'
|
4310
|
+
'403':
|
4311
|
+
$ref: '#/components/responses/Forbidden'
|
4312
|
+
'404':
|
4313
|
+
$ref: '#/components/responses/NotFound'
|
4314
|
+
'422':
|
4315
|
+
$ref: '#/components/responses/UnprocessableEntity'
|
4316
|
+
/customers/transactions:
|
4317
|
+
get:
|
4318
|
+
tags:
|
4319
|
+
- Customer
|
4320
|
+
summary: '取引履歴を取得する'
|
4321
|
+
description: '取引一覧を返します。'
|
4322
|
+
x-pokepay-operator-name: "ListCustomerTransactions"
|
4323
|
+
x-pokepay-allow-server-side: true
|
4324
|
+
requestBody:
|
4325
|
+
required: true
|
4326
|
+
content:
|
4327
|
+
application/json:
|
4328
|
+
schema:
|
4329
|
+
required: ["private_money_id"]
|
4330
|
+
properties:
|
4331
|
+
private_money_id:
|
4332
|
+
type: string
|
4333
|
+
format: uuid
|
4334
|
+
title: 'マネーID'
|
4335
|
+
description: |-
|
4336
|
+
マネーIDです。
|
4337
|
+
フィルターとして使われ、指定したマネーでの取引のみ一覧に表示されます。
|
4338
|
+
sender_customer_id:
|
4012
4339
|
type: string
|
4013
4340
|
format: uuid
|
4014
4341
|
title: '送金エンドユーザーID'
|
@@ -4448,6 +4775,7 @@ paths:
|
|
4448
4775
|
title: 'ポイント負担先店舗ID'
|
4449
4776
|
description: |-
|
4450
4777
|
ポイントを負担する店舗のIDです。デフォルトではマネー発行体の本店が設定されます。
|
4778
|
+
ポイント負担先店舗は後から更新することはできません。
|
4451
4779
|
description:
|
4452
4780
|
type: string
|
4453
4781
|
maxLength: 200
|
@@ -4702,7 +5030,7 @@ paths:
|
|
4702
5030
|
// 対象商品を2つ以上購入したら500ポイント付与(固定額付与)
|
4703
5031
|
{
|
4704
5032
|
"point_amount": 500,
|
4705
|
-
"point_amount_unit": absolute",
|
5033
|
+
"point_amount_unit": "absolute",
|
4706
5034
|
"product_code": "4912345678904",
|
4707
5035
|
"required_count": 2
|
4708
5036
|
},
|
@@ -4766,6 +5094,96 @@ paths:
|
|
4766
5094
|
describe: |-
|
4767
5095
|
キャンペーンを適用する店舗IDを指定します (複数指定)。
|
4768
5096
|
指定しなかった場合は全店舗が対象になります。
|
5097
|
+
minimum_number_for_combination_purchase:
|
5098
|
+
type: integer
|
5099
|
+
minimum: 1
|
5100
|
+
title: '複数種類の商品を同時購入するときの商品種別数の下限'
|
5101
|
+
description: |-
|
5102
|
+
複数種別の商品を同時購入したとき、同時購入キャンペーンの対象となる商品種別数の下限です。デフォルトでは未指定で、指定する場合は1以上の整数を指定します。
|
5103
|
+
|
5104
|
+
このパラメータを指定するときは product_based_point_rules で商品毎のルールが指定されている必要があります。
|
5105
|
+
例えば、A商品とB商品とC商品のうち、キャンペーンの発火のために2商品以上が同時購入される必要があるときは 2 を指定します。
|
5106
|
+
|
5107
|
+
例1: 商品A, Bが同時購入されたときに固定ポイント額(200ポイント)付与
|
5108
|
+
```javascript
|
5109
|
+
{
|
5110
|
+
minimum_number_for_combination_purchase: 2,
|
5111
|
+
product_based_point_rules: [
|
5112
|
+
{
|
5113
|
+
"point_amount": 100,
|
5114
|
+
"point_amount_unit": "absolute",
|
5115
|
+
"product_code": "商品Aの商品コード"
|
5116
|
+
},
|
5117
|
+
{
|
5118
|
+
"point_amount": 100,
|
5119
|
+
"point_amount_unit": "absolute",
|
5120
|
+
"product_code": "商品Bの商品コード"
|
5121
|
+
}
|
5122
|
+
]
|
5123
|
+
}
|
5124
|
+
```
|
5125
|
+
|
5126
|
+
例2: 商品A, Bが3個ずつ以上同時購入されたときに固定ポイント額(200ポイント)付与
|
5127
|
+
```javascript
|
5128
|
+
{
|
5129
|
+
minimum_number_for_combination_purchase: 2,
|
5130
|
+
product_based_point_rules: [
|
5131
|
+
{
|
5132
|
+
"point_amount": 100,
|
5133
|
+
"point_amount_unit": "absolute",
|
5134
|
+
"product_code": "商品Aの商品コード",
|
5135
|
+
"required_count": 3
|
5136
|
+
},
|
5137
|
+
{
|
5138
|
+
"point_amount": 100,
|
5139
|
+
"point_amount_unit": "absolute",
|
5140
|
+
"product_code": "商品Bの商品コード",
|
5141
|
+
"required_count": 3
|
5142
|
+
}
|
5143
|
+
]
|
5144
|
+
}
|
5145
|
+
```
|
5146
|
+
|
5147
|
+
例2: 商品A, B, Cのうち2商品以上が同時購入されたときに総額の10%ポイントが付与
|
5148
|
+
```javascript
|
5149
|
+
{
|
5150
|
+
minimum_number_for_combination_purchase: 2,
|
5151
|
+
product_based_point_rules: [
|
5152
|
+
{
|
5153
|
+
"point_amount": 10,
|
5154
|
+
"point_amount_unit": "percent",
|
5155
|
+
"product_code": "商品Aの商品コード",
|
5156
|
+
"is_multiply_by_count": true,
|
5157
|
+
},
|
5158
|
+
{
|
5159
|
+
"point_amount": 10,
|
5160
|
+
"point_amount_unit": "percent",
|
5161
|
+
"product_code": "商品Bの商品コード",
|
5162
|
+
"is_multiply_by_count": true,
|
5163
|
+
},
|
5164
|
+
{
|
5165
|
+
"point_amount": 10,
|
5166
|
+
"point_amount_unit": "percent",
|
5167
|
+
"product_code": "商品Cの商品コード",
|
5168
|
+
"is_multiply_by_count": true,
|
5169
|
+
}
|
5170
|
+
]
|
5171
|
+
}
|
5172
|
+
```
|
5173
|
+
dest_private_money_id:
|
5174
|
+
type: string
|
5175
|
+
format: uuid
|
5176
|
+
title: 'ポイント付与先となるマネーID'
|
5177
|
+
description: |-
|
5178
|
+
キャンペーンを駆動するイベントのマネーとは「別のマネー」に対してポイントを付けたいときに、そのマネーIDを指定します。
|
5179
|
+
|
5180
|
+
ポイント付与先のマネーはキャンペーンを駆動するイベントのマネーと同一発行体が発行しているものに限ります。その他のマネーIDが指定された場合は private_money_not_found (422) が返ります。
|
5181
|
+
エンドユーザー、店舗、ポイント負担先店舗はポイント付与先マネーのウォレットを持っている必要があります。持っていない場合はポイントは付きません。
|
5182
|
+
元のイベントのマネーと異なる複数のマネーに対して同時にポイントを付与することはできません。重複可能に設定されている複数のキャンペーンで別々のポイント付与先マネーを指定した場合は最も優先度の高いものが処理され、残りは無視されます。
|
5183
|
+
キャンペーンのポイント付与先マネーは後から更新することはできません。
|
5184
|
+
デフォルトではポイント付与先はキャンペーンを駆動するイベントのマネー(private_money_idで指定したマネー)になります。
|
5185
|
+
|
5186
|
+
別マネーに対するポイント付与は別のtransactionとなります。 RefundTransaction で元のイベントをキャンセルしたときはポイント付与のtransactionもキャンセルされ、逆にポイント付与のtransactionをキャンセルしたときは連動して元のイベントがキャンセルされます。
|
4769
5187
|
responses:
|
4770
5188
|
'200':
|
4771
5189
|
description: OK
|
@@ -4779,3 +5197,584 @@ paths:
|
|
4779
5197
|
$ref: '#/components/responses/Forbidden'
|
4780
5198
|
'422':
|
4781
5199
|
$ref: '#/components/responses/UnprocessableEntity'
|
5200
|
+
get:
|
5201
|
+
tags:
|
5202
|
+
- Campaign
|
5203
|
+
summary: 'キャンペーン一覧を取得する'
|
5204
|
+
description: |-
|
5205
|
+
マネーIDを指定してキャンペーンを取得します。
|
5206
|
+
発行体の組織マネージャ権限で、自組織が発行するマネーのキャンペーンについてのみ閲覧可能です。
|
5207
|
+
閲覧権限がない場合は unpermitted_admin_user エラー(422)が返ります。
|
5208
|
+
x-pokepay-operator-name: "ListCampaigns"
|
5209
|
+
x-pokepay-allow-server-side: true
|
5210
|
+
requestBody:
|
5211
|
+
required: true
|
5212
|
+
content:
|
5213
|
+
application/json:
|
5214
|
+
schema:
|
5215
|
+
required: ["private_money_id"]
|
5216
|
+
properties:
|
5217
|
+
private_money_id:
|
5218
|
+
type: string
|
5219
|
+
format: uuid
|
5220
|
+
title: 'マネーID'
|
5221
|
+
description: |-
|
5222
|
+
マネーIDです。
|
5223
|
+
|
5224
|
+
フィルターとして使われ、指定したマネーでのキャンペーンのみ一覧に表示されます。
|
5225
|
+
is_ongoing:
|
5226
|
+
type: boolean
|
5227
|
+
title: '現在適用可能なキャンペーンかどうか'
|
5228
|
+
description: |-
|
5229
|
+
有効化されており、現在キャンペーン期間内にあるキャンペーンをフィルターするために使われます。
|
5230
|
+
真であれば適用可能なもののみを抽出し、偽であれば適用不可なもののみを抽出します。
|
5231
|
+
デフォルトでは未指定(フィルターなし)です。
|
5232
|
+
page:
|
5233
|
+
type: integer
|
5234
|
+
minimum: 1
|
5235
|
+
title: 'ページ番号'
|
5236
|
+
description: 取得したいページ番号です。
|
5237
|
+
example: 1
|
5238
|
+
per_page:
|
5239
|
+
type: integer
|
5240
|
+
minimum: 1
|
5241
|
+
title: '1ページ分の取得数'
|
5242
|
+
description: 1ページ分の取得数です。デフォルトでは 20 になっています。
|
5243
|
+
example: 50
|
5244
|
+
responses:
|
5245
|
+
'200':
|
5246
|
+
description: OK
|
5247
|
+
content:
|
5248
|
+
application/json:
|
5249
|
+
schema:
|
5250
|
+
$ref: '#/components/schemas/PaginatedCampaigns'
|
5251
|
+
'400':
|
5252
|
+
$ref: '#/components/responses/InvalidParameters'
|
5253
|
+
'422':
|
5254
|
+
$ref: '#/components/responses/UnprocessableEntity'
|
5255
|
+
/campaigns/{campaign_id}:
|
5256
|
+
get:
|
5257
|
+
tags:
|
5258
|
+
- Campaign
|
5259
|
+
summary: 'キャンペーンを取得する'
|
5260
|
+
description: |-
|
5261
|
+
IDを指定してキャンペーンを取得します。
|
5262
|
+
発行体の組織マネージャ権限で、自組織が発行するマネーのキャンペーンについてのみ閲覧可能です。
|
5263
|
+
閲覧権限がない場合は unpermitted_admin_user エラー(422)が返ります。
|
5264
|
+
x-pokepay-operator-name: "GetCampaign"
|
5265
|
+
x-pokepay-allow-server-side: true
|
5266
|
+
parameters:
|
5267
|
+
- in: path
|
5268
|
+
name: campaign_id
|
5269
|
+
required: true
|
5270
|
+
schema:
|
5271
|
+
type: string
|
5272
|
+
format: uuid
|
5273
|
+
title: 'キャンペーンID'
|
5274
|
+
description: |-
|
5275
|
+
キャンペーンIDです。
|
5276
|
+
|
5277
|
+
指定したIDのキャンペーンを取得します。存在しないIDを指定した場合は404エラー(NotFound)が返ります。
|
5278
|
+
responses:
|
5279
|
+
'200':
|
5280
|
+
description: OK
|
5281
|
+
content:
|
5282
|
+
application/json:
|
5283
|
+
schema:
|
5284
|
+
$ref: '#/components/schemas/Campaign'
|
5285
|
+
'400':
|
5286
|
+
$ref: '#/components/responses/InvalidParameters'
|
5287
|
+
'422':
|
5288
|
+
$ref: '#/components/responses/Forbidden'
|
5289
|
+
'404':
|
5290
|
+
$ref: '#/components/responses/NotFound'
|
5291
|
+
patch:
|
5292
|
+
tags:
|
5293
|
+
- Campaign
|
5294
|
+
summary: 'ポイント付与キャンペーンを更新する'
|
5295
|
+
description: |
|
5296
|
+
ポイント付与キャンペーンを更新します。
|
5297
|
+
x-pokepay-operator-name: "UpdateCampaign"
|
5298
|
+
x-pokepay-allow-server-side: true
|
5299
|
+
parameters:
|
5300
|
+
- in: path
|
5301
|
+
name: campaign_id
|
5302
|
+
required: true
|
5303
|
+
schema:
|
5304
|
+
type: string
|
5305
|
+
format: uuid
|
5306
|
+
title: 'キャンペーンID'
|
5307
|
+
description: |-
|
5308
|
+
キャンペーンIDです。
|
5309
|
+
|
5310
|
+
指定したIDのキャンペーンを更新します。存在しないIDを指定した場合は404エラー(NotFound)が返ります。
|
5311
|
+
requestBody:
|
5312
|
+
required: true
|
5313
|
+
content:
|
5314
|
+
application/json:
|
5315
|
+
schema:
|
5316
|
+
properties:
|
5317
|
+
name:
|
5318
|
+
title: 'キャンペーン名'
|
5319
|
+
type: string
|
5320
|
+
maxLength: 256
|
5321
|
+
description: |-
|
5322
|
+
キャンペーン名です。
|
5323
|
+
|
5324
|
+
ポイント付与によってできるチャージ取引の説明文に転記されます。取引説明文はエンドユーザーからも確認できます。
|
5325
|
+
starts_at:
|
5326
|
+
type: string
|
5327
|
+
format: date-time
|
5328
|
+
title: 'キャンペーン開始日時'
|
5329
|
+
description: |-
|
5330
|
+
キャンペーン開始日時です。
|
5331
|
+
キャンペーン期間中のみポイントが付与されます。
|
5332
|
+
開始日時よりも終了日時が前のときはcampaign_invalid_periodエラー(422)になります。
|
5333
|
+
ends_at:
|
5334
|
+
type: string
|
5335
|
+
format: date-time
|
5336
|
+
title: 'キャンペーン終了日時'
|
5337
|
+
description: |-
|
5338
|
+
キャンペーン終了日時です。
|
5339
|
+
キャンペーン期間中のみポイントが付与されます。
|
5340
|
+
開始日時よりも終了日時が前のときはcampaign_invalid_periodエラー(422)になります。
|
5341
|
+
priority:
|
5342
|
+
type: integer
|
5343
|
+
title: 'キャンペーンの適用優先度'
|
5344
|
+
description: |-
|
5345
|
+
キャンペーンの適用優先度です。
|
5346
|
+
|
5347
|
+
優先度が大きいものから順に適用判定されていきます。
|
5348
|
+
キャンペーン期間が重なっている同一の優先度のキャンペーンが存在するとcampaign_period_overlapsエラー(422)になります。
|
5349
|
+
event:
|
5350
|
+
type: string
|
5351
|
+
enum: [topup, payment, external-transaction]
|
5352
|
+
title: 'イベント種別'
|
5353
|
+
description: |-
|
5354
|
+
キャンペーンのトリガーとなるイベントの種類を指定します。
|
5355
|
+
|
5356
|
+
以下のいずれかを指定できます。
|
5357
|
+
|
5358
|
+
1. topup
|
5359
|
+
店舗からエンドユーザーへの送金取引(チャージ)
|
5360
|
+
2. payment
|
5361
|
+
エンドユーザーから店舗への送金取引(支払い)
|
5362
|
+
3. external-transaction
|
5363
|
+
ポケペイ外の取引(現金決済など)
|
5364
|
+
description:
|
5365
|
+
type: string
|
5366
|
+
maxLength: 200
|
5367
|
+
title: 'キャンペーンの説明文'
|
5368
|
+
description: |-
|
5369
|
+
キャンペーンの内容を記載します。管理画面などでキャンペーンを管理するための説明文になります。
|
5370
|
+
status:
|
5371
|
+
type: string
|
5372
|
+
enum: [enabled, disabled]
|
5373
|
+
title: 'キャンペーン作成時の状態'
|
5374
|
+
description: |-
|
5375
|
+
キャンペーン作成時の状態を指定します。デフォルトではenabledです。
|
5376
|
+
|
5377
|
+
以下のいずれかを指定できます。
|
5378
|
+
|
5379
|
+
1. enabled
|
5380
|
+
有効
|
5381
|
+
2. disabled
|
5382
|
+
無効
|
5383
|
+
point_expires_at:
|
5384
|
+
type: string
|
5385
|
+
format: date-time
|
5386
|
+
nullable: true
|
5387
|
+
title: 'ポイント有効期限(絶対日時指定)'
|
5388
|
+
description: |-
|
5389
|
+
キャンペーンによって付与されるポイントの有効期限を絶対日時で指定します。
|
5390
|
+
省略した場合はマネーに設定された有効期限と同じものがポイントの有効期限となります。
|
5391
|
+
point_expires_in_days:
|
5392
|
+
type: integer
|
5393
|
+
minimum: 1
|
5394
|
+
nullable: true
|
5395
|
+
title: 'ポイント有効期限(相対日数指定)'
|
5396
|
+
description: |-
|
5397
|
+
キャンペーンによって付与されるポイントの有効期限を相対日数で指定します。
|
5398
|
+
省略した場合はマネーに設定された有効期限と同じものがポイントの有効期限となります。
|
5399
|
+
is_exclusive:
|
5400
|
+
type: boolean
|
5401
|
+
title: 'キャンペーンの重複設定'
|
5402
|
+
description: |-
|
5403
|
+
キャンペーンの重ね掛けを行うかどうかのフラグです。
|
5404
|
+
|
5405
|
+
これにtrueを指定すると他のキャンペーンと同時適用されません。デフォルト値はtrueです。
|
5406
|
+
falseを指定すると次の優先度の重ね掛け可能なキャンペーンの適用判定に進みます。
|
5407
|
+
subject:
|
5408
|
+
type: string
|
5409
|
+
enum: [money, all]
|
5410
|
+
title: 'ポイント付与の対象金額の種別'
|
5411
|
+
description: |-
|
5412
|
+
ポイント付与額を計算する対象となる金額の種類を指定します。デフォルト値はallです。
|
5413
|
+
eventとしてexternal-transactionを指定した場合はポイントとマネーの区別がないためsubjectの指定に関わらず常にallとなります。
|
5414
|
+
|
5415
|
+
以下のいずれかを指定できます。
|
5416
|
+
|
5417
|
+
1. money
|
5418
|
+
moneyを指定すると決済額の中で「マネー」を使って支払った額を対象にします
|
5419
|
+
|
5420
|
+
2. all
|
5421
|
+
all を指定すると決済額全体を対象にします (「ポイント」での取引額を含む)
|
5422
|
+
注意: event を topup にしたときはポイントの付与に対しても適用されます
|
5423
|
+
amount_based_point_rules:
|
5424
|
+
type: array
|
5425
|
+
items:
|
5426
|
+
type: object
|
5427
|
+
properties:
|
5428
|
+
point_amount:
|
5429
|
+
type: number
|
5430
|
+
format: decimal
|
5431
|
+
minimum: 0
|
5432
|
+
title: '付与ポイント量'
|
5433
|
+
description: |-
|
5434
|
+
キャンペーンにより付与するポイント量。(必須項目)
|
5435
|
+
|
5436
|
+
point_amount_unitにより指定される単位が絶対額のときは小数点以下が切り捨てられ整数として扱われます。
|
5437
|
+
パーセント指定の時は小数を許容し、割合計算後に小数点以下が切り捨てられます。
|
5438
|
+
いずれの場合も実際に付与されるポイントは整数のみです。
|
5439
|
+
point_amount_unit:
|
5440
|
+
type: string
|
5441
|
+
enum: [percent, absolute]
|
5442
|
+
title: '付与ポイント量の単位'
|
5443
|
+
description: |-
|
5444
|
+
キャンペーンにより付与するポイント量の単位を指定します。(必須項目)
|
5445
|
+
|
5446
|
+
以下のいずれかを指定できます。
|
5447
|
+
|
5448
|
+
1. percent
|
5449
|
+
付与するポイント量が元取引の取引額に応じて割合で変化するときに指定します。
|
5450
|
+
|
5451
|
+
2. absolute
|
5452
|
+
付与するポイント量が元取引の取引額に依存しない絶対額であるときに指定します。
|
5453
|
+
subject_more_than:
|
5454
|
+
type: integer
|
5455
|
+
minimum: 0
|
5456
|
+
title: '対象金額の下限値 (x <)'
|
5457
|
+
description: |-
|
5458
|
+
対象金額の下限値 (x <) を指定します (ただし、指定された金額は含まない)。
|
5459
|
+
subject_more_than_or_equal といずれかのみ指定できます。
|
5460
|
+
subject_more_than_or_equal:
|
5461
|
+
type: integer
|
5462
|
+
minimum: 0
|
5463
|
+
title: '対象金額の下限値 (x <=)'
|
5464
|
+
description: |-
|
5465
|
+
対象金額の下限値 (x <=) を指定します。
|
5466
|
+
subject_more_than といずれかのみ指定できます。
|
5467
|
+
subject_less_than:
|
5468
|
+
type: integer
|
5469
|
+
minimum: 0
|
5470
|
+
title: '対象金額の上限値 (< x)'
|
5471
|
+
description: |-
|
5472
|
+
対象金額の上限値 (< x) を指定します (ただし、指定された金額は含まない)。
|
5473
|
+
subject_less_than_or_equal といずれかのみ指定できます。
|
5474
|
+
subject_less_than_or_equal:
|
5475
|
+
type: integer
|
5476
|
+
minimum: 0
|
5477
|
+
title: '対象金額の上限値 (<= x)'
|
5478
|
+
description: |-
|
5479
|
+
対象金額の上限値 (<= x) を指定します。
|
5480
|
+
subject_less_than といずれかのみ指定できます。
|
5481
|
+
example: |-
|
5482
|
+
{
|
5483
|
+
"point_amount": 5,
|
5484
|
+
"point_amount_unit": "percent",
|
5485
|
+
"subject_more_than_or_equal": 1000,
|
5486
|
+
"subject_less_than": 5000
|
5487
|
+
}
|
5488
|
+
|
5489
|
+
title: '取引金額ベースのポイント付与ルール'
|
5490
|
+
nullable: true
|
5491
|
+
description: |-
|
5492
|
+
金額をベースとしてポイント付与を行うルールを指定します。
|
5493
|
+
amount_based_point_rules と product_based_point_rules はどちらか一方しか指定できません。
|
5494
|
+
各ルールは一つのみ適用され、条件に重複があった場合は先に記載されたものが優先されます。
|
5495
|
+
|
5496
|
+
例:
|
5497
|
+
```javascript
|
5498
|
+
[
|
5499
|
+
// 1000円以上、5000円未満の決済には 5%
|
5500
|
+
{
|
5501
|
+
"point_amount": 5,
|
5502
|
+
"point_amount_unit": "percent",
|
5503
|
+
"subject_more_than_or_equal": 1000,
|
5504
|
+
"subject_less_than": 5000
|
5505
|
+
},
|
5506
|
+
// 5000円以上の決済には 10%
|
5507
|
+
{
|
5508
|
+
"point_amount": 10,
|
5509
|
+
"point_amount_unit": "percent",
|
5510
|
+
"subject_more_than_or_equal": 5000
|
5511
|
+
},
|
5512
|
+
]
|
5513
|
+
```
|
5514
|
+
|
5515
|
+
product_based_point_rules:
|
5516
|
+
type: array
|
5517
|
+
items:
|
5518
|
+
type: object
|
5519
|
+
properties:
|
5520
|
+
point_amount:
|
5521
|
+
type: number
|
5522
|
+
format: decimal
|
5523
|
+
minimum: 0
|
5524
|
+
title: '付与ポイント量'
|
5525
|
+
description: |-
|
5526
|
+
キャンペーンにより付与するポイント量。単位は point_amount_unit で指定します。(必須項目)
|
5527
|
+
|
5528
|
+
point_amount_unitにより指定される単位が絶対額のときは小数点以下が切り捨てられ整数として扱われます。
|
5529
|
+
パーセント指定の時は小数を許容し、割合計算後に小数点以下が切り捨てられます。
|
5530
|
+
いずれの場合も実際に付与されるポイントは整数のみです。
|
5531
|
+
point_amount_unit:
|
5532
|
+
type: string
|
5533
|
+
enum: [percent, absolute]
|
5534
|
+
title: '付与ポイント量の単位'
|
5535
|
+
description: |-
|
5536
|
+
キャンペーンにより付与するポイント量の単位を指定します。(必須項目)
|
5537
|
+
|
5538
|
+
以下のいずれかを指定できます。
|
5539
|
+
|
5540
|
+
1. percent
|
5541
|
+
付与するポイント量が元取引の取引額に応じて割合で変化するときに指定します。
|
5542
|
+
|
5543
|
+
2. absolute
|
5544
|
+
付与するポイント量が元取引の取引額に依存しない絶対額であるときに指定します。
|
5545
|
+
product_code:
|
5546
|
+
type: string
|
5547
|
+
maxLength: 64
|
5548
|
+
title: '対象の製品コード'
|
5549
|
+
description: |-
|
5550
|
+
対象の製品コード (JANコードやISBNコードなど) を指定します。(必須項目)
|
5551
|
+
|
5552
|
+
SQLのLIKE文のようにワイルドカードを使った製品コードのパターンを指定することもできます (例: 978-% でISBNコード)
|
5553
|
+
items:
|
5554
|
+
type: string
|
5555
|
+
required_count:
|
5556
|
+
type: integer
|
5557
|
+
minimum: 1
|
5558
|
+
title: '必要購入個数'
|
5559
|
+
description: |-
|
5560
|
+
キャンペーン適用のための対象商品の必要購入個数を指定します (例:商品Aを2個以上購入するとn%ポイント)。
|
5561
|
+
デフォルト値は1です。
|
5562
|
+
is_multiply_by_count:
|
5563
|
+
type: boolean
|
5564
|
+
title: '複数個購入したときにポイント付与額に個数を掛けるかどうか'
|
5565
|
+
description: |-
|
5566
|
+
キャンペーン対象の商品を複数個購入したときに、個数に応じてポイント付与額を増やすかどうかのフラグです。
|
5567
|
+
デフォルト値は false です。
|
5568
|
+
starts_at:
|
5569
|
+
type: string
|
5570
|
+
format: date-time
|
5571
|
+
title: '商品個別のキャンペーン開始日時'
|
5572
|
+
description: |-
|
5573
|
+
このルールを適用する開始日時を指定します。
|
5574
|
+
デフォルトではキャンペーン全体の開始日時が指定されます。
|
5575
|
+
商品個別にキャンペーン期間指定をする場合は、キャンペーン全体の期間指定の範囲内に入っている必要があります。
|
5576
|
+
ends_at:
|
5577
|
+
type: string
|
5578
|
+
format: date-time
|
5579
|
+
title: '商品個別のキャンペーン終了日時'
|
5580
|
+
description: |-
|
5581
|
+
このルールを適用する終了日時を指定します。
|
5582
|
+
デフォルトではキャンペーン全体の終了日時が指定されます。
|
5583
|
+
商品個別にキャンペーン期間指定をする場合は、キャンペーン全体の期間指定の範囲内に入っている必要があります。
|
5584
|
+
example: |-
|
5585
|
+
{
|
5586
|
+
"point_amount": 5,
|
5587
|
+
"point_amount_unit": "percent",
|
5588
|
+
"product_code": "4912345678904",
|
5589
|
+
"is_multiply_by_count": true,
|
5590
|
+
"required_count": 2
|
5591
|
+
}
|
5592
|
+
|
5593
|
+
title: '商品情報ベースのポイント付与ルール'
|
5594
|
+
nullable: true
|
5595
|
+
description: |-
|
5596
|
+
商品情報をベースとしてポイント付与を行うルールを指定します。
|
5597
|
+
ルールは商品ごとに設定可能で、ルールの配列として指定します。
|
5598
|
+
amount_based_point_rules と product_based_point_rules はどちらか一方しか指定できません。
|
5599
|
+
event が payment か external-transaction の時のみ有効です。
|
5600
|
+
各ルールの順序は問わず、適用可能なものは全て適用されます。
|
5601
|
+
一つの決済の中で複数の商品がキャンペーン適用可能な場合はそれぞれの商品についてのルールが適用され、ポイント付与額はその合算になります。
|
5602
|
+
|
5603
|
+
例:
|
5604
|
+
```javascript
|
5605
|
+
[
|
5606
|
+
// 対象商品の購入額から5%ポイント付与。複数購入時は単価の5%が付与される。
|
5607
|
+
{
|
5608
|
+
"point_amount": 5,
|
5609
|
+
"point_amount_unit": "percent",
|
5610
|
+
"product_code": "4912345678904",
|
5611
|
+
},
|
5612
|
+
// 対象商品の購入額から5%ポイント付与。複数購入時は購入総額の5%が付与される。
|
5613
|
+
{
|
5614
|
+
"point_amount": 5,
|
5615
|
+
"point_amount_unit": "percent",
|
5616
|
+
"product_code": "4912345678904",
|
5617
|
+
"is_multiply_by_count": true,
|
5618
|
+
},
|
5619
|
+
// 対象商品を2つ以上購入したら500ポイント付与(固定額付与)
|
5620
|
+
{
|
5621
|
+
"point_amount": 500,
|
5622
|
+
"point_amount_unit": absolute",
|
5623
|
+
"product_code": "4912345678904",
|
5624
|
+
"required_count": 2
|
5625
|
+
},
|
5626
|
+
// 書籍は10%ポイント付与
|
5627
|
+
// ※ISBNの形式はレジがポケペイに送信する形式に準じます
|
5628
|
+
{
|
5629
|
+
"point_amount": 10,
|
5630
|
+
"point_amount_unit": "percent",
|
5631
|
+
"product_code": "978-%",
|
5632
|
+
},
|
5633
|
+
// 一部の出版社の書籍は10%ポイント付与
|
5634
|
+
{
|
5635
|
+
"point_amount": 10,
|
5636
|
+
"point_amount_unit": "percent",
|
5637
|
+
"product_code": "978-4-01-%", // 旺文社
|
5638
|
+
}
|
5639
|
+
]
|
5640
|
+
```
|
5641
|
+
|
5642
|
+
applicable_days_of_week:
|
5643
|
+
type: array
|
5644
|
+
items:
|
5645
|
+
type: integer
|
5646
|
+
minimun: 0
|
5647
|
+
maximum: 6
|
5648
|
+
nullable: true
|
5649
|
+
title: 'キャンペーンを適用する曜日 (複数指定)'
|
5650
|
+
describe: |-
|
5651
|
+
キャンペーンを適用する曜日を指定します (複数指定)。
|
5652
|
+
曜日は整数で表します。月曜を 0 とし、日曜を 6 とします。
|
5653
|
+
指定しなかった場合は全日を対象にします (曜日による適用条件なし)
|
5654
|
+
applicable_time_ranges:
|
5655
|
+
type: array
|
5656
|
+
items:
|
5657
|
+
type: object
|
5658
|
+
properties:
|
5659
|
+
from:
|
5660
|
+
type: string
|
5661
|
+
description: |-
|
5662
|
+
時間帯の開始時刻 (HH:mmの形式)
|
5663
|
+
to:
|
5664
|
+
type: string
|
5665
|
+
description: |-
|
5666
|
+
時間帯の終了時刻 (HH:mmの形式)
|
5667
|
+
example: |-
|
5668
|
+
{
|
5669
|
+
"from": "12:00",
|
5670
|
+
"to": "23:59"
|
5671
|
+
}
|
5672
|
+
|
5673
|
+
nullable: true
|
5674
|
+
title: 'キャンペーンを適用する時間帯 (複数指定)'
|
5675
|
+
describe: |-
|
5676
|
+
キャンペーンを適用する時間帯を指定します (複数指定可)。
|
5677
|
+
時間帯はfromとtoからなるオブジェクトで指定します。
|
5678
|
+
fromとtoは両方必要です。
|
5679
|
+
applicable_shop_ids:
|
5680
|
+
type: array
|
5681
|
+
items:
|
5682
|
+
type: string
|
5683
|
+
format: uuid
|
5684
|
+
nullable: true
|
5685
|
+
title: 'キャンペーン適用対象となる店舗IDのリスト'
|
5686
|
+
describe: |-
|
5687
|
+
キャンペーンを適用する店舗IDを指定します (複数指定)。
|
5688
|
+
指定しなかった場合は全店舗が対象になります。
|
5689
|
+
minimum_number_for_combination_purchase:
|
5690
|
+
type: integer
|
5691
|
+
minimum: 1
|
5692
|
+
nullable: true
|
5693
|
+
title: '複数種類の商品を同時購入するときの商品種別数の下限'
|
5694
|
+
description: |-
|
5695
|
+
複数種別の商品を同時購入したとき、同時購入キャンペーンの対象となる商品種別数の下限です。
|
5696
|
+
|
5697
|
+
このパラメータを指定するときは product_based_point_rules で商品毎のルールが指定されている必要があります。
|
5698
|
+
例えば、A商品とB商品とC商品のうち、キャンペーンの発火のために2商品以上が同時購入される必要があるときは 2 を指定します。
|
5699
|
+
|
5700
|
+
例1: 商品A, Bが同時購入されたときに固定ポイント額(200ポイント)付与
|
5701
|
+
```javascript
|
5702
|
+
{
|
5703
|
+
minimum_number_for_combination_purchase: 2,
|
5704
|
+
product_based_point_rules: [
|
5705
|
+
{
|
5706
|
+
"point_amount": 100,
|
5707
|
+
"point_amount_unit": "absolute",
|
5708
|
+
"product_code": "商品Aの商品コード"
|
5709
|
+
},
|
5710
|
+
{
|
5711
|
+
"point_amount": 100,
|
5712
|
+
"point_amount_unit": "absolute",
|
5713
|
+
"product_code": "商品Bの商品コード"
|
5714
|
+
}
|
5715
|
+
]
|
5716
|
+
}
|
5717
|
+
```
|
5718
|
+
|
5719
|
+
例2: 商品A, Bが3個ずつ以上同時購入されたときに固定ポイント額(200ポイント)付与
|
5720
|
+
```javascript
|
5721
|
+
{
|
5722
|
+
minimum_number_for_combination_purchase: 2,
|
5723
|
+
product_based_point_rules: [
|
5724
|
+
{
|
5725
|
+
"point_amount": 100,
|
5726
|
+
"point_amount_unit": "absolute",
|
5727
|
+
"product_code": "商品Aの商品コード",
|
5728
|
+
"required_count": 3
|
5729
|
+
},
|
5730
|
+
{
|
5731
|
+
"point_amount": 100,
|
5732
|
+
"point_amount_unit": "absolute",
|
5733
|
+
"product_code": "商品Bの商品コード",
|
5734
|
+
"required_count": 3
|
5735
|
+
}
|
5736
|
+
]
|
5737
|
+
}
|
5738
|
+
```
|
5739
|
+
|
5740
|
+
例2: 商品A, B, Cのうち2商品以上が同時購入されたときに総額の10%ポイントが付与
|
5741
|
+
```javascript
|
5742
|
+
{
|
5743
|
+
minimum_number_for_combination_purchase: 2,
|
5744
|
+
product_based_point_rules: [
|
5745
|
+
{
|
5746
|
+
"point_amount": 10,
|
5747
|
+
"point_amount_unit": "percent",
|
5748
|
+
"product_code": "商品Aの商品コード",
|
5749
|
+
"is_multiply_by_count": true,
|
5750
|
+
},
|
5751
|
+
{
|
5752
|
+
"point_amount": 10,
|
5753
|
+
"point_amount_unit": "percent",
|
5754
|
+
"product_code": "商品Bの商品コード",
|
5755
|
+
"is_multiply_by_count": true,
|
5756
|
+
},
|
5757
|
+
{
|
5758
|
+
"point_amount": 10,
|
5759
|
+
"point_amount_unit": "percent",
|
5760
|
+
"product_code": "商品Cの商品コード",
|
5761
|
+
"is_multiply_by_count": true,
|
5762
|
+
}
|
5763
|
+
]
|
5764
|
+
}
|
5765
|
+
```
|
5766
|
+
responses:
|
5767
|
+
'200':
|
5768
|
+
description: OK
|
5769
|
+
content:
|
5770
|
+
application/json:
|
5771
|
+
schema:
|
5772
|
+
$ref: '#/components/schemas/Campaign'
|
5773
|
+
'400':
|
5774
|
+
$ref: '#/components/responses/BadRequest'
|
5775
|
+
'403':
|
5776
|
+
$ref: '#/components/responses/Forbidden'
|
5777
|
+
'404':
|
5778
|
+
$ref: '#/components/responses/NotFound'
|
5779
|
+
'422':
|
5780
|
+
$ref: '#/components/responses/UnprocessableEntity'
|