pokepay_partner_ruby_sdk 0.1.15.1 → 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.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +1 -1
  4. data/docs/index.md +1802 -198
  5. data/lib/pokepay_partner_ruby_sdk/client.rb +8 -0
  6. data/lib/pokepay_partner_ruby_sdk/request/create_campaign.rb +20 -0
  7. data/lib/pokepay_partner_ruby_sdk/request/create_cpm_transaction.rb +2 -2
  8. data/lib/pokepay_partner_ruby_sdk/request/create_exchange_transaction.rb +2 -2
  9. data/lib/pokepay_partner_ruby_sdk/request/create_external_transaction.rb +18 -0
  10. data/lib/pokepay_partner_ruby_sdk/request/create_payment_transaction.rb +2 -2
  11. data/lib/pokepay_partner_ruby_sdk/request/create_topup_transaction.rb +2 -2
  12. data/lib/pokepay_partner_ruby_sdk/request/create_topup_transaction_with_check.rb +2 -2
  13. data/lib/pokepay_partner_ruby_sdk/request/create_transaction.rb +2 -2
  14. data/lib/pokepay_partner_ruby_sdk/request/create_transfer_transaction.rb +2 -2
  15. data/lib/pokepay_partner_ruby_sdk/request/create_user_account.rb +15 -0
  16. data/lib/pokepay_partner_ruby_sdk/request/delete_account.rb +15 -0
  17. data/lib/pokepay_partner_ruby_sdk/request/get_campaign.rb +15 -0
  18. data/lib/pokepay_partner_ruby_sdk/request/get_transaction.rb +2 -2
  19. data/lib/pokepay_partner_ruby_sdk/request/list_campaigns.rb +15 -0
  20. data/lib/pokepay_partner_ruby_sdk/request/list_transactions_v2.rb +15 -0
  21. data/lib/pokepay_partner_ruby_sdk/request/list_user_accounts.rb +2 -2
  22. data/lib/pokepay_partner_ruby_sdk/request/refund_external_transaction.rb +15 -0
  23. data/lib/pokepay_partner_ruby_sdk/request/refund_transaction.rb +2 -2
  24. data/lib/pokepay_partner_ruby_sdk/request/update_campaign.rb +15 -0
  25. data/lib/pokepay_partner_ruby_sdk/request/update_customer_account.rb +15 -0
  26. data/lib/pokepay_partner_ruby_sdk/response/account.rb +3 -0
  27. data/lib/pokepay_partner_ruby_sdk/response/account_deleted.rb +11 -0
  28. data/lib/pokepay_partner_ruby_sdk/response/account_detail.rb +5 -0
  29. data/lib/pokepay_partner_ruby_sdk/response/account_status.rb +11 -0
  30. data/lib/pokepay_partner_ruby_sdk/response/account_with_user.rb +3 -0
  31. data/lib/pokepay_partner_ruby_sdk/response/account_without_private_money_detail.rb +3 -0
  32. data/lib/pokepay_partner_ruby_sdk/response/campaign.rb +44 -0
  33. data/lib/pokepay_partner_ruby_sdk/response/paginated_campaigns.rb +16 -0
  34. data/lib/pokepay_partner_ruby_sdk/response/paginated_transaction_v2.rb +19 -0
  35. data/lib/pokepay_partner_ruby_sdk/response/private_money.rb +2 -0
  36. data/lib/pokepay_partner_ruby_sdk/response/transaction_detail.rb +39 -0
  37. data/lib/pokepay_partner_ruby_sdk/version.rb +1 -1
  38. data/lib/pokepay_partner_ruby_sdk.rb +16 -0
  39. data/partner.yaml +1866 -76
  40. metadata +18 -2
data/partner.yaml CHANGED
@@ -36,6 +36,8 @@ tags:
36
36
  - name: Account
37
37
  - name: Private Money
38
38
  - name: Bulk
39
+ - name: Event
40
+ - name: Campaign
39
41
 
40
42
  components:
41
43
  schemas:
@@ -94,6 +96,11 @@ components:
94
96
  type: array
95
97
  items:
96
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: 'ウォレット状態'
97
104
  Account:
98
105
  x-pokepay-schema-type: "response"
99
106
  properties:
@@ -107,6 +114,8 @@ components:
107
114
  is_suspended:
108
115
  type: boolean
109
116
  title: 'ウォレットが凍結されているかどうか'
117
+ status:
118
+ $ref: '#/components/schemas/AccountStatus'
110
119
  private_money:
111
120
  $ref: '#/components/schemas/PrivateMoney'
112
121
  title: '設定マネー情報'
@@ -120,6 +129,8 @@ components:
120
129
  type: string
121
130
  is_suspended:
122
131
  type: boolean
132
+ status:
133
+ $ref: '#/components/schemas/AccountStatus'
123
134
  private_money:
124
135
  $ref: '#/components/schemas/PrivateMoney'
125
136
  user:
@@ -134,6 +145,8 @@ components:
134
145
  type: string
135
146
  is_suspended:
136
147
  type: boolean
148
+ status:
149
+ $ref: '#/components/schemas/AccountStatus'
137
150
  balance:
138
151
  type: number
139
152
  format: decimal
@@ -147,6 +160,10 @@ components:
147
160
  $ref: '#/components/schemas/PrivateMoney'
148
161
  user:
149
162
  $ref: '#/components/schemas/User'
163
+ external_id:
164
+ type: string
165
+ nullable: true
166
+ maxLength: 50
150
167
  ShopAccount:
151
168
  x-pokepay-schema-type: "response"
152
169
  properties:
@@ -166,6 +183,9 @@ components:
166
183
  private_money:
167
184
  $ref: '#/components/schemas/PrivateMoney'
168
185
  title: '設定マネー情報'
186
+ AccountDeleted:
187
+ x-pokepay-schema-type: "response"
188
+ properties: {}
169
189
  AccountBalance:
170
190
  x-pokepay-schema-type: "response"
171
191
  properties:
@@ -462,6 +482,9 @@ components:
462
482
  type: boolean
463
483
  nullable: true
464
484
  title: '加盟店によるチャージが有効かどうか'
485
+ display_money_and_point:
486
+ type: string
487
+ enum: [both, money-only, point-only]
465
488
  Organization:
466
489
  x-pokepay-schema-type: "response"
467
490
  properties:
@@ -514,6 +537,51 @@ components:
514
537
  description:
515
538
  type: string
516
539
  title: '取引説明文'
540
+ TransactionDetail:
541
+ x-pokepay-schema-type: "response"
542
+ properties:
543
+ id:
544
+ type: string
545
+ format: uuid
546
+ title: '取引ID'
547
+ type:
548
+ type: string
549
+ title: '取引種別 (チャージ=topup, 支払い=payment)'
550
+ is_modified:
551
+ type: boolean
552
+ title: '返金された取引かどうか'
553
+ sender:
554
+ $ref: '#/components/schemas/User'
555
+ title: '送金者情報'
556
+ sender_account:
557
+ $ref: '#/components/schemas/Account'
558
+ title: '送金ウォレット情報'
559
+ receiver:
560
+ $ref: '#/components/schemas/User'
561
+ title: '受取者情報'
562
+ receiver_account:
563
+ $ref: '#/components/schemas/Account'
564
+ title: '受取ウォレット情報'
565
+ amount:
566
+ type: number
567
+ title: '決済総額 (マネー額 + ポイント額)'
568
+ money_amount:
569
+ type: number
570
+ title: '決済マネー額'
571
+ point_amount:
572
+ type: number
573
+ title: '決済ポイント額'
574
+ done_at:
575
+ type: string
576
+ format: date-time
577
+ title: '取引日時'
578
+ description:
579
+ type: string
580
+ title: '取引説明文'
581
+ transfers:
582
+ type: array
583
+ items:
584
+ $ref: '#/components/schemas/Transfer'
517
585
  ShopWithMetadata:
