pokepay_partner_ruby_sdk 0.1.17 → 0.1.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (30) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/docs/index.md +738 -150
  4. data/lib/pokepay_partner_ruby_sdk/request/create_campaign.rb +20 -0
  5. data/lib/pokepay_partner_ruby_sdk/request/create_cpm_transaction.rb +2 -2
  6. data/lib/pokepay_partner_ruby_sdk/request/create_exchange_transaction.rb +2 -2
  7. data/lib/pokepay_partner_ruby_sdk/request/create_payment_transaction.rb +2 -2
  8. data/lib/pokepay_partner_ruby_sdk/request/create_topup_transaction.rb +2 -2
  9. data/lib/pokepay_partner_ruby_sdk/request/create_topup_transaction_with_check.rb +2 -2
  10. data/lib/pokepay_partner_ruby_sdk/request/create_transaction.rb +2 -2
  11. data/lib/pokepay_partner_ruby_sdk/request/create_transfer_transaction.rb +2 -2
  12. data/lib/pokepay_partner_ruby_sdk/request/delete_account.rb +15 -0
  13. data/lib/pokepay_partner_ruby_sdk/request/get_transaction.rb +2 -2
  14. data/lib/pokepay_partner_ruby_sdk/request/refund_external_transaction.rb +2 -2
  15. data/lib/pokepay_partner_ruby_sdk/request/refund_transaction.rb +2 -2
  16. data/lib/pokepay_partner_ruby_sdk/request/update_account.rb +2 -2
  17. data/lib/pokepay_partner_ruby_sdk/request/update_customer_account.rb +15 -0
  18. data/lib/pokepay_partner_ruby_sdk/response/account.rb +3 -0
  19. data/lib/pokepay_partner_ruby_sdk/response/account_deleted.rb +11 -0
  20. data/lib/pokepay_partner_ruby_sdk/response/account_detail.rb +3 -0
  21. data/lib/pokepay_partner_ruby_sdk/response/account_status.rb +11 -0
  22. data/lib/pokepay_partner_ruby_sdk/response/account_with_user.rb +3 -0
  23. data/lib/pokepay_partner_ruby_sdk/response/account_without_private_money_detail.rb +3 -0
  24. data/lib/pokepay_partner_ruby_sdk/response/campaign.rb +41 -0
  25. data/lib/pokepay_partner_ruby_sdk/response/private_money.rb +2 -0
  26. data/lib/pokepay_partner_ruby_sdk/response/transaction_detail.rb +39 -0
  27. data/lib/pokepay_partner_ruby_sdk/version.rb +1 -1
  28. data/lib/pokepay_partner_ruby_sdk.rb +7 -0
  29. data/partner.yaml +693 -24
  30. metadata +9 -2
data/partner.yaml CHANGED
@@ -37,6 +37,7 @@ tags:
37
37
  - name: Private Money
38
38
  - name: Bulk
39
39
  - name: Event
40
+ - name: Campaign
40
41
 
41
42
  components:
42
43
  schemas:
@@ -95,6 +96,11 @@ components:
95
96
  type: array
96
97
  items:
97
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: 'ウォレット状態'
98
104
  Account:
99
105
  x-pokepay-schema-type: "response"
100
106
  properties:
@@ -108,6 +114,8 @@ components:
108
114
  is_suspended:
109
115
  type: boolean
110
116
  title: 'ウォレットが凍結されているかどうか'
117
+ status:
118
+ $ref: '#/components/schemas/AccountStatus'
111
119
  private_money:
112
120
  $ref: '#/components/schemas/PrivateMoney'
113
121
  title: '設定マネー情報'
@@ -121,6 +129,8 @@ components:
121
129
  type: string
122
130
  is_suspended:
123
131
  type: boolean
132
+ status:
133
+ $ref: '#/components/schemas/AccountStatus'
124
134
  private_money:
125
135
  $ref: '#/components/schemas/PrivateMoney'
126
136
  user:
@@ -135,6 +145,8 @@ components:
135
145
  type: string
136
146
  is_suspended:
137
147
  type: boolean
148
+ status:
149
+ $ref: '#/components/schemas/AccountStatus'
138
150
  balance:
139
151
  type: number
140
152
  format: decimal
@@ -167,6 +179,9 @@ components:
167
179
  private_money:
168
180
  $ref: '#/components/schemas/PrivateMoney'
169
181
  title: '設定マネー情報'
182
+ AccountDeleted:
183
+ x-pokepay-schema-type: "response"
184
+ properties: {}
170
185
  AccountBalance:
171
186
  x-pokepay-schema-type: "response"
172
187
  properties:
@@ -463,6 +478,9 @@ components:
463
478
  type: boolean
464
479
  nullable: true
465
480
  title: '加盟店によるチャージが有効かどうか'
481
+ display_money_and_point:
482
+ type: string
483
+ enum: [both, money-only, point-only]
466
484
  Organization:
467
485
  x-pokepay-schema-type: "response"
468
486
  properties:
@@ -515,6 +533,51 @@ components:
515
533
  description:
516
534
  type: string
517
535
  title: '取引説明文'
536
+ TransactionDetail:
537
+ x-pokepay-schema-type: "response"
538
+ properties:
539
+ id:
540
+ type: string
541
+ format: uuid
542
+ title: '取引ID'
543
+ type:
544
+ type: string
545
+ title: '取引種別 (チャージ=topup, 支払い=payment)'
546
+ is_modified:
547
+ type: boolean
548
+ title: '返金された取引かどうか'
549
+ sender:
550
+ $ref: '#/components/schemas/User'
551
+ title: '送金者情報'
552
+ sender_account:
553
+ $ref: '#/components/schemas/Account'
554
+ title: '送金ウォレット情報'
555
+ receiver:
556
+ $ref: '#/components/schemas/User'
557
+ title: '受取者情報'
558
+ receiver_account:
559
+ $ref: '#/components/schemas/Account'
560
+ title: '受取ウォレット情報'
561
+ amount:
562
+ type: number
563
+ title: '決済総額 (マネー額 + ポイント額)'
564
+ money_amount:
565
+ type: number
566
+ title: '決済マネー額'
567
+ point_amount:
568
+ type: number
569
+ title: '決済ポイント額'
570
+ done_at:
571
+ type: string
572
+ format: date-time
573
+ title: '取引日時'
574
+ description:
575
+ type: string
576
+ title: '取引説明文'
577
+ transfers:
578
+ type: array
579
+ items:
580
+ $ref: '#/components/schemas/Transfer'
518
581
  ShopWithMetadata:
519
582
  x-pokepay-schema-type: "response"
520
583
  properties:
@@ -625,7 +688,7 @@ components:
625
688
  format: date-time
626
689
  type:
627
690
  type: string
628
- enum: [topup, payment, transfer, exchange]
691
+ enum: [topup, payment, transfer, exchange, cashback, expire]
629
692
  is_modified:
630
693
  type: boolean
631
694
  BulkTransaction:
@@ -679,6 +742,8 @@ components:
679
742
  type: string
680
743
  is_suspended:
681
744
  type: boolean
745
+ status:
746
+ $ref: '#/components/schemas/AccountStatus'
682
747
  private_money_id:
683
748
  type: string
684
749
  format: uuid
@@ -711,7 +776,7 @@ components:
711
776
  format: date-time
712
777
  type:
713
778
  type: string
714
- enum: [topup, payment, refund-topup, refund-payment, transfer, exchange-inflow, exchange-outflow, campaign-topup, refund-campaign, use-coupon, refund-coupon]
779
+ enum: [topup, payment, refund-topup, refund-payment, transfer, exchange-inflow, exchange-outflow, campaign-topup, refund-campaign, use-coupon, refund-coupon, cashback, expire]
715
780
  description:
716
781
  type: string
717
782
  transaction_id:
@@ -918,7 +983,68 @@ components:
918
983
  minimum: 0
919
984
  pagination:
920
985
  $ref: '#/components/schemas/Pagination'
921
-
986
+ Campaign:
987
+ x-pokepay-schema-type: "response"
988
+ properties:
989
+ id:
990
+ type: string
991
+ format: uuid
992
+ title: 'キャンペーンID'
993
+ name:
994
+ type: string
995
+ maxLength: 256
996
+ title: 'キャペーン名'
997
+ applicable_shops:
998
+ type: array
999
+ title: 'キャンペーン適用対象の店舗リスト'
1000
+ nullable: true
1001
+ items:
1002
+ $ref: '#/components/schemas/User'
1003
+ is_exclusive:
1004
+ type: boolean
1005
+ title: 'キャンペーンの重複を許すかどうかのフラグ'
1006
+ starts_at:
1007
+ type: string
1008
+ format: date-time
1009
+ title: 'キャンペーン開始日時'
1010
+ ends_at:
1011
+ type: string
1012
+ format: date-time
1013
+ title: 'キャンペーン終了日時'
1014
+ point_expires_at:
1015
+ type: string
1016
+ format: date-time
1017
+ title: 'キャンペーンによって付与されるポイントの失効日時'
1018
+ nullable: true
1019
+ point_expires_in_days:
1020
+ type: integer
1021
+ minimum: 1
1022
+ title: 'キャンペーンによって付与されるポイントの有効期限(相対指定、単位は日)'
1023
+ nullable: true
1024
+ priority:
1025
+ type: integer
1026
+ title: 'キャンペーンの優先順位'
1027
+ description:
1028
+ type: string
1029
+ maxLength: 200
1030
+ title: 'キャンペーン説明文'
1031
+ bear_point_shop:
1032
+ title: 'ポイントを負担する店舗'
1033
+ $ref: '#/components/schemas/User'
1034
+ private_money:
1035
+ title: 'キャンペーンを適用するマネー'
1036
+ $ref: '#/components/schemas/PrivateMoney'
1037
+ point_calculation_rule:
1038
+ type: string
1039
+ title: 'ポイント計算ルール (banklisp表記)'
1040
+ point_calculation_rule_object:
1041
+ type: string
1042
+ format: json
1043
+ title: 'ポイント計算ルール (JSON文字列による表記)'
1044
+ status:
1045
+ type: string
1046
+ enum: [enabled, disabled]
1047
+ title: 'キャンペーンの現在の状態'
922
1048
  BadRequest:
923
1049
  x-pokepay-schema-type: "response"
924
1050
  oneOf:
@@ -1268,19 +1394,73 @@ paths:
1268
1394
  type: boolean
1269
1395
  title: 'ウォレットが凍結されているかどうか'
1270
1396
  description: ウォレットの凍結状態です。真にするとウォレットが凍結され、そのウォレットでは新規取引ができなくなります。偽にすると凍結解除されます。
1397
+ status:
1398
+ type: string
1399
+ enum: [active, suspended, pre-closed]
1400
+ title: 'ウォレット状態'
1401
+ description: ウォレットの状態です。
1402
+ can_transfer_topup:
1403
+ type: boolean
1404
+ title: 'チャージ可能かどうか'
1405
+ description: 店舗ユーザーがエンドユーザーにチャージ可能かどうかです。真にするとチャージ可能となり、偽にするとチャージ不可能となります。
1271
1406
  responses:
1272
1407
  '200':
1273
1408
  description: OK
1274
1409
  content:
1275
1410
  application/json:
1276
1411
  schema:
1277
- $ref: '#/components/schemas/AccountDetail'
1412
+ $ref: '#/components/schemas/Account'
1278
1413
  '400':
1279
1414
  $ref: '#/components/responses/BadRequest'
1280
1415
  '403':
1281
1416
  $ref: '#/components/responses/Forbidden'
1282
1417
  '404':
1283
1418
  $ref: '#/components/responses/NotFound'
1419
+ delete:
1420
+ tags:
1421
+ - Customer
1422
+ summary: 'ウォレットを退会する'
1423
+ description: ウォレットを退会します。一度ウォレットを退会した後は、そのウォレットを再び利用可能な状態に戻すことは出来ません。
1424
+ x-pokepay-operator-name: "DeleteAccount"
1425
+ x-pokepay-allow-server-side: true
1426
+ parameters:
1427
+ - in: path
1428
+ name: account_id
1429
+ required: true
1430
+ schema:
1431
+ type: string
1432
+ format: uuid
1433
+ title: 'ウォレットID'
1434
+ description: |-
1435
+ ウォレットIDです。
1436
+
1437
+ 指定したウォレットIDのウォレットを退会します。
1438
+ requestBody:
1439
+ required: true
1440
+ content:
1441
+ application/json:
1442
+ schema:
1443
+ properties:
1444
+ cashback:
1445
+ type: boolean
1446
+ title: '返金有無'
1447
+ description: 退会時の返金有無です。エンドユーザに返金を行う場合、真を指定して下さい。現在のマネー残高を全て現金で返金したものとして記録されます。
1448
+ responses:
1449
+ '200':
1450
+ description: OK
1451
+ content:
1452
+ application/json:
1453
+ schema:
1454
+ $ref: '#/components/schemas/AccountDeleted'
1455
+ '400':
1456
+ $ref: '#/components/responses/BadRequest'
1457
+ '403':
1458
+ $ref: '#/components/responses/Forbidden'
1459
+ '404':
1460
+ $ref: '#/components/responses/NotFound'
1461
+ '422':
1462
+ $ref: '#/components/responses/UnprocessableEntity'
1463
+
1284
1464
  /accounts/{account_id}/balances:
1285
1465
  get:
1286
1466
  tags:
@@ -1409,6 +1589,62 @@ paths:
1409
1589
  $ref: '#/components/responses/Forbidden'
1410
1590
  '404':
1411
1591
  $ref: '#/components/responses/NotFound'
1592
+ /accounts/{account_id}/customers:
1593
+ patch:
1594
+ tags:
1595
+ - Customer
1596
+ summary: 'ウォレット情報を更新する'
1597
+ description: ウォレットの状態を更新します。
1598
+ x-pokepay-operator-name: "UpdateCustomerAccount"
1599
+ x-pokepay-allow-server-side: true
1600
+ parameters:
1601
+ - in: path
1602
+ name: account_id
1603
+ required: true
1604
+ schema:
1605
+ type: string
1606
+ format: uuid
1607
+ title: 'ウォレットID'
1608
+ description: |-
1609
+ ウォレットIDです。
1610
+
1611
+ 指定したウォレットIDのウォレットの状態を更新します。
1612
+ requestBody:
1613
+ required: true
1614
+ content:
1615
+ application/json:
1616
+ schema:
1617
+ properties:
1618
+ status:
1619
+ type: string
1620
+ enum: [active, suspended, pre-closed]
1621
+ title: 'ウォレット状態'
1622
+ description: ウォレットの状態です。
1623
+ account_name:
1624
+ title: 'アカウント名'
1625
+ type: string
1626
+ maxLength: 256
1627
+ description: 変更するウォレット名です。
1628
+ external_id:
1629
+ title: '外部ID'
1630
+ type: string
1631
+ maxLength: 50
1632
+ description: 変更する外部IDです。
1633
+ responses:
1634
+ '200':
1635
+ description: OK
1636
+ content:
1637
+ application/json:
1638
+ schema:
1639
+ $ref: '#/components/schemas/AccountWithUser'
1640
+ '400':
1641
+ $ref: '#/components/responses/BadRequest'
1642
+ '403':
1643
+ $ref: '#/components/responses/Forbidden'
1644
+ '404':
1645
+ $ref: '#/components/responses/NotFound'
1646
+ '422':
1647
+ $ref: '#/components/responses/UnprocessableEntity'
1412
1648
  /accounts/customers:
1413
1649
  get:
1414
1650
  tags:
@@ -1456,6 +1692,11 @@ paths:
1456
1692
  type: boolean
1457
1693
  title: 'ウォレットが凍結状態かどうかでフィルターする'
1458
1694
  description: このパラメータが指定されている場合、ウォレットの凍結状態で結果がフィルターされます。デフォルトでは未指定です。
1695
+ status:
1696
+ type: string
1697
+ enum: [active, suspended, pre-closed]
1698
+ title: 'ウォレット状態'
1699
+ description: このパラメータが指定されている場合、ウォレットの状態で結果がフィルターされます。デフォルトでは未指定です。
1459
1700
  external_id:
1460
1701
  type: string
1461
1702
  maxLength: 50
@@ -1807,6 +2048,7 @@ paths:
1807
2048
  - Check