518
586
  x-pokepay-schema-type: "response"
519
587
  properties:
@@ -624,7 +692,7 @@ components:
624
692
  format: date-time
625
693
  type:
626
694
  type: string
627
- enum: [topup, payment, transfer, exchange]
695
+ enum: [topup, payment, transfer, exchange, cashback, expire]
628
696
  is_modified:
629
697
  type: boolean
630
698
  BulkTransaction:
@@ -678,6 +746,8 @@ components:
678
746
  type: string
679
747
  is_suspended:
680
748
  type: boolean
749
+ status:
750
+ $ref: '#/components/schemas/AccountStatus'
681
751
  private_money_id:
682
752
  type: string
683
753
  format: uuid
@@ -710,7 +780,7 @@ components:
710
780
  format: date-time
711
781
  type:
712
782
  type: string
713
- enum: [topup, payment, refund-topup, refund-payment, transfer, exchange-inflow, exchange-outflow, campaign-topup, refund-campaign, use-coupon, refund-coupon]
783
+ enum: [topup, payment, refund-topup, refund-payment, transfer, exchange-inflow, exchange-outflow, campaign-topup, refund-campaign, use-coupon, refund-coupon, cashback, expire]
714
784
  description:
715
785
  type: string
716
786
  transaction_id:
@@ -821,6 +891,33 @@ components:
821
891
  minimum: 0
822
892
  pagination:
823
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先頭
824
921
  PaginatedTransfers:
825
922
  x-pokepay-schema-type: "response"
826
923
  properties:
@@ -917,7 +1014,83 @@ components:
917
1014
  minimum: 0
918
1015
  pagination:
919
1016
  $ref: '#/components/schemas/Pagination'
920
-
1017
+ Campaign:
1018
+ x-pokepay-schema-type: "response"
1019
+ properties:
1020
+ id:
1021
+ type: string
1022
+ format: uuid
1023
+ title: 'キャンペーンID'
1024
+ name:
1025
+ type: string
1026
+ maxLength: 256
1027
+ title: 'キャペーン名'
1028
+ applicable_shops:
1029
+ type: array
1030
+ title: 'キャンペーン適用対象の店舗リスト'
1031
+ nullable: true
1032
+ items:
1033
+ $ref: '#/components/schemas/User'
1034
+ is_exclusive:
1035
+ type: boolean
1036
+ title: 'キャンペーンの重複を許すかどうかのフラグ'
1037
+ starts_at:
1038
+ type: string
1039
+ format: date-time
1040
+ title: 'キャンペーン開始日時'
1041
+ ends_at:
1042
+ type: string
1043
+ format: date-time
1044
+ title: 'キャンペーン終了日時'
1045
+ point_expires_at:
1046
+ type: string
1047
+ format: date-time
1048
+ title: 'キャンペーンによって付与されるポイントの失効日時'
1049
+ nullable: true
1050
+ point_expires_in_days:
1051
+ type: integer
1052
+ minimum: 1
1053
+ title: 'キャンペーンによって付与されるポイントの有効期限(相対指定、単位は日)'
1054
+ nullable: true
1055
+ priority:
1056
+ type: integer
1057
+ title: 'キャンペーンの優先順位'
1058
+ description:
1059
+ type: string
1060
+ maxLength: 200
1061
+ title: 'キャンペーン説明文'
1062
+ bear_point_shop:
1063
+ title: 'ポイントを負担する店舗'
1064
+ $ref: '#/components/schemas/User'
1065
+ private_money:
1066
+ title: 'キャンペーンを適用するマネー'
1067
+ $ref: '#/components/schemas/PrivateMoney'
1068
+ dest_private_money:
1069
+ title: 'ポイントを付与するマネー'
1070
+ $ref: '#/components/schemas/PrivateMoney'
1071
+ point_calculation_rule:
1072
+ type: string
1073
+ title: 'ポイント計算ルール (banklisp表記)'
1074
+ point_calculation_rule_object:
1075
+ type: string
1076
+ format: json
1077
+ title: 'ポイント計算ルール (JSON文字列による表記)'
1078
+ status:
1079
+ type: string
1080
+ enum: [enabled, disabled]
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'
921
1094
  BadRequest:
922
1095
  x-pokepay-schema-type: "response"
923
1096
  oneOf:
@@ -1128,6 +1301,22 @@ paths:
1128
1301
  ユーザーIDです。
1129
1302
 
1130
1303
  指定したユーザーIDのウォレット一覧を取得します。パートナーキーと紐づく組織が発行しているマネーのウォレットのみが表示されます。
1304
+ requestBody:
1305
+ required: true
1306
+ content:
1307
+ application/json:
1308
+ schema:
1309
+ properties:
1310
+ page:
1311
+ type: integer
1312
+ minimum: 1
1313
+ title: 'ページ番号'
1314
+ description: 取得したいページ番号です。デフォルト値は1です。
1315
+ per_page:
1316
+ type: integer
1317
+ minimum: 1
1318
+ title: '1ページ分の取引数'
1319
+ description: 1ページ当たりのウォレット数です。デフォルト値は50です。
1131
1320
  responses:
1132
1321
  '200':
1133
1322
  description: OK
@@ -1141,6 +1330,54 @@ paths:
1141
1330
  $ref: '#/components/responses/Forbidden'
1142
1331
  '404':
1143
1332
  $ref: '#/components/responses/NotFound'
1333
+ post:
1334
+ tags:
1335
+ - Account
1336
+ summary: 'エンドユーザーのウォレットを作成する'
1337
+ x-pokepay-operator-name: "CreateUserAccount"
1338
+ x-pokepay-allow-server-side: true
1339
+ parameters:
1340
+ - in: path
1341
+ name: user_id
1342
+ required: true
1343
+ schema:
1344
+ type: string
1345
+ format: uuid
1346
+ title: 'ユーザーID'
1347
+ description: |-
1348
+ ユーザーIDです。
1349
+ requestBody:
1350
+ required: true
1351
+ content:
1352
+ application/json:
1353
+ schema:
1354
+ required: ["private_money_id"]
1355
+ properties:
1356
+ private_money_id:
1357
+ title: 'マネーID'
1358
+ description: |-
1359
+ マネーIDです。
1360
+
1361
+ 作成するウォレットのマネーを指定します。このパラメータは必須です。
1362
+ type: string
1363
+ format: uuid
1364
+ name:
1365
+ title: 'ウォレット名'
1366
+ type: string
1367
+ maxLength: 256
1368
+ external_id:
1369
+ title: '外部ID'
1370
+ type: string
1371
+ maxLength: 50
1372
+ responses:
1373
+ '200':
1374
+ description: OK
1375
+ content:
1376
+ application/json:
1377
+ schema:
1378
+ $ref: '#/components/schemas/AccountDetail'
1379
+ '422':
1380
+ $ref: '#/components/responses/UnprocessableEntity'
1144
1381
  /accounts/{account_id}:
1145
1382
  get:
1146
1383
  tags:
@@ -1203,6 +1440,15 @@ paths:
1203
1440
  type: boolean
1204
1441
  title: 'ウォレットが凍結されているかどうか'
1205
1442
  description: ウォレットの凍結状態です。真にするとウォレットが凍結され、そのウォレットでは新規取引ができなくなります。偽にすると凍結解除されます。
1443
+ status:
1444
+ type: string
1445
+ enum: [active, suspended, pre-closed]
1446
+ title: 'ウォレット状態'
1447
+ description: ウォレットの状態です。
1448
+ can_transfer_topup:
1449
+ type: boolean
1450
+ title: 'チャージ可能かどうか'
1451
+ description: 店舗ユーザーがエンドユーザーにチャージ可能かどうかです。真にするとチャージ可能となり、偽にするとチャージ不可能となります。
1206
1452
  responses:
1207
1453
  '200':
1208
1454
  description: OK
@@ -1216,6 +1462,51 @@ paths:
1216
1462
  $ref: '#/components/responses/Forbidden'
1217
1463
  '404':
1218
1464
  $ref: '#/components/responses/NotFound'
1465
+ delete:
1466
+ tags:
1467
+ - Customer
1468
+ summary: 'ウォレットを退会する'
1469
+ description: ウォレットを退会します。一度ウォレットを退会した後は、そのウォレットを再び利用可能な状態に戻すことは出来ません。
1470
+ x-pokepay-operator-name: "DeleteAccount"
1471
+ x-pokepay-allow-server-side: true
1472
+ parameters:
1473
+ - in: path
1474
+ name: account_id
1475
+ required: true
1476
+ schema:
1477
+ type: string
1478
+ format: uuid
1479
+ title: 'ウォレットID'
1480
+ description: |-
1481
+ ウォレットIDです。
1482
+
1483
+ 指定したウォレットIDのウォレットを退会します。
1484
+ requestBody:
1485
+ required: true
1486
+ content:
1487
+ application/json:
1488
+ schema:
1489
+ properties:
1490
+ cashback:
1491
+ type: boolean
1492
+ title: '返金有無'
1493
+ description: 退会時の返金有無です。エンドユーザに返金を行う場合、真を指定して下さい。現在のマネー残高を全て現金で返金したものとして記録されます。
1494
+ responses:
1495
+ '200':
1496
+ description: OK
1497
+ content:
1498
+ application/json:
1499
+ schema:
1500
+ $ref: '#/components/schemas/AccountDeleted'
1501
+ '400':
1502
+ $ref: '#/components/responses/BadRequest'
1503
+ '403':
1504
+ $ref: '#/components/responses/Forbidden'
1505
+ '404':
1506
+ $ref: '#/components/responses/NotFound'
1507
+ '422':
1508
+ $ref: '#/components/responses/UnprocessableEntity'
1509
+
1219
1510
  /accounts/{account_id}/balances:
1220
1511
  get:
1221
1512
  tags:
@@ -1344,40 +1635,96 @@ paths:
1344
1635
  $ref: '#/components/responses/Forbidden'
1345
1636
  '404':
1346
1637
  $ref: '#/components/responses/NotFound'
1347
- /accounts/customers:
1348
- get:
1638
+ /accounts/{account_id}/customers:
1639
+ patch:
1349
1640
  tags:
1350
1641
  - Customer
1351
- summary: 'エンドユーザーのウォレット一覧を表示する'
1352
- description: マネーを指定してエンドユーザーのウォレット一覧を取得します。
1353
- x-pokepay-operator-name: "GetCustomerAccounts"
1642
+ summary: 'ウォレット情報を更新する'
1643
+ description: ウォレットの状態を更新します。
1644
+ x-pokepay-operator-name: "UpdateCustomerAccount"
1354
1645
  x-pokepay-allow-server-side: true
1646
+ parameters:
1647
+ - in: path
1648
+ name: account_id
1649
+ required: true
1650
+ schema:
1651
+ type: string
1652
+ format: uuid
1653
+ title: 'ウォレットID'
1654
+ description: |-
1655
+ ウォレットIDです。
1656
+
1657
+ 指定したウォレットIDのウォレットの状態を更新します。
1355
1658
  requestBody:
1356
1659
  required: true
1357
1660
  content:
1358
1661
  application/json:
1359
1662
  schema:
1360
- required: ["private_money_id"]
1361
1663
  properties:
1362
- private_money_id:
1363
- title: 'マネーID'
1364
- description: |-
1365
- マネーIDです。
1366
-
1367
- 一覧するウォレットのマネーを指定します。このパラメータは必須です。
1664
+ status:
1368
1665
  type: string
1369
- format: uuid
1370
- page:
1371
- type: integer
1372
- minimum: 1
1373
- title: 'ページ番号'
1374
- description: 取得したいページ番号です。デフォルト値は1です。
1375
- per_page:
1376
- type: integer
1377
- minimum: 1
1378
- title: '1ページ分のウォレット数'
1379
- description: 1ページ分のウォレット数です。デフォルト値は30です。
1380
- created_at_from:
1666
+ enum: [active, suspended, pre-closed]
1667
+ title: 'ウォレット状態'
1668
+ description: ウォレットの状態です。
1669
+ account_name:
1670
+ title: 'アカウント名'
1671
+ type: string
1672
+ maxLength: 256
1673
+ description: 変更するウォレット名です。
1674
+ external_id:
1675
+ title: '外部ID'
1676
+ type: string
1677
+ maxLength: 50
1678
+ description: 変更する外部IDです。
1679
+ responses:
1680
+ '200':
1681
+ description: OK
1682
+ content:
1683
+ application/json:
1684
+ schema:
1685
+ $ref: '#/components/schemas/AccountWithUser'
1686
+ '400':
1687
+ $ref: '#/components/responses/BadRequest'
1688
+ '403':
1689
+ $ref: '#/components/responses/Forbidden'
1690
+ '404':
1691
+ $ref: '#/components/responses/NotFound'
1692
+ '422':
1693
+ $ref: '#/components/responses/UnprocessableEntity'
1694
+ /accounts/customers:
1695
+ get:
1696
+ tags:
1697
+ - Customer
1698
+ summary: 'エンドユーザーのウォレット一覧を表示する'
1699
+ description: マネーを指定してエンドユーザーのウォレット一覧を取得します。
1700
+ x-pokepay-operator-name: "GetCustomerAccounts"
1701
+ x-pokepay-allow-server-side: true
1702
+ requestBody:
1703
+ required: true
1704
+ content:
1705
+ application/json:
1706
+ schema:
1707
+ required: ["private_money_id"]
1708
+ properties:
1709
+ private_money_id:
1710
+ title: 'マネーID'
1711
+ description: |-
1712
+ マネーIDです。
1713
+
1714
+ 一覧するウォレットのマネーを指定します。このパラメータは必須です。
1715
+ type: string
1716
+ format: uuid
1717
+ page:
1718
+ type: integer
1719
+ minimum: 1
1720
+ title: 'ページ番号'
1721
+ description: 取得したいページ番号です。デフォルト値は1です。
1722
+ per_page:
1723
+ type: integer
1724
+ minimum: 1
1725
+ title: '1ページ分のウォレット数'
1726
+ description: 1ページ分のウォレット数です。デフォルト値は30です。
1727
+ created_at_from:
1381
1728
  type: string