1808
2049
  summary: 'チャージQRコードの発行'
1809
2050
  x-pokepay-operator-name: "CreateCheck"
2051
+ x-pokepay-allow-server-side: true
1810
2052
  requestBody:
1811
2053
  required: true
1812
2054
  content:
@@ -2030,13 +2272,19 @@ paths:
2030
2272
  エンドユーザーから店舗への送金取引(支払い)
2031
2273
 
2032
2274
  3. exchange-outflow
2033
-   他マネーへの流出
2275
+ 他マネーへの流出
2034
2276
 
2035
2277
  4. exchange-inflow
2036
2278
  他マネーからの流入
2279
+
2280
+ 5. cashback
2281
+ 退会時返金取引
2282
+
2283
+ 6. expire
2284
+ 退会時失効取引
2037
2285
  items:
2038
2286
  type: string
2039
- enum: [topup, payment, exchange_outflow, exchange_inflow]
2287
+ enum: [topup, payment, exchange_outflow, exchange_inflow, cashback, expire]
2040
2288
  description:
2041
2289
  type: string
2042
2290
  maxLength: 200
@@ -2104,7 +2352,7 @@ paths:
2104
2352
  content:
2105
2353
  application/json:
2106
2354
  schema:
2107
- $ref: '#/components/schemas/Transaction'
2355
+ $ref: '#/components/schemas/TransactionDetail'
2108
2356
  '400':
2109
2357
  $ref: '#/components/responses/BadRequest'
2110
2358
  '403':
@@ -2159,21 +2407,23 @@ paths:
2159
2407
 
2160
2408
  ポイント支払い時に実際お金を負担する店舗を指定します。
2161
2409
  money_amount:
2162
- type: number
2410
+ type: integer
2163
2411
  minimum: 0
2164
2412
  title: 'マネー額'
2165
2413
  description: |-
2166
2414
  マネー額です。
2167
2415
 
2168
2416
  送金するマネー額を指定します。
2417
+ デフォルト値は0で、money_amountとpoint_amountの両方が0のときにはinvalid_parameter_both_point_and_money_are_zero(エラーコード400)が返ります。
2169
2418
  point_amount:
2170
- type: number
2419
+ type: integer
2171
2420
  minimum: 0
2172
2421
  title: 'ポイント額'
2173
2422
  description: |-
2174
2423
  ポイント額です。
2175
2424
 
2176
2425
  送金するポイント額を指定します。
2426
+ デフォルト値は0で、money_amountとpoint_amountの両方が0のときにはinvalid_parameter_both_point_and_money_are_zero(エラーコード400)が返ります。
2177
2427
  point_expires_at:
2178
2428
  type: string
2179
2429
  format: date-time
@@ -2217,7 +2467,7 @@ paths:
2217
2467
  content:
2218
2468
  application/json:
2219
2469
  schema:
2220
- $ref: '#/components/schemas/Transaction'
2470
+ $ref: '#/components/schemas/TransactionDetail'
2221
2471
  '400':
2222
2472
  $ref: '#/components/responses/BadRequest'
2223
2473
  '403':
@@ -2264,7 +2514,7 @@ paths:
2264
2514
  content:
2265
2515
  application/json:
2266
2516
  schema:
2267
- $ref: '#/components/schemas/Transaction'
2517
+ $ref: '#/components/schemas/TransactionDetail'
2268
2518
  '400':
2269
2519
  $ref: '#/components/responses/BadRequest'
2270
2520
  '403':
@@ -2315,7 +2565,7 @@ paths:
2315
2565
 
2316
2566
  マネーを指定します。
2317
2567
  amount:
2318
- type: number
2568
+ type: integer
2319
2569
  minimum: 0
2320
2570
  title: '支払い額'
2321
2571
  description: |-
@@ -2398,7 +2648,7 @@ paths:
2398
2648
  content:
2399
2649
  application/json:
2400
2650
  schema:
2401
- $ref: '#/components/schemas/Transaction'
2651
+ $ref: '#/components/schemas/TransactionDetail'
2402
2652
  '400':
2403
2653
  $ref: '#/components/responses/BadRequest'
2404
2654
  '403':
@@ -2522,7 +2772,7 @@ paths:
2522
2772
  content:
2523
2773
  application/json:
2524
2774
  schema:
2525
- $ref: '#/components/schemas/Transaction'
2775
+ $ref: '#/components/schemas/TransactionDetail'
2526
2776
  examples:
2527
2777
  example-1:
2528
2778
  value:
@@ -2671,7 +2921,7 @@ paths:
2671
2921
  content:
2672
2922
  application/json:
2673
2923
  schema:
2674
- $ref: '#/components/schemas/Transaction'
2924
+ $ref: '#/components/schemas/TransactionDetail'
2675
2925
  '400':
2676
2926
  $ref: '#/components/responses/BadRequest'
2677
2927
  '403':
@@ -2722,7 +2972,7 @@ paths:
2722
2972
  content:
2723
2973
  application/json:
2724
2974
  schema:
2725
- $ref: '#/components/schemas/Transaction'
2975
+ $ref: '#/components/schemas/TransactionDetail'
2726
2976
  '400':
2727
2977
  $ref: '#/components/responses/BadRequest'
2728
2978
  '422':
@@ -2826,7 +3076,7 @@ paths:
2826
3076
  content:
2827
3077
  application/json:
2828
3078
  schema:
2829
- $ref: '#/components/schemas/Transaction'
3079
+ $ref: '#/components/schemas/TransactionDetail'
2830
3080
  '400':