1382
1729
  format: date-time
1383
1730
  title: 'ウォレット作成日によるフィルター(開始時点)'
@@ -1391,6 +1738,11 @@ paths:
1391
1738
  type: boolean
1392
1739
  title: 'ウォレットが凍結状態かどうかでフィルターする'
1393
1740
  description: このパラメータが指定されている場合、ウォレットの凍結状態で結果がフィルターされます。デフォルトでは未指定です。
1741
+ status:
1742
+ type: string
1743
+ enum: [active, suspended, pre-closed]
1744
+ title: 'ウォレット状態'
1745
+ description: このパラメータが指定されている場合、ウォレットの状態で結果がフィルターされます。デフォルトでは未指定です。
1394
1746
  external_id:
1395
1747
  type: string
1396
1748
  maxLength: 50
@@ -1742,6 +2094,7 @@ paths:
1742
2094
  - Check
1743
2095
  summary: 'チャージQRコードの発行'
1744
2096
  x-pokepay-operator-name: "CreateCheck"
2097
+ x-pokepay-allow-server-side: true
1745
2098
  requestBody:
1746
2099
  required: true
1747
2100
  content:
@@ -1965,13 +2318,19 @@ paths:
1965
2318
  エンドユーザーから店舗への送金取引(支払い)
1966
2319
 
1967
2320
  3. exchange-outflow
1968
-   他マネーへの流出
2321
+ 他マネーへの流出
1969
2322
 
1970
2323
  4. exchange-inflow
1971
2324
  他マネーからの流入
2325
+
2326
+ 5. cashback
2327
+ 退会時返金取引
2328
+
2329
+ 6. expire
2330
+ 退会時失効取引
1972
2331
  items:
1973
2332
  type: string
1974
- enum: [topup, payment, exchange_outflow, exchange_inflow]
2333
+ enum: [topup, payment, exchange_outflow, exchange_inflow, cashback, expire]
1975
2334
  description:
1976
2335
  type: string
1977
2336
  maxLength: 200
@@ -2039,13 +2398,181 @@ paths:
2039
2398
  content:
2040
2399
  application/json:
2041
2400
  schema:
2042
- $ref: '#/components/schemas/Transaction'
2401
+ $ref: '#/components/schemas/TransactionDetail'
2043
2402
  '400':
2044
2403
  $ref: '#/components/responses/BadRequest'
2045
2404
  '403':
2046
2405
  $ref: '#/components/responses/Forbidden'
2047
2406
  '422':
2048
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'
2049
2576
  /transactions/topup:
2050
2577
  post:
2051
2578
  tags:
@@ -2094,21 +2621,23 @@ paths:
2094
2621
 
2095
2622
  ポイント支払い時に実際お金を負担する店舗を指定します。
2096
2623
  money_amount:
2097
- type: number
2624
+ type: integer
2098
2625
  minimum: 0
2099
2626
  title: 'マネー額'
2100
2627
  description: |-
2101
2628
  マネー額です。
2102
2629
 
2103
2630
  送金するマネー額を指定します。
2631
+ デフォルト値は0で、money_amountとpoint_amountの両方が0のときにはinvalid_parameter_both_point_and_money_are_zero(エラーコード400)が返ります。
2104
2632
  point_amount:
2105
- type: number
2633
+ type: integer
2106
2634
  minimum: 0
2107
2635
  title: 'ポイント額'
2108
2636
  description: |-
2109
2637
  ポイント額です。
2110
2638
 
2111
2639
  送金するポイント額を指定します。
2640
+ デフォルト値は0で、money_amountとpoint_amountの両方が0のときにはinvalid_parameter_both_point_and_money_are_zero(エラーコード400)が返ります。
2112
2641
  point_expires_at:
2113
2642
  type: string
2114
2643
  format: date-time
@@ -2152,7 +2681,7 @@ paths:
2152
2681
  content:
2153
2682
  application/json:
2154
2683
  schema:
2155
- $ref: '#/components/schemas/Transaction'
2684
+ $ref: '#/components/schemas/TransactionDetail'
2156
2685
  '400':
2157
2686
  $ref: '#/components/responses/BadRequest'
2158
2687
  '403':
@@ -2199,7 +2728,7 @@ paths:
2199
2728
  content:
2200
2729
  application/json:
2201
2730
  schema:
2202
- $ref: '#/components/schemas/Transaction'
2731
+ $ref: '#/components/schemas/TransactionDetail'
2203
2732
  '400':
2204
2733
  $ref: '#/components/responses/BadRequest'
2205
2734
  '403':
@@ -2250,7 +2779,7 @@ paths:
2250
2779
 
2251
2780
  マネーを指定します。
2252
2781
  amount:
2253
- type: number
2782
+ type: integer
2254
2783
  minimum: 0
2255
2784
  title: '支払い額'
2256
2785
  description: |-
@@ -2333,7 +2862,7 @@ paths:
2333
2862
  content:
2334
2863
  application/json:
2335
2864
  schema:
2336
- $ref: '#/components/schemas/Transaction'
2865
+ $ref: '#/components/schemas/TransactionDetail'
2337
2866
  '400':
2338
2867
  $ref: '#/components/responses/BadRequest'
2339
2868
  '403':
@@ -2457,7 +2986,7 @@ paths:
2457
2986
  content:
2458
2987
  application/json:
2459
2988
  schema:
2460
- $ref: '#/components/schemas/Transaction'
2989
+ $ref: '#/components/schemas/TransactionDetail'
2461
2990
  examples:
2462
2991
  example-1:
2463
2992
  value:
@@ -2606,7 +3135,7 @@ paths:
2606
3135
  content:
2607
3136
  application/json:
2608
3137
  schema:
2609
- $ref: '#/components/schemas/Transaction'
3138
+ $ref: '#/components/schemas/TransactionDetail'
2610
3139
  '400':
2611
3140
  $ref: '#/components/responses/BadRequest'
2612
3141
  '403':
@@ -2657,7 +3186,7 @@ paths:
2657
3186
  content:
2658
3187
  application/json:
2659
3188
  schema:
2660
- $ref: '#/components/schemas/Transaction'
3189
+ $ref: '#/components/schemas/TransactionDetail'
2661
3190
  '400':
2662
3191
  $ref: '#/components/responses/BadRequest'
2663
3192
  '422':
@@ -2761,7 +3290,7 @@ paths:
2761
3290
  content:
2762
3291
  application/json:
2763
3292
  schema:
2764
- $ref: '#/components/schemas/Transaction'
3293
+ $ref: '#/components/schemas/TransactionDetail'
2765
3294
  '400':
2766
3295
  $ref: '#/components/responses/InvalidParameters'
2767
3296
  '403':
@@ -2808,61 +3337,240 @@ paths:
2808
3337
  content:
2809
3338
  application/json:
2810
3339
  schema:
2811
- $ref: '#/components/schemas/Transaction'
3340
+ $ref: '#/components/schemas/TransactionDetail'
2812
3341
  '403':
2813
3342
  $ref: '#/components/responses/Forbidden'
2814
3343
  '422':
2815
3344
  $ref: '#/components/responses/UnprocessableEntity'
2816
- /transfers:
2817
- get:
3345
+ /external-transactions:
3346
+ post:
2818
3347
  tags:
2819
- - Transaction
2820
- x-pokepay-operator-name: "ListTransfers"
3348
+ - Event
3349
+ summary: 'ポケペイ外部取引を作成する'
3350
+ description: |
3351
+ ポケペイ外部取引を作成します。
3352
+
3353
+ ポケペイ外の現金決済やクレジットカード決済に対してポケペイのポイントを付けたいというときに使用します。
3354
+ x-pokepay-operator-name: "CreateExternalTransaction"
2821
3355
  x-pokepay-allow-server-side: true
2822
3356
  requestBody:
2823
3357
  required: true
2824
3358
  content:
2825
3359
  application/json:
2826
3360
  schema:
3361
+ required:
3362
+ - private_money_id
3363
+ - shop_id
3364
+ - customer_id
3365
+ - amount
2827
3366
  properties:
2828
- from:
2829
- type: string
2830
- format: date-time
2831
- to:
2832
- type: string
2833
- format: date-time
2834
- page:
2835
- type: integer
2836
- minimum: 1
2837
- per_page:
2838
- type: integer
2839
- minimum: 1
2840
3367
  shop_id:
2841
3368
  type: string
2842
3369
  format: uuid
2843
- shop_name:
2844
- type: string
2845
- maxLength: 256
3370
+ title: 店舗ID
3371
+ description: |-
3372
+ 店舗IDです。
3373
+
3374
+ ポケペイ外部取引が行なう店舗を指定します。
2846
3375
  customer_id:
2847
3376
  type: string
2848
3377
  format: uuid
2849
- customer_name:
2850
- type: string
2851
- maxLength: 256
2852
- transaction_id:
2853
- type: string
2854
- format: uuid
3378
+ title: エンドユーザーID
3379
+ description: |-
3380
+ エンドユーザーIDです。
3381
+
3382
+ エンドユーザーを指定します。
2855
3383
  private_money_id:
2856
3384
  type: string
2857
3385
  format: uuid
2858
- is_modified:
2859
- type: boolean
2860
- transaction_types:
2861
- type: array
2862
- items:
2863
- type: string
2864
- enum: [topup, payment, transfer, exchange]
2865
- transfer_types:
3386
+ title: マネーID
3387
+ description: |-
3388
+ マネーIDです。
3389
+
3390
+ マネーを指定します。
3391
+ amount:
3392
+ type: integer
3393
+ minimum: 0
3394
+ title: 取引額
3395
+ description: |-
3396
+ 取引金額です。
3397
+ description:
3398
+ type: string
3399
+ maxLength: 200
3400
+ title: 取引説明文
3401
+ description: |-
3402
+ 取引説明文です。
3403
+
3404
+ 任意入力で、取引履歴に表示される説明文です。
3405
+ example: たい焼き(小倉)
3406
+ metadata:
3407
+ type: string
3408
+ format: json
3409
+ title: ポケペイ外部取引メタデータ
3410
+ description: |-
3411
+ ポケペイ外部取引作成時に指定され、取引と紐付けられるメタデータです。
3412
+
3413
+ 任意入力で、全てのkeyとvalueが文字列であるようなフラットな構造のJSONで指定します。
3414
+ example: |-
3415
+ {"key":"value"}
3416
+ products:
3417
+ type: array
3418
+ items:
3419
+ type: object
3420
+ properties:
3421
+ jan_code:
3422
+ type: string
3423
+ maxLength: 64
3424
+ name:
3425
+ type: string
3426
+ maxLength: 256
3427
+ unit_price:
3428
+ type: number
3429
+ minimum: 0
3430
+ price:
3431
+ type: number
3432
+ minimum: 0
3433
+ is_discounted:
3434
+ type: boolean
3435
+ other:
3436
+ type: string
3437
+ format: json
3438
+ example: |-
3439
+ {"jan_code":"abc",
3440
+ "name":"name1",
3441
+ "unit_price":100,
3442
+ "price": 100,
3443
+ "is_discounted": false,
3444
+ "other":"{}"}
3445
+ title: '商品情報データ'
3446
+ description: |-
3447
+ 一つの取引に含まれる商品情報データです。
3448
+ 以下の内容からなるJSONオブジェクトの配列で指定します。
3449
+
3450
+ - `jan_code`: JANコード。64字以下の文字列
3451
+ - `name`: 商品名。256字以下の文字列
3452
+ - `unit_price`: 商品単価。0以上の数値
3453
+ - `price`: 全体の金額(例: 商品単価 × 個数)。0以上の数値
3454
+ - `is_discounted`: 賞味期限が近いなどの理由で商品が値引きされているかどうかのフラグ。boolean
3455
+ - `other`: その他商品に関する情報。JSONオブジェクトで指定します。
3456
+ request_id:
3457
+ type: string
3458
+ format: uuid
3459
+ title: リクエストID
3460
+ description: |-
3461
+ 取引作成APIの羃等性を担保するためのリクエスト固有のIDです。
3462
+
3463
+ 取引作成APIで結果が受け取れなかったなどの理由で再試行する際に、二重に取引が作られてしまうことを防ぐために、クライアント側から指定されます。指定は任意で、UUID V4フォーマットでランダム生成した文字列です。リクエストIDは一定期間で削除されます。
3464
+
3465
+ リクエストIDを指定したとき、まだそのリクエストIDに対する取引がない場合、新規に取引が作られレスポンスとして返されます。もしそのリクエストIDに対する取引が既にある場合、既存の取引がレスポンスとして返されます。
3466
+ example: 9dbfd997-b948-40d3-a3bf-6bc1a01368d2
3467
+ responses:
3468
+ '200':
3469
+ description: OK
3470
+ content:
3471
+ application/json:
3472
+ schema:
3473
+ $ref: '#/components/schemas/ExternalTransaction'
3474
+ '400':
3475
+ $ref: '#/components/responses/BadRequest'
3476
+ '403':
3477
+ $ref: '#/components/responses/Forbidden'
3478
+ '422':
3479
+ $ref: '#/components/responses/UnprocessableEntity'
3480
+ /external-transactions/{event_id}/refund:
3481
+ post:
3482
+ tags:
3483
+ - Event
3484
+ summary: 'ポケペイ外部取引をキャンセルする'
3485
+ description: |-
3486
+ 取引IDを指定して取引をキャンセルします。
3487
+
3488
+ 発行体の管理者は自組織の直営店、または発行しているマネーの決済加盟店組織での取引をキャンセルできます。
3489
+ キャンセル対象のポケペイ外部取引に付随するポイント還元キャンペーンも取り消されます。
3490
+
3491
+ 取引をキャンセルできるのは1回きりです。既にキャンセルされた取引を重ねてキャンセルしようとすると `transaction_already_refunded (422)` エラーが返ります。
3492
+ x-pokepay-operator-name: RefundExternalTransaction
3493
+ x-pokepay-allow-server-side: true
3494
+ parameters:
3495
+ - in: path
3496
+ name: event_id
3497
+ required: true
3498
+ schema:
3499
+ type: string
3500
+ format: uuid
3501
+ title: '取引ID'
3502
+ requestBody:
3503
+ required: true
3504
+ content:
3505
+ application/json:
3506
+ schema:
3507
+ properties:
3508
+ description:
3509
+ type: string
3510
+ maxLength: 200
3511
+ title: '取引履歴に表示する返金事由'
3512
+ example: '返品対応のため'
3513
+ responses:
3514
+ '200':
3515
+ description: OK
3516
+ content:
3517
+ application/json:
3518
+ schema:
3519
+ $ref: '#/components/schemas/ExternalTransaction'
3520
+ '403':
3521
+ $ref: '#/components/responses/Forbidden'
3522
+ '422':
3523
+ $ref: '#/components/responses/UnprocessableEntity'
3524
+ /transfers:
3525
+ get:
3526
+ tags:
3527
+ - Transaction
3528
+ x-pokepay-operator-name: "ListTransfers"
3529
+ x-pokepay-allow-server-side: true
3530
+ requestBody:
3531
+ required: true
3532
+ content:
3533
+ application/json:
3534
+ schema:
3535
+ properties:
3536
+ from:
3537
+ type: string
3538
+ format: date-time
3539
+ to:
3540
+ type: string
3541
+ format: date-time
3542
+ page:
3543
+ type: integer
3544
+ minimum: 1
3545
+ per_page:
3546
+ type: integer
3547
+ minimum: 1
3548
+ shop_id:
3549
+ type: string
3550
+ format: uuid
3551
+ shop_name:
3552
+ type: string
3553
+ maxLength: 256
3554
+ customer_id:
3555
+ type: string
3556
+ format: uuid
3557
+ customer_name:
3558
+ type: string
3559
+ maxLength: 256
3560
+ transaction_id:
3561
+ type: string
3562
+ format: uuid
3563
+ private_money_id:
3564
+ type: string
3565
+ format: uuid
3566
+ is_modified:
3567
+ type: boolean
3568
+ transaction_types:
3569
+ type: array
3570
+ items:
3571
+ type: string
3572
+ enum: [topup, payment, transfer, exchange, cashback, expire]
3573
+ transfer_types:
2866
3574
  type: array