2831
3081
  $ref: '#/components/responses/InvalidParameters'
2832
3082
  '403':
@@ -2873,7 +3123,7 @@ paths:
2873
3123
  content:
2874
3124
  application/json:
2875
3125
  schema:
2876
- $ref: '#/components/schemas/Transaction'
3126
+ $ref: '#/components/schemas/TransactionDetail'
2877
3127
  '403':
2878
3128
  $ref: '#/components/responses/Forbidden'
2879
3129
  '422':
@@ -2925,7 +3175,7 @@ paths:
2925
3175
 
2926
3176
  マネーを指定します。
2927
3177
  amount:
2928
- type: number
3178
+ type: integer
2929
3179
  minimum: 0
2930
3180
  title: 取引額
2931
3181
  description: |-
@@ -2947,6 +3197,8 @@ paths:
2947
3197
  ポケペイ外部取引作成時に指定され、取引と紐付けられるメタデータです。
2948
3198
 
2949
3199
  任意入力で、全てのkeyとvalueが文字列であるようなフラットな構造のJSONで指定します。
3200
+ example: |-
3201
+ {"key":"value"}
2950
3202
  products:
2951
3203
  type: array
2952
3204
  items:
@@ -3011,7 +3263,7 @@ paths:
3011
3263
  $ref: '#/components/responses/Forbidden'
3012
3264
  '422':
3013
3265
  $ref: '#/components/responses/UnprocessableEntity'
3014
- /external-transaction/{event_id}/refund:
3266
+ /external-transactions/{event_id}/refund:
3015
3267
  post:
3016
3268
  tags:
3017
3269
  - Event
@@ -3027,7 +3279,7 @@ paths:
3027
3279
  x-pokepay-allow-server-side: true
3028
3280
  parameters:
3029
3281
  - in: path
3030
- name: transaction_id
3282
+ name: event_id
3031
3283
  required: true
3032
3284
  schema:
3033
3285
  type: string
@@ -3103,7 +3355,7 @@ paths:
3103
3355
  type: array
3104
3356
  items:
3105
3357
  type: string
3106
- enum: [topup, payment, transfer, exchange]
3358
+ enum: [topup, payment, transfer, exchange, cashback, expire]
3107
3359
  transfer_types:
3108
3360
  type: array
3109
3361
  description: |-
@@ -3125,9 +3377,15 @@ paths:
3125
3377
 
3126
3378
  5. coupon
3127
3379
  クーポンによる値引き処理、またはそのキャンセル取引
3380
+
3381
+ 6. cashback
3382
+ 退会時の返金取引
3383
+
3384
+ 7. expire
3385
+ 退会時失効取引
3128
3386
  items:
3129
3387
  type: string
3130
- enum: [topup, payment, exchange, transfer, coupon, campaign]
3388
+ enum: [topup, payment, exchange, transfer, coupon, campaign, cashback, expire]
3131
3389
  description:
3132
3390
  type: string
3133
3391
  maxLength: 200
@@ -3768,7 +4026,8 @@ paths:
3768
4026
  フィルターとして使われ、指定された受取ユーザーでの取引のみ一覧に表示されます。
3769
4027
  type:
3770
4028
  type: string
3771
- title: '取引種別、チャージ=topup、支払い=payment、個人間送金=transfer'
4029
+ enum: [topup, payment, exchange, transfer, cashback, expire]
4030
+ title: '取引種別'
3772
4031
  description: |-
3773
4032
  取引の種類でフィルターします。
3774
4033
 
@@ -3782,6 +4041,10 @@ paths:
3782
4041
  他マネーへの流出(outflow)/他マネーからの流入(inflow)
3783
4042
  4. transfer
3784
4043
  個人間送金
4044
+ 5. cashback
4045
+ ウォレット退会時返金
4046
+ 6. expire
4047
+ ウォレット退会時失効
3785
4048
  is_modified:
3786
4049
  type: boolean
3787
4050
  title: 'キャンセル済みかどうか'
@@ -4110,3 +4373,409 @@ paths:
4110
4373
  $ref: '#/components/responses/NotFound'
4111
4374
  '422':
4112
4375
  $ref: '#/components/responses/UnprocessableEntity'