2867
3575
  description: |-
2868
3576
  取引明細の種類でフィルターします。
@@ -2883,9 +3591,15 @@ paths:
2883
3591
 
2884
3592
  5. coupon
2885
3593
  クーポンによる値引き処理、またはそのキャンセル取引
3594
+
3595
+ 6. cashback
3596
+ 退会時の返金取引
3597
+
3598
+ 7. expire
3599
+ 退会時失効取引
2886
3600
  items:
2887
3601
  type: string
2888
- enum: [topup, payment, exchange, transfer, coupon, campaign]
3602
+ enum: [topup, payment, exchange, transfer, coupon, campaign, cashback, expire]
2889
3603
  description:
2890
3604
  type: string
2891
3605
  maxLength: 200
@@ -3526,7 +4240,8 @@ paths:
3526
4240
  フィルターとして使われ、指定された受取ユーザーでの取引のみ一覧に表示されます。
3527
4241
  type:
3528
4242
  type: string
3529
- title: '取引種別、チャージ=topup、支払い=payment、個人間送金=transfer'
4243
+ enum: [topup, payment, exchange, transfer, cashback, expire]
4244
+ title: '取引種別'
3530
4245
  description: |-
3531
4246
  取引の種類でフィルターします。
3532
4247
 
@@ -3540,6 +4255,10 @@ paths:
3540
4255
  他マネーへの流出(outflow)/他マネーからの流入(inflow)
3541
4256
  4. transfer
3542
4257
  個人間送金
4258
+ 5. cashback
4259
+ ウォレット退会時返金
4260
+ 6. expire
4261
+ ウォレット退会時失効
3543
4262
  is_modified:
3544
4263
  type: boolean
3545
4264
  title: 'キャンセル済みかどうか'
@@ -3868,3 +4587,1074 @@ paths:
3868
4587
  $ref: '#/components/responses/NotFound'
3869
4588
  '422':
3870
4589
  $ref: '#/components/responses/UnprocessableEntity'
4590
+ /campaigns:
4591
+ post:
4592
+ tags:
4593
+ - Campaign
4594
+ summary: 'ポイント付与キャンペーンを作る'
4595
+ description: |
4596
+ ポイント付与キャンペーンを作成します。
4597
+ x-pokepay-operator-name: "CreateCampaign"
4598
+ x-pokepay-allow-server-side: true
4599
+ requestBody:
4600
+ required: true
4601
+ content:
4602
+ application/json:
4603
+ schema:
4604
+ required: ["name", "private_money_id", "starts_at", "ends_at","priority", "event"]
4605
+ properties:
4606
+ name:
4607
+ title: 'キャンペーン名'
4608
+ type: string
4609
+ maxLength: 256
4610
+ description: |-
4611
+ キャンペーン名です(必須項目)。
4612
+
4613
+ ポイント付与によってできるチャージ取引の説明文に転記されます。取引説明文はエンドユーザーからも確認できます。
4614
+ private_money_id:
4615
+ type: string
4616
+ format: uuid
4617
+ title: 'マネーID'
4618
+ description: |-
4619
+ キャンペーン対象のマネーのIDです(必須項目)。
4620
+ starts_at:
4621
+ type: string
4622
+ format: date-time
4623
+ title: 'キャンペーン開始日時'
4624
+ description: |-
4625
+ キャンペーン開始日時です(必須項目)。
4626
+ キャンペーン期間中のみポイントが付与されます。
4627
+ 開始日時よりも終了日時が前のときはcampaign_invalid_periodエラー(422)になります。
4628
+ ends_at:
4629
+ type: string
4630
+ format: date-time
4631
+ title: 'キャンペーン終了日時'
4632
+ description: |-
4633
+ キャンペーン終了日時です(必須項目)。
4634
+ キャンペーン期間中のみポイントが付与されます。
4635
+ 開始日時よりも終了日時が前のときはcampaign_invalid_periodエラー(422)になります。
4636
+ priority:
4637
+ type: integer
4638
+ title: 'キャンペーンの適用優先度'
4639
+ description: |-
4640
+ キャンペーンの適用優先度です。
4641
+
4642
+ 優先度が大きいものから順に適用判定されていきます。
4643
+ キャンペーン期間が重なっている同一の優先度のキャンペーンが存在するとcampaign_period_overlapsエラー(422)になります。
4644
+ event:
4645
+ type: string
4646
+ enum: [topup, payment, external-transaction]
4647
+ title: 'イベント種別'
4648
+ description: |-
4649
+ キャンペーンのトリガーとなるイベントの種類を指定します(必須項目)。
4650
+
4651
+ 以下のいずれかを指定できます。
4652
+
4653
+ 1. topup
4654
+ 店舗からエンドユーザーへの送金取引(チャージ)
4655
+ 2. payment
4656
+ エンドユーザーから店舗への送金取引(支払い)
4657
+ 3. external-transaction
4658
+ ポケペイ外の取引(現金決済など)
4659
+ bear_point_shop_id:
4660
+ type: string
4661
+ format: uuid
4662
+ title: 'ポイント負担先店舗ID'
4663
+ description: |-
4664
+ ポイントを負担する店舗のIDです。デフォルトではマネー発行体の本店が設定されます。
4665
+ ポイント負担先店舗は後から更新することはできません。
4666
+ description:
4667
+ type: string
4668
+ maxLength: 200
4669
+ title: 'キャンペーンの説明文'
4670
+ description: |-
4671
+ キャンペーンの内容を記載します。管理画面などでキャンペーンを管理するための説明文になります。
4672
+ status:
4673
+ type: string
4674
+ enum: [enabled, disabled]
4675
+ title: 'キャンペーン作成時の状態'
4676
+ description: |-
4677
+ キャンペーン作成時の状態を指定します。デフォルトではenabledです。
4678
+
4679
+ 以下のいずれかを指定できます。
4680
+
4681
+ 1. enabled
4682
+ 有効
4683
+ 2. disabled
4684
+ 無効
4685
+ point_expires_at:
4686
+ type: string
4687
+ format: date-time
4688
+ title: 'ポイント有効期限(絶対日時指定)'
4689
+ description: |-
4690
+ キャンペーンによって付与されるポイントの有効期限を絶対日時で指定します。
4691
+ 省略した場合はマネーに設定された有効期限と同じものがポイントの有効期限となります。
4692
+ point_expires_in_days:
4693
+ type: integer
4694
+ minimum: 1
4695
+ title: 'ポイント有効期限(相対日数指定)'
4696
+ description: |-
4697
+ キャンペーンによって付与されるポイントの有効期限を相対日数で指定します。
4698
+ 省略した場合はマネーに設定された有効期限と同じものがポイントの有効期限となります。
4699
+ is_exclusive:
4700
+ type: boolean
4701
+ title: 'キャンペーンの重複設定'
4702
+ description: |-
4703
+ キャンペーンの重ね掛けを行うかどうかのフラグです。
4704
+
4705
+ これにtrueを指定すると他のキャンペーンと同時適用されません。デフォルト値はtrueです。
4706
+ falseを指定すると次の優先度の重ね掛け可能なキャンペーンの適用判定に進みます。
4707
+ subject:
4708
+ type: string
4709
+ enum: [money, all]
4710
+ title: 'ポイント付与の対象金額の種別'
4711
+ description: |-
4712
+ ポイント付与額を計算する対象となる金額の種類を指定します。デフォルト値はallです。
4713
+ eventとしてexternal-transactionを指定した場合はポイントとマネーの区別がないためsubjectの指定に関わらず常にallとなります。
4714
+
4715
+ 以下のいずれかを指定できます。
4716
+
4717
+ 1. money
4718
+ moneyを指定すると決済額の中で「マネー」を使って支払った額を対象にします
4719
+
4720
+ 2. all
4721
+ all を指定すると決済額全体を対象にします (「ポイント」での取引額を含む)
4722
+ 注意: event を topup にしたときはポイントの付与に対しても適用されます
4723
+ amount_based_point_rules:
4724
+ type: array
4725
+ items:
4726
+ type: object
4727
+ properties:
4728
+ point_amount:
4729
+ type: number
4730
+ format: decimal
4731
+ minimum: 0
4732
+ title: '付与ポイント量'
4733
+ description: |-
4734
+ キャンペーンにより付与するポイント量。(必須項目)
4735
+
4736
+ point_amount_unitにより指定される単位が絶対額のときは小数点以下が切り捨てられ整数として扱われます。
4737
+ パーセント指定の時は小数を許容し、割合計算後に小数点以下が切り捨てられます。
4738
+ いずれの場合も実際に付与されるポイントは整数のみです。
4739
+ point_amount_unit:
4740
+ type: string
4741
+ enum: [percent, absolute]
4742
+ title: '付与ポイント量の単位'
4743
+ description: |-
4744
+ キャンペーンにより付与するポイント量の単位を指定します。(必須項目)
4745
+
4746
+ 以下のいずれかを指定できます。
4747
+
4748
+ 1. percent
4749
+ 付与するポイント量が元取引の取引額に応じて割合で変化するときに指定します。
4750
+
4751
+ 2. absolute
4752
+ 付与するポイント量が元取引の取引額に依存しない絶対額であるときに指定します。
4753
+ subject_more_than:
4754
+ type: integer
4755
+ minimum: 0
4756
+ title: '対象金額の下限値 (x <)'
4757
+ description: |-
4758
+ 対象金額の下限値 (x <) を指定します (ただし、指定された金額は含まない)。
4759
+ subject_more_than_or_equal といずれかのみ指定できます。
4760
+ subject_more_than_or_equal:
4761
+ type: integer
4762
+ minimum: 0
4763
+ title: '対象金額の下限値 (x <=)'
4764
+ description: |-
4765
+ 対象金額の下限値 (x <=) を指定します。
4766
+ subject_more_than といずれかのみ指定できます。
4767
+ subject_less_than:
4768
+ type: integer
4769
+ minimum: 0
4770
+ title: '対象金額の上限値 (< x)'
4771
+ description: |-
4772
+ 対象金額の上限値 (< x) を指定します (ただし、指定された金額は含まない)。
4773
+ subject_less_than_or_equal といずれかのみ指定できます。
4774
+ subject_less_than_or_equal:
4775
+ type: integer
4776
+ minimum: 0
4777
+ title: '対象金額の上限値 (<= x)'
4778
+ description: |-
4779
+ 対象金額の上限値 (<= x) を指定します。
4780
+ subject_less_than といずれかのみ指定できます。
4781
+ example: |-
4782
+ {
4783
+ "point_amount": 5,
4784
+ "point_amount_unit": "percent",
4785
+ "subject_more_than_or_equal": 1000,
4786
+ "subject_less_than": 5000
4787
+ }
4788
+
4789
+ title: '取引金額ベースのポイント付与ルール'
4790
+ description: |-
4791
+ 金額をベースとしてポイント付与を行うルールを指定します。
4792
+ amount_based_point_rules と product_based_point_rules はどちらか一方しか指定できません。
4793
+ 各ルールは一つのみ適用され、条件に重複があった場合は先に記載されたものが優先されます。
4794
+
4795
+ 例:
4796
+ ```javascript
4797
+ [
4798
+ // 1000円以上、5000円未満の決済には 5%
4799
+ {
4800
+ "point_amount": 5,
4801
+ "point_amount_unit": "percent",
4802
+ "subject_more_than_or_equal": 1000,
4803
+ "subject_less_than": 5000
4804
+ },
4805
+ // 5000円以上の決済には 10%
4806
+ {
4807
+ "point_amount": 10,
4808
+ "point_amount_unit": "percent",
4809
+ "subject_more_than_or_equal": 5000
4810
+ },
4811
+ ]
4812
+ ```
4813
+
4814
+ product_based_point_rules:
4815
+ type: array
4816
+ items:
4817
+ type: object
4818
+ properties:
4819
+ point_amount:
4820
+ type: number
4821
+ format: decimal
4822
+ minimum: 0
4823
+ title: '付与ポイント量'
4824
+ description: |-
4825
+ キャンペーンにより付与するポイント量。単位は point_amount_unit で指定します。(必須項目)
4826
+
4827
+ point_amount_unitにより指定される単位が絶対額のときは小数点以下が切り捨てられ整数として扱われます。
4828
+ パーセント指定の時は小数を許容し、割合計算後に小数点以下が切り捨てられます。
4829
+ いずれの場合も実際に付与されるポイントは整数のみです。
4830
+ point_amount_unit:
4831
+ type: string
4832
+ enum: [percent, absolute]
4833
+ title: '付与ポイント量の単位'
4834
+ description: |-
4835
+ キャンペーンにより付与するポイント量の単位を指定します。(必須項目)
4836
+
4837
+ 以下のいずれかを指定できます。
4838
+
4839
+ 1. percent
4840
+ 付与するポイント量が元取引の取引額に応じて割合で変化するときに指定します。
4841
+
4842
+ 2. absolute
4843
+ 付与するポイント量が元取引の取引額に依存しない絶対額であるときに指定します。
4844
+ product_code:
4845
+ type: string
4846
+ maxLength: 64
4847
+ title: '対象の製品コード'
4848
+ description: |-
4849
+ 対象の製品コード (JANコードやISBNコードなど) を指定します。(必須項目)
4850
+
4851
+ SQLのLIKE文のようにワイルドカードを使った製品コードのパターンを指定することもできます (例: 978-% でISBNコード)
4852
+ items:
4853
+ type: string
4854
+ required_count:
4855
+ type: integer
4856
+ minimum: 1
4857
+ title: '必要購入個数'
4858
+ description: |-
4859
+ キャンペーン適用のための対象商品の必要購入個数を指定します (例:商品Aを2個以上購入するとn%ポイント)。
4860
+ デフォルト値は1です。
4861
+ is_multiply_by_count:
4862
+ type: boolean
4863
+ title: '複数個購入したときにポイント付与額に個数を掛けるかどうか'
4864
+ description: |-
4865
+ キャンペーン対象の商品を複数個購入したときに、個数に応じてポイント付与額を増やすかどうかのフラグです。
4866
+ デフォルト値は false です。
4867
+ starts_at:
4868
+ type: string
4869
+ format: date-time
4870
+ title: '商品個別のキャンペーン開始日時'
4871
+ description: |-
4872
+ このルールを適用する開始日時を指定します。
4873
+ デフォルトではキャンペーン全体の開始日時が指定されます。
4874
+ 商品個別にキャンペーン期間指定をする場合は、キャンペーン全体の期間指定の範囲内に入っている必要があります。
4875
+ ends_at:
4876
+ type: string
4877
+ format: date-time
4878
+ title: '商品個別のキャンペーン終了日時'
4879
+ description: |-
4880
+ このルールを適用する終了日時を指定します。
4881
+ デフォルトではキャンペーン全体の終了日時が指定されます。
4882
+ 商品個別にキャンペーン期間指定をする場合は、キャンペーン全体の期間指定の範囲内に入っている必要があります。
4883
+ example: |-
4884
+ {
4885
+ "point_amount": 5,
4886
+ "point_amount_unit": "percent",
4887
+ "product_code": "4912345678904",
4888
+ "is_multiply_by_count": true,
4889
+ "required_count": 2
4890
+ }
4891
+
4892
+ title: '商品情報ベースのポイント付与ルール'
4893
+ description: |-
4894
+ 商品情報をベースとしてポイント付与を行うルールを指定します。
4895
+ ルールは商品ごとに設定可能で、ルールの配列として指定します。
4896
+ amount_based_point_rules と product_based_point_rules はどちらか一方しか指定できません。
4897
+ event が payment か external-transaction の時のみ有効です。
4898
+ 各ルールの順序は問わず、適用可能なものは全て適用されます。
4899
+ 一つの決済の中で複数の商品がキャンペーン適用可能な場合はそれぞれの商品についてのルールが適用され、ポイント付与額はその合算になります。
4900
+
4901
+ 例:
4902
+ ```javascript
4903
+ [
4904
+ // 対象商品の購入額から5%ポイント付与。複数購入時は単価の5%が付与される。
4905
+ {
4906
+ "point_amount": 5,
4907
+ "point_amount_unit": "percent",
4908
+ "product_code": "4912345678904",
4909
+ },
4910
+ // 対象商品の購入額から5%ポイント付与。複数購入時は購入総額の5%が付与される。
4911
+ {
4912
+ "point_amount": 5,
4913
+ "point_amount_unit": "percent",
4914
+ "product_code": "4912345678904",
4915
+ "is_multiply_by_count": true,
4916
+ },
4917
+ // 対象商品を2つ以上購入したら500ポイント付与(固定額付与)
4918
+ {
4919
+ "point_amount": 500,
4920
+ "point_amount_unit": "absolute",
4921
+ "product_code": "4912345678904",
4922
+ "required_count": 2
4923
+ },
4924
+ // 書籍は10%ポイント付与
4925
+ // ※ISBNの形式はレジがポケペイに送信する形式に準じます
4926
+ {
4927
+ "point_amount": 10,
4928
+ "point_amount_unit": "percent",
4929
+ "product_code": "978-%",
4930
+ },
4931
+ // 一部の出版社の書籍は10%ポイント付与
4932
+ {
4933
+ "point_amount": 10,
4934
+ "point_amount_unit": "percent",
4935
+ "product_code": "978-4-01-%", // 旺文社
4936
+ }
4937
+ ]
4938
+ ```
4939
+
4940
+ applicable_days_of_week:
4941
+ type: array
4942
+ items:
4943
+ type: integer
4944
+ minimun: 0
4945
+ maximum: 6
4946
+ title: 'キャンペーンを適用する曜日 (複数指定)'
4947
+ describe: |-
4948
+ キャンペーンを適用する曜日を指定します (複数指定)。
4949
+ 曜日は整数で表します。月曜を 0 とし、日曜を 6 とします。
4950
+ 指定しなかった場合は全日を対象にします (曜日による適用条件なし)
4951
+ applicable_time_ranges:
4952
+ type: array
4953
+ items:
4954
+ type: object
4955
+ properties:
4956
+ from:
4957
+ type: string
4958
+ description: |-
4959
+ 時間帯の開始時刻 (HH:mmの形式)
4960
+ to:
4961
+ type: string
4962
+ description: |-
4963
+ 時間帯の終了時刻 (HH:mmの形式)
4964
+ example: |-
4965
+ {
4966
+ "from": "12:00",
4967
+ "to": "23:59"
4968
+ }
4969
+
4970
+ title: 'キャンペーンを適用する時間帯 (複数指定)'
4971
+ describe: |-
4972
+ キャンペーンを適用する時間帯を指定します (複数指定可)。
4973
+ 時間帯はfromとtoからなるオブジェクトで指定します。
4974
+ fromとtoは両方必要です。
4975
+ applicable_shop_ids:
4976
+ type: array
4977
+ items:
4978
+ type: string
4979
+ format: uuid
4980
+ title: 'キャンペーン適用対象となる店舗IDのリスト'
4981
+ describe: |-
4982
+ キャンペーンを適用する店舗IDを指定します (複数指定)。
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をキャンセルしたときは連動して元のイベントがキャンセルされます。
5074
+ responses:
5075
+ '200':
5076
+ description: OK
5077
+ content:
5078
+ application/json:
5079
+ schema:
5080
+ $ref: '#/components/schemas/Campaign'
5081
+ '400':
5082
+ $ref: '#/components/responses/BadRequest'
5083
+ '403':
5084
+ $ref: '#/components/responses/Forbidden'
5085
+ '422':
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'