4376
+ /campaigns:
4377
+ post:
4378
+ tags:
4379
+ - Campaign
4380
+ summary: 'ポイント付与キャンペーンを作る'
4381
+ description: |
4382
+ ポイント付与キャンペーンを作成します。
4383
+ x-pokepay-operator-name: "CreateCampaign"
4384
+ x-pokepay-allow-server-side: true
4385
+ requestBody:
4386
+ required: true
4387
+ content:
4388
+ application/json:
4389
+ schema:
4390
+ required: ["name", "private_money_id", "starts_at", "ends_at","priority", "event"]
4391
+ properties:
4392
+ name:
4393
+ title: 'キャンペーン名'
4394
+ type: string
4395
+ maxLength: 256
4396
+ description: |-
4397
+ キャンペーン名です(必須項目)。
4398
+
4399
+ ポイント付与によってできるチャージ取引の説明文に転記されます。取引説明文はエンドユーザーからも確認できます。
4400
+ private_money_id:
4401
+ type: string
4402
+ format: uuid
4403
+ title: 'マネーID'
4404
+ description: |-
4405
+ キャンペーン対象のマネーのIDです(必須項目)。
4406
+ starts_at:
4407
+ type: string
4408
+ format: date-time
4409
+ title: 'キャンペーン開始日時'
4410
+ description: |-
4411
+ キャンペーン開始日時です(必須項目)。
4412
+ キャンペーン期間中のみポイントが付与されます。
4413
+ 開始日時よりも終了日時が前のときはcampaign_invalid_periodエラー(422)になります。
4414
+ ends_at:
4415
+ type: string
4416
+ format: date-time
4417
+ title: 'キャンペーン終了日時'
4418
+ description: |-
4419
+ キャンペーン終了日時です(必須項目)。
4420
+ キャンペーン期間中のみポイントが付与されます。
4421
+ 開始日時よりも終了日時が前のときはcampaign_invalid_periodエラー(422)になります。
4422
+ priority:
4423
+ type: integer
4424
+ title: 'キャンペーンの適用優先度'
4425
+ description: |-
4426
+ キャンペーンの適用優先度です。
4427
+
4428
+ 優先度が大きいものから順に適用判定されていきます。
4429
+ キャンペーン期間が重なっている同一の優先度のキャンペーンが存在するとcampaign_period_overlapsエラー(422)になります。
4430
+ event:
4431
+ type: string
4432
+ enum: [topup, payment, external-transaction]
4433
+ title: 'イベント種別'
4434
+ description: |-
4435
+ キャンペーンのトリガーとなるイベントの種類を指定します(必須項目)。
4436
+
4437
+ 以下のいずれかを指定できます。
4438
+
4439
+ 1. topup
4440
+ 店舗からエンドユーザーへの送金取引(チャージ)
4441
+ 2. payment
4442
+ エンドユーザーから店舗への送金取引(支払い)
4443
+ 3. external-transaction
4444
+ ポケペイ外の取引(現金決済など)
4445
+ bear_point_shop_id:
4446
+ type: string
4447
+ format: uuid
4448
+ title: 'ポイント負担先店舗ID'
4449
+ description: |-
4450
+ ポイントを負担する店舗のIDです。デフォルトではマネー発行体の本店が設定されます。
4451
+ description:
4452
+ type: string
4453
+ maxLength: 200
4454
+ title: 'キャンペーンの説明文'
4455
+ description: |-
4456
+ キャンペーンの内容を記載します。管理画面などでキャンペーンを管理するための説明文になります。
4457
+ status:
4458
+ type: string
4459
+ enum: [enabled, disabled]
4460
+ title: 'キャンペーン作成時の状態'
4461
+ description: |-
4462
+ キャンペーン作成時の状態を指定します。デフォルトではenabledです。
4463
+
4464
+ 以下のいずれかを指定できます。
4465
+
4466
+ 1. enabled
4467
+ 有効
4468
+ 2. disabled
4469
+ 無効
4470
+ point_expires_at:
4471
+ type: string
4472
+ format: date-time
4473
+ title: 'ポイント有効期限(絶対日時指定)'
4474
+ description: |-
4475
+ キャンペーンによって付与されるポイントの有効期限を絶対日時で指定します。
4476
+ 省略した場合はマネーに設定された有効期限と同じものがポイントの有効期限となります。
4477
+ point_expires_in_days:
4478
+ type: integer
4479
+ minimum: 1
4480
+ title: 'ポイント有効期限(相対日数指定)'
4481
+ description: |-
4482
+ キャンペーンによって付与されるポイントの有効期限を相対日数で指定します。
4483
+ 省略した場合はマネーに設定された有効期限と同じものがポイントの有効期限となります。
4484
+ is_exclusive:
4485
+ type: boolean
4486
+ title: 'キャンペーンの重複設定'
4487
+ description: |-
4488
+ キャンペーンの重ね掛けを行うかどうかのフラグです。
4489
+
4490
+ これにtrueを指定すると他のキャンペーンと同時適用されません。デフォルト値はtrueです。
4491
+ falseを指定すると次の優先度の重ね掛け可能なキャンペーンの適用判定に進みます。
4492
+ subject:
4493
+ type: string
4494
+ enum: [money, all]
4495
+ title: 'ポイント付与の対象金額の種別'
4496
+ description: |-
4497
+ ポイント付与額を計算する対象となる金額の種類を指定します。デフォルト値はallです。
4498
+ eventとしてexternal-transactionを指定した場合はポイントとマネーの区別がないためsubjectの指定に関わらず常にallとなります。
4499
+
4500
+ 以下のいずれかを指定できます。
4501
+
4502
+ 1. money
4503
+ moneyを指定すると決済額の中で「マネー」を使って支払った額を対象にします
4504
+
4505
+ 2. all
4506
+ all を指定すると決済額全体を対象にします (「ポイント」での取引額を含む)
4507
+ 注意: event を topup にしたときはポイントの付与に対しても適用されます
4508
+ amount_based_point_rules:
4509
+ type: array
4510
+ items:
4511
+ type: object
4512
+ properties:
4513
+ point_amount:
4514
+ type: number
4515
+ format: decimal
4516
+ minimum: 0
4517
+ title: '付与ポイント量'
4518
+ description: |-
4519
+ キャンペーンにより付与するポイント量。(必須項目)
4520
+
4521
+ point_amount_unitにより指定される単位が絶対額のときは小数点以下が切り捨てられ整数として扱われます。
4522
+ パーセント指定の時は小数を許容し、割合計算後に小数点以下が切り捨てられます。
4523
+ いずれの場合も実際に付与されるポイントは整数のみです。
4524
+ point_amount_unit:
4525
+ type: string
4526
+ enum: [percent, absolute]
4527
+ title: '付与ポイント量の単位'
4528
+ description: |-
4529
+ キャンペーンにより付与するポイント量の単位を指定します。(必須項目)
4530
+
4531
+ 以下のいずれかを指定できます。
4532
+
4533
+ 1. percent
4534
+ 付与するポイント量が元取引の取引額に応じて割合で変化するときに指定します。
4535
+
4536
+ 2. absolute
4537
+ 付与するポイント量が元取引の取引額に依存しない絶対額であるときに指定します。
4538
+ subject_more_than:
4539
+ type: integer
4540
+ minimum: 0
4541
+ title: '対象金額の下限値 (x <)'
4542
+ description: |-
4543
+ 対象金額の下限値 (x <) を指定します (ただし、指定された金額は含まない)。
4544
+ subject_more_than_or_equal といずれかのみ指定できます。
4545
+ subject_more_than_or_equal:
4546
+ type: integer
4547
+ minimum: 0
4548
+ title: '対象金額の下限値 (x <=)'
4549
+ description: |-
4550
+ 対象金額の下限値 (x <=) を指定します。
4551
+ subject_more_than といずれかのみ指定できます。
4552
+ subject_less_than:
4553
+ type: integer
4554
+ minimum: 0
4555
+ title: '対象金額の上限値 (< x)'
4556
+ description: |-
4557
+ 対象金額の上限値 (< x) を指定します (ただし、指定された金額は含まない)。
4558
+ subject_less_than_or_equal といずれかのみ指定できます。
4559
+ subject_less_than_or_equal:
4560
+ type: integer
4561
+ minimum: 0
4562
+ title: '対象金額の上限値 (<= x)'
4563
+ description: |-
4564
+ 対象金額の上限値 (<= x) を指定します。
4565
+ subject_less_than といずれかのみ指定できます。
4566
+ example: |-
4567
+ {
4568
+ "point_amount": 5,
4569
+ "point_amount_unit": "percent",
4570
+ "subject_more_than_or_equal": 1000,
4571
+ "subject_less_than": 5000
4572
+ }
4573
+
4574
+ title: '取引金額ベースのポイント付与ルール'
4575
+ description: |-
4576
+ 金額をベースとしてポイント付与を行うルールを指定します。
4577
+ amount_based_point_rules と product_based_point_rules はどちらか一方しか指定できません。
4578
+ 各ルールは一つのみ適用され、条件に重複があった場合は先に記載されたものが優先されます。
4579
+
4580
+ 例:
4581
+ ```javascript
4582
+ [
4583
+ // 1000円以上、5000円未満の決済には 5%
4584
+ {
4585
+ "point_amount": 5,
4586
+ "point_amount_unit": "percent",
4587
+ "subject_more_than_or_equal": 1000,
4588
+ "subject_less_than": 5000
4589
+ },
4590
+ // 5000円以上の決済には 10%
4591
+ {
4592
+ "point_amount": 10,
4593
+ "point_amount_unit": "percent",
4594
+ "subject_more_than_or_equal": 5000
4595
+ },
4596
+ ]
4597
+ ```
4598
+
4599
+ product_based_point_rules:
4600
+ type: array
4601
+ items:
4602
+ type: object
4603
+ properties:
4604
+ point_amount:
4605
+ type: number
4606
+ format: decimal
4607
+ minimum: 0
4608
+ title: '付与ポイント量'
4609
+ description: |-
4610
+ キャンペーンにより付与するポイント量。単位は point_amount_unit で指定します。(必須項目)
4611
+
4612
+ point_amount_unitにより指定される単位が絶対額のときは小数点以下が切り捨てられ整数として扱われます。
4613
+ パーセント指定の時は小数を許容し、割合計算後に小数点以下が切り捨てられます。
4614
+ いずれの場合も実際に付与されるポイントは整数のみです。
4615
+ point_amount_unit:
4616
+ type: string
4617
+ enum: [percent, absolute]
4618
+ title: '付与ポイント量の単位'
4619
+ description: |-
4620
+ キャンペーンにより付与するポイント量の単位を指定します。(必須項目)
4621
+
4622
+ 以下のいずれかを指定できます。
4623
+
4624
+ 1. percent
4625
+ 付与するポイント量が元取引の取引額に応じて割合で変化するときに指定します。
4626
+
4627
+ 2. absolute
4628
+ 付与するポイント量が元取引の取引額に依存しない絶対額であるときに指定します。
4629
+ product_code:
4630
+ type: string
4631
+ maxLength: 64
4632
+ title: '対象の製品コード'
4633
+ description: |-
4634
+ 対象の製品コード (JANコードやISBNコードなど) を指定します。(必須項目)
4635
+
4636
+ SQLのLIKE文のようにワイルドカードを使った製品コードのパターンを指定することもできます (例: 978-% でISBNコード)
4637
+ items:
4638
+ type: string
4639
+ required_count:
4640
+ type: integer
4641
+ minimum: 1
4642
+ title: '必要購入個数'
4643
+ description: |-
4644
+ キャンペーン適用のための対象商品の必要購入個数を指定します (例:商品Aを2個以上購入するとn%ポイント)。
4645
+ デフォルト値は1です。
4646
+ is_multiply_by_count:
4647
+ type: boolean
4648
+ title: '複数個購入したときにポイント付与額に個数を掛けるかどうか'
4649
+ description: |-
4650
+ キャンペーン対象の商品を複数個購入したときに、個数に応じてポイント付与額を増やすかどうかのフラグです。
4651
+ デフォルト値は false です。
4652
+ starts_at:
4653
+ type: string
4654
+ format: date-time
4655
+ title: '商品個別のキャンペーン開始日時'
4656
+ description: |-
4657
+ このルールを適用する開始日時を指定します。
4658
+ デフォルトではキャンペーン全体の開始日時が指定されます。
4659
+ 商品個別にキャンペーン期間指定をする場合は、キャンペーン全体の期間指定の範囲内に入っている必要があります。
4660
+ ends_at:
4661
+ type: string
4662
+ format: date-time
4663
+ title: '商品個別のキャンペーン終了日時'
4664
+ description: |-
4665
+ このルールを適用する終了日時を指定します。
4666
+ デフォルトではキャンペーン全体の終了日時が指定されます。
4667
+ 商品個別にキャンペーン期間指定をする場合は、キャンペーン全体の期間指定の範囲内に入っている必要があります。
4668
+ example: |-
4669
+ {
4670
+ "point_amount": 5,
4671
+ "point_amount_unit": "percent",
4672
+ "product_code": "4912345678904",
4673
+ "is_multiply_by_count": true,
4674
+ "required_count": 2
4675
+ }
4676
+
4677
+ title: '商品情報ベースのポイント付与ルール'
4678
+ description: |-
4679
+ 商品情報をベースとしてポイント付与を行うルールを指定します。
4680
+ ルールは商品ごとに設定可能で、ルールの配列として指定します。
4681
+ amount_based_point_rules と product_based_point_rules はどちらか一方しか指定できません。
4682
+ event が payment か external-transaction の時のみ有効です。
4683
+ 各ルールの順序は問わず、適用可能なものは全て適用されます。
4684
+ 一つの決済の中で複数の商品がキャンペーン適用可能な場合はそれぞれの商品についてのルールが適用され、ポイント付与額はその合算になります。
4685
+
4686
+ 例:
4687
+ ```javascript
4688
+ [
4689
+ // 対象商品の購入額から5%ポイント付与。複数購入時は単価の5%が付与される。
4690
+ {
4691
+ "point_amount": 5,
4692
+ "point_amount_unit": "percent",
4693
+ "product_code": "4912345678904",
4694
+ },
4695
+ // 対象商品の購入額から5%ポイント付与。複数購入時は購入総額の5%が付与される。
4696
+ {
4697
+ "point_amount": 5,
4698
+ "point_amount_unit": "percent",
4699
+ "product_code": "4912345678904",
4700
+ "is_multiply_by_count": true,
4701
+ },
4702
+ // 対象商品を2つ以上購入したら500ポイント付与(固定額付与)
4703
+ {
4704
+ "point_amount": 500,
4705
+ "point_amount_unit": absolute",
4706
+ "product_code": "4912345678904",
4707
+ "required_count": 2
4708
+ },
4709
+ // 書籍は10%ポイント付与
4710
+ // ※ISBNの形式はレジがポケペイに送信する形式に準じます
4711
+ {
4712
+ "point_amount": 10,
4713
+ "point_amount_unit": "percent",
4714
+ "product_code": "978-%",
4715
+ },
4716
+ // 一部の出版社の書籍は10%ポイント付与
4717
+ {
4718
+ "point_amount": 10,
4719
+ "point_amount_unit": "percent",
4720
+ "product_code": "978-4-01-%", // 旺文社
4721
+ }
4722
+ ]
4723
+ ```
4724
+
4725
+ applicable_days_of_week:
4726
+ type: array
4727
+ items:
4728
+ type: integer
4729
+ minimun: 0
4730
+ maximum: 6
4731
+ title: 'キャンペーンを適用する曜日 (複数指定)'
4732
+ describe: |-
4733
+ キャンペーンを適用する曜日を指定します (複数指定)。
4734
+ 曜日は整数で表します。月曜を 0 とし、日曜を 6 とします。
4735
+ 指定しなかった場合は全日を対象にします (曜日による適用条件なし)
4736
+ applicable_time_ranges:
4737
+ type: array
4738
+ items:
4739
+ type: object
4740
+ properties:
4741
+ from:
4742
+ type: string
4743
+ description: |-
4744
+ 時間帯の開始時刻 (HH:mmの形式)
4745
+ to:
4746
+ type: string
4747
+ description: |-
4748
+ 時間帯の終了時刻 (HH:mmの形式)
4749
+ example: |-
4750
+ {
4751
+ "from": "12:00",
4752
+ "to": "23:59"
4753
+ }
4754
+
4755
+ title: 'キャンペーンを適用する時間帯 (複数指定)'
4756
+ describe: |-
4757
+ キャンペーンを適用する時間帯を指定します (複数指定可)。
4758
+ 時間帯はfromとtoからなるオブジェクトで指定します。
4759
+ fromとtoは両方必要です。
4760
+ applicable_shop_ids:
4761
+ type: array
4762
+ items:
4763
+ type: string
4764
+ format: uuid
4765
+ title: 'キャンペーン適用対象となる店舗IDのリスト'
4766
+ describe: |-
4767
+ キャンペーンを適用する店舗IDを指定します (複数指定)。
4768
+ 指定しなかった場合は全店舗が対象になります。
4769
+ responses:
4770
+ '200':
4771
+ description: OK
4772
+ content:
4773
+ application/json:
4774
+ schema:
4775
+ $ref: '#/components/schemas/Campaign'
4776
+ '400':
4777
+ $ref: '#/components/responses/BadRequest'
4778
+ '403':
4779
+ $ref: '#/components/responses/Forbidden'
4780
+ '422':
4781
+ $ref: '#/components/responses/UnprocessableEntity'