pokepay_partner_ruby_sdk 0.1.13 → 0.1.17

Sign up to get free protection for your applications and to get access to all the features.
data/docs/index.md CHANGED
@@ -57,6 +57,20 @@ SSL_KEY_FILE = /path/to/key.pem
57
57
  SSL_CERT_FILE = /path/to/cert.pem
58
58
  ```
59
59
 
60
+ 設定はハッシュで渡すこともできます。
61
+
62
+ ```ruby
63
+ client = Pokepay::Client.new(
64
+ {
65
+ client_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
66
+ client_secret: "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",
67
+ api_base_url: "https://partnerapi-sandbox.pokepay.jp",
68
+ ssl_key_file: "/path/to/key.pem",
69
+ ssl_cert_file: "/path/to/cert.pem"
70
+ }
71
+ )
72
+ ```
73
+
60
74
  ## Overview
61
75
 
62
76
  ### APIリクエスト
@@ -142,14 +156,16 @@ response.body
142
156
  <a name="api-operations"></a>
143
157
  ## API Operations
144
158
 
159
+ - [GetCpmToken](#get-cpm-token): CPMトークンの状態取得
145
160
  - [ListTransactions](#list-transactions): 取引履歴を取得する
146
161
  - [CreateTransaction](#create-transaction): チャージする(廃止予定)
147
162
  - [CreateTopupTransaction](#create-topup-transaction): チャージする
148
163
  - [CreatePaymentTransaction](#create-payment-transaction): 支払いする
164
+ - [CreateCpmTransaction](#create-cpm-transaction): CPMトークンによる取引作成
149
165
  - [CreateTransferTransaction](#create-transfer-transaction): 個人間送金
150
166
  - [CreateExchangeTransaction](#create-exchange-transaction):
151
167
  - [GetTransaction](#get-transaction): 取引情報を取得する
152
- - [RefundTransaction](#refund-transaction): 返金する
168
+ - [RefundTransaction](#refund-transaction): 取引をキャンセルする
153
169
  - [ListTransfers](#list-transfers):
154
170
  - [CreateTopupTransactionWithCheck](#create-topup-transaction-with-check): チャージQRコードを読み取ることでチャージする
155
171
  - [ListBills](#list-bills): 支払いQRコード一覧を表示する
@@ -173,17 +189,42 @@ response.body
173
189
  - [GetShop](#get-shop): 店舗情報を表示する
174
190
  - [UpdateShop](#update-shop): 店舗情報を更新する
175
191
  - [ListUserAccounts](#list-user-accounts): エンドユーザー、店舗ユーザーのウォレット一覧を表示する
192
+ - [CreateUserAccount](#create-user-account): エンドユーザーのウォレットを作成する
176
193
  - [GetPrivateMoneys](#get-private-moneys): マネー一覧を取得する
177
194
  - [GetPrivateMoneyOrganizationSummaries](#get-private-money-organization-summaries): 決済加盟店の取引サマリを取得する
178
195
  - [BulkCreateTransaction](#bulk-create-transaction): CSVファイル一括取引
196
+ - [CreateExternalTransaction](#create-external-transaction): ポケペイ外部取引を作成する
197
+ - [RefundExternalTransaction](#refund-external-transaction): ポケペイ外部取引をキャンセルする
179
198
  ### Transaction
199
+ <a name="get-cpm-token"></a>
200
+ #### CPMトークンの状態取得
201
+ CPMトークンの現在の状態を取得します。CPMトークンの有効期限やCPM取引の状態を返します。
202
+ ```ruby
203
+ response = $client.send(Pokepay::Request::GetCpmToken.new(
204
+ "6b0IY83jSy9CLjq8yjjxIn" # cpm_token: CPMトークン
205
+ ))
206
+ ```
207
+
208
+ ---
209
+ `cpm_token`
210
+ ```json
211
+ {
212
+ "type": "string",
213
+ "minLength": 22,
214
+ "maxLength": 22
215
+ }
216
+ ```
217
+ CPM取引時にエンドユーザーが店舗に提示するバーコードを解析して得られる22桁の文字列です。
218
+
219
+ ---
220
+ 成功したときは[CpmToken](#cpm-token)オブジェクトを返します
180
221
  <a name="list-transactions"></a>
181
222
  #### 取引履歴を取得する
182
223
  取引一覧を返します。
183
224
  ```ruby
184
225
  response = $client.send(Pokepay::Request::ListTransactions.new(
185
- from: "2016-06-03T22:47:56.000000+09:00", # 開始日時
186
- to: "2020-02-14T17:14:59.000000+09:00", # 終了日時
226
+ from: "2017-02-04T15:50:33.000000+09:00", # 開始日時
227
+ to: "2015-11-01T07:49:45.000000+09:00", # 終了日時
187
228
  page: 1, # ページ番号
188
229
  per_page: 50, # 1ページ分の取引数
189
230
  shop_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # 店舗ID
@@ -390,10 +431,10 @@ response = $client.send(Pokepay::Request::CreateTransaction.new(
390
431
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
391
432
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
392
433
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
393
- money_amount: 534,
394
- point_amount: 1195,
395
- point_expires_at: "2023-05-29T08:46:58.000000+09:00", # ポイント有効期限
396
- description: "N6lsKCXAkk07Q9YuV27x2ZZwJNPJ0aXH1uRWCYsw6VRBfXAF7xeoT0y6lNlDnKEOyMV89HUL5OwvTmfk"
434
+ money_amount: 3266,
435
+ point_amount: 8558,
436
+ point_expires_at: "2022-10-27T22:44:36.000000+09:00", # ポイント有効期限
437
+ description: "5NxHP7"
397
438
  ))
398
439
  ```
399
440
 
@@ -419,10 +460,11 @@ response = $client.send(Pokepay::Request::CreateTopupTransaction.new(
419
460
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # customer_id: エンドユーザーのID
420
461
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # private_money_id: マネーID
421
462
  bear_point_shop_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # ポイント支払時の負担店舗ID
422
- money_amount: 6611, # マネー額
423
- point_amount: 3184, # ポイント額
424
- point_expires_at: "2024-11-16T15:12:20.000000+09:00", # ポイント有効期限
463
+ money_amount: 4291, # マネー額
464
+ point_amount: 9746, # ポイント額
465
+ point_expires_at: "2024-02-13T23:55:13.000000+09:00", # ポイント有効期限
425
466
  description: "初夏のチャージキャンペーン", # 取引履歴に表示する説明文
467
+ metadata: "{\"key\":\"value\"}", # 取引メタデータ
426
468
  request_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # リクエストID
427
469
  ))
428
470
  ```
@@ -522,6 +564,18 @@ response = $client.send(Pokepay::Request::CreateTopupTransaction.new(
522
564
 
523
565
  任意入力で、取引履歴に表示される説明文です。
524
566
 
567
+ ---
568
+ `metadata`
569
+ ```json
570
+ {
571
+ "type": "string",
572
+ "format": "json"
573
+ }
574
+ ```
575
+ 取引作成時に指定されるメタデータです。
576
+
577
+ 任意入力で、全てのkeyとvalueが文字列であるようなフラットな構造のJSON文字列で指定します。
578
+
525
579
  ---
526
580
  `request_id`
527
581
  ```json
@@ -548,8 +602,20 @@ response = $client.send(Pokepay::Request::CreatePaymentTransaction.new(
548
602
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # shop_id: 店舗ID
549
603
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # customer_id: エンドユーザーID
550
604
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # private_money_id: マネーID
551
- 7587, # amount: 支払い額
605
+ 1057, # amount: 支払い額
552
606
  description: "たい焼き(小倉)", # 取引履歴に表示する説明文
607
+ metadata: "{\"key\":\"value\"}", # 取引メタデータ
608
+ products: [{"jan_code":"abc",
609
+ "name":"name1",
610
+ "unit_price":100,
611
+ "price": 100,
612
+ "is_discounted": false,
613
+ "other":"{}"}, {"jan_code":"abc",
614
+ "name":"name1",
615
+ "unit_price":100,
616
+ "price": 100,
617
+ "is_discounted": false,
618
+ "other":"{}"}], # 商品情報データ
553
619
  request_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # リクエストID
554
620
  ))
555
621
  ```
@@ -614,6 +680,150 @@ response = $client.send(Pokepay::Request::CreatePaymentTransaction.new(
614
680
 
615
681
  任意入力で、取引履歴に表示される説明文です。
616
682
 
683
+ ---
684
+ `metadata`
685
+ ```json
686
+ {
687
+ "type": "string",
688
+ "format": "json"
689
+ }
690
+ ```
691
+ 取引作成時に指定されるメタデータです。
692
+
693
+ 任意入力で、全てのkeyとvalueが文字列であるようなフラットな構造のJSON文字列で指定します。
694
+
695
+ ---
696
+ `products`
697
+ ```json
698
+ {
699
+ "type": "array",
700
+ "items": { "type": "object" }
701
+ }
702
+ ```
703
+ 一つの取引に含まれる商品情報データです。
704
+ 以下の内容からなるJSONオブジェクトの配列で指定します。
705
+
706
+ - `jan_code`: JANコード。64字以下の文字列
707
+ - `name`: 商品名。256字以下の文字列
708
+ - `unit_price`: 商品単価。0以上の数値
709
+ - `price`: 全体の金額(例: 商品単価 × 個数)。0以上の数値
710
+ - `is_discounted`: 賞味期限が近いなどの理由で商品が値引きされているかどうかのフラグ。boolean
711
+ - `other`: その他商品に関する情報。JSONオブジェクトで指定します。
712
+
713
+ ---
714
+ `request_id`
715
+ ```json
716
+ {
717
+ "type": "string",
718
+ "format": "uuid"
719
+ }
720
+ ```
721
+ 取引作成APIの羃等性を担保するためのリクエスト固有のIDです。
722
+
723
+ 取引作成APIで結果が受け取れなかったなどの理由で再試行する際に、二重に取引が作られてしまうことを防ぐために、クライアント側から指定されます。指定は任意で、UUID V4フォーマットでランダム生成した文字列です。リクエストIDは一定期間で削除されます。
724
+
725
+ リクエストIDを指定したとき、まだそのリクエストIDに対する取引がない場合、新規に取引が作られレスポンスとして返されます。もしそのリクエストIDに対する取引が既にある場合、既存の取引がレスポンスとして返されます。
726
+
727
+ ---
728
+ 成功したときは[Transaction](#transaction)オブジェクトを返します
729
+ <a name="create-cpm-transaction"></a>
730
+ #### CPMトークンによる取引作成
731
+ CPMトークンにより取引を作成します。
732
+ CPMトークンに設定されたスコープの取引を作ることができます。
733
+
734
+ ```ruby
735
+ response = $client.send(Pokepay::Request::CreateCpmTransaction.new(
736
+ "tOQ2qp6BlopujNmJIuVKWv", # cpm_token: CPMトークン
737
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # shop_id: 店舗ID
738
+ 1770, # amount: 取引金額
739
+ description: "たい焼き(小倉)", # 取引説明文
740
+ metadata: "{\"key\":\"value\"}", # 店舗側メタデータ
741
+ products: [{"jan_code":"abc",
742
+ "name":"name1",
743
+ "unit_price":100,
744
+ "price": 100,
745
+ "is_discounted": false,
746
+ "other":"{}"}], # 商品情報データ
747
+ request_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # リクエストID
748
+ ))
749
+ ```
750
+
751
+ ---
752
+ `cpm_token`
753
+ ```json
754
+ {
755
+ "type": "string",
756
+ "minLength": 22,
757
+ "maxLength": 22
758
+ }
759
+ ```
760
+ エンドユーザーによって作られ、アプリなどに表示され、店舗に対して提示される22桁の文字列です。
761
+
762
+ エンドユーザーによって許可された取引のスコープを持っています。
763
+
764
+ ---
765
+ `shop_id`
766
+ ```json
767
+ {
768
+ "type": "string",
769
+ "format": "uuid"
770
+ }
771
+ ```
772
+ 店舗IDです。
773
+
774
+ 支払いやチャージを行う店舗を指定します。
775
+
776
+ ---
777
+ `amount`
778
+ ```json
779
+ { "type": "number" }
780
+ ```
781
+ 取引金額を指定します。
782
+
783
+ 正の値を与えるとチャージになり、負の値を与えると支払いとなります。
784
+
785
+ ---
786
+ `description`
787
+ ```json
788
+ {
789
+ "type": "string",
790
+ "maxLength": 200
791
+ }
792
+ ```
793
+ 取引説明文です。
794
+
795
+ エンドユーザーアプリの取引履歴などに表示されます。
796
+
797
+ ---
798
+ `metadata`
799
+ ```json
800
+ {
801
+ "type": "string",
802
+ "format": "json"
803
+ }
804
+ ```
805
+ 取引作成時に店舗側から指定されるメタデータです。
806
+
807
+ 任意入力で、全てのkeyとvalueが文字列であるようなフラットな構造のJSON文字列で指定します。
808
+
809
+ ---
810
+ `products`
811
+ ```json
812
+ {
813
+ "type": "array",
814
+ "items": { "type": "object" }
815
+ }
816
+ ```
817
+ 一つの取引に含まれる商品情報データです。
818
+ 以下の内容からなるJSONオブジェクトの配列で指定します。
819
+
820
+ - `jan_code`: JANコード。64字以下の文字列
821
+ - `name`: 商品名。256字以下の文字列
822
+ - `unit_price`: 商品単価。0以上の数値
823
+ - `price`: 全体の金額(例: 商品単価 × 個数)。0以上の数値
824
+ - `is_discounted`: 賞味期限が近いなどの理由で商品が値引きされているかどうかのフラグ。boolean
825
+ - `other`: その他商品に関する情報。JSONオブジェクトで指定します。
826
+
617
827
  ---
618
828
  `request_id`
619
829
  ```json
@@ -640,7 +850,8 @@ response = $client.send(Pokepay::Request::CreateTransferTransaction.new(
640
850
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # sender_id: 送金元ユーザーID
641
851
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # receiver_id: 受取ユーザーID
642
852
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # private_money_id: マネーID
643
- 9515, # amount: 送金額
853
+ 1693, # amount: 送金額
854
+ metadata: "{\"key\":\"value\"}", # 取引メタデータ
644
855
  description: "たい焼き(小倉)", # 取引履歴に表示する説明文
645
856
  request_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # リクエストID
646
857
  ))
@@ -694,6 +905,18 @@ response = $client.send(Pokepay::Request::CreateTransferTransaction.new(
694
905
 
695
906
  送金するマネー額を指定します。
696
907
 
908
+ ---
909
+ `metadata`
910
+ ```json
911
+ {
912
+ "type": "string",
913
+ "format": "json"
914
+ }
915
+ ```
916
+ 取引作成時に指定されるメタデータです。
917
+
918
+ 任意入力で、全てのkeyとvalueが文字列であるようなフラットな構造のJSON文字列で指定します。
919
+
697
920
  ---
698
921
  `description`
699
922
  ```json
@@ -729,8 +952,8 @@ response = $client.send(Pokepay::Request::CreateExchangeTransaction.new(
729
952
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
730
953
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
731
954
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
732
- 4983,
733
- description: "sJQRiuvWpRkphzntqbTr2vHF1iF0Y7dBxe8hiTzwkLtzBfAa7kaQm6vULSy1FKdTtu83N0tnRGbdpbMjOs6NsjUaiDroY6Q3IK7BQ6AmswdAM3IJrwVbs9pMxfMCth",
955
+ 4287,
956
+ description: "jC0u3f2Lo9NqlV6uXM4yE9kd7lV6QKkz6REzoI7cZYW4c0GyNh6EpQVqX4KE4B5KRDxSSppVORQLy6PO73cHGKqjz0v27dHE8reh9b3v7zqeYS2n0EGsPPbvQvYkAPBJ7wmgCWNKDP",
734
957
  request_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # リクエストID
735
958
  ))
736
959
  ```
@@ -775,7 +998,14 @@ response = $client.send(Pokepay::Request::GetTransaction.new(
775
998
  ---
776
999
  成功したときは[Transaction](#transaction)オブジェクトを返します
777
1000
  <a name="refund-transaction"></a>
778
- #### 返金する
1001
+ #### 取引をキャンセルする
1002
+ 取引IDを指定して取引をキャンセルします。
1003
+
1004
+ 発行体の管理者は自組織の直営店、または発行しているマネーの決済加盟店組織での取引をキャンセルできます。
1005
+ キャンセル対象の取引に付随するポイント還元キャンペーンやクーポン適用も取り消されます。
1006
+
1007
+ チャージ取引のキャンセル時に返金すべき残高が足りないときは `account_balance_not_enough (422)` エラーが返ります。
1008
+ 取引をキャンセルできるのは1回きりです。既にキャンセルされた取引を重ねてキャンセルしようとすると `transaction_already_refunded (422)` エラーが返ります。
779
1009
  ```ruby
780
1010
  response = $client.send(Pokepay::Request::RefundTransaction.new(
781
1011
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # transaction_id: 取引ID
@@ -787,19 +1017,19 @@ response = $client.send(Pokepay::Request::RefundTransaction.new(
787
1017
  ####
788
1018
  ```ruby
789
1019
  response = $client.send(Pokepay::Request::ListTransfers.new(
790
- from: "2016-06-14T19:11:56.000000+09:00",
791
- to: "2022-09-27T00:44:53.000000+09:00",
792
- page: 3877,
793
- per_page: 9011,
1020
+ from: "2020-08-10T17:58:57.000000+09:00",
1021
+ to: "2016-03-07T12:54:00.000000+09:00",
1022
+ page: 7808,
1023
+ per_page: 1254,
794
1024
  shop_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
795
- shop_name: "EHFmQw4OmJsXraAGliEBPmHrH76ocsr7yZptwOIMGRxZLktLdV7uiWarFr5GP0wp4l70Zs",
1025
+ shop_name: "xAKZBD2FhNoFZKIbAgSoRCKxxDEWQZO9yz4Mc4BWxPS7UaVHpVi4pZYZOGKLSewvJuaN97ObUNQZ0A0Rwk2Z2omGatDjCcJfOMaGd4kHySUJYrKI48UyLazcdaqg9M9b56VUQzIG7Yr7fsBnFuG56tOVY8vi9Z9lrbTGfh4QbdPS2DfLew9jsvLcXjFRqAsdyU0EjzFGdoCEVoN09yrlyTlHcxkp2hdiJWs83eoAqvgg01z",
796
1026
  customer_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
797
- customer_name: "yPlyZYRURgUMf0P5ozHDn0iOeoWIRRMyR0nQkh8Zz7eaFGoiOPKR0rUW9UTcnGDBsZuPfABdiNvfS9Anufij6THnocikBJOkD3FvwnaI0WeOGlWmmegc1KGhe3TxnuKac7CS1DK4Gnrr3oBLGMXHrz9mqfRhRmUp8pN9pjtBKEK15Dd3XxCT0Zmu6u7tOxquneNatGol",
1027
+ customer_name: "W75gRDgWRTNwobRsB1baR1aePdc9fGHLcwyelAg5Jr7zEeO7nUDqxXj74j643AIOVakyq8QHWKNric3MBQYWsKtvnxo",
798
1028
  transaction_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
799
1029
  private_money_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
800
- is_modified: false,
801
- transaction_types: ["transfer", "exchange"],
802
- transfer_types: ["transfer", "topup", "payment", "campaign", "exchange", "coupon"], # 取引明細の種類でフィルターします。
1030
+ is_modified: true,
1031
+ transaction_types: ["exchange", "transfer", "payment", "topup"],
1032
+ transfer_types: ["campaign"], # 取引明細の種類でフィルターします。
803
1033
  description: "店頭QRコードによる支払い" # 取引詳細説明文
804
1034
  ))
805
1035
  ```
@@ -907,19 +1137,19 @@ QRコード生成時に送金元店舗のウォレット情報や、送金額な
907
1137
  支払いQRコード一覧を表示します。
908
1138
  ```ruby
909
1139
  response = $client.send(Pokepay::Request::ListBills.new(
910
- page: 4107, # ページ番号
911
- per_page: 1151, # 1ページの表示数
912
- bill_id: "yMS6WkNJ2", # 支払いQRコードのID
1140
+ page: 2029, # ページ番号
1141
+ per_page: 644, # 1ページの表示数
1142
+ bill_id: "oM94TQVFch", # 支払いQRコードのID
913
1143
  private_money_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # マネーID
914
- organization_code: "--y6-I0", # 組織コード
1144
+ organization_code: "---3w2-T--oGA-xm9", # 組織コード
915
1145
  description: "test bill", # 取引説明文
916
- created_from: "2017-06-06T23:19:55.000000+09:00", # 作成日時(起点)
917
- created_to: "2024-08-04T19:51:44.000000+09:00", # 作成日時(終点)
1146
+ created_from: "2022-10-27T03:00:12.000000+09:00", # 作成日時(起点)
1147
+ created_to: "2022-12-17T21:32:53.000000+09:00", # 作成日時(終点)
918
1148
  shop_name: "bill test shop1", # 店舗名
919
1149
  shop_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # 店舗ID
920
- lower_limit_amount: 8925, # 金額の範囲によるフィルタ(下限)
921
- upper_limit_amount: 149, # 金額の範囲によるフィルタ(上限)
922
- is_disabled: true # 支払いQRコードが無効化されているかどうか
1150
+ lower_limit_amount: 6788, # 金額の範囲によるフィルタ(下限)
1151
+ upper_limit_amount: 722, # 金額の範囲によるフィルタ(上限)
1152
+ is_disabled: false # 支払いQRコードが無効化されているかどうか
923
1153
  ))
924
1154
  ```
925
1155
 
@@ -1063,7 +1293,7 @@ response = $client.send(Pokepay::Request::ListBills.new(
1063
1293
  response = $client.send(Pokepay::Request::CreateBill.new(
1064
1294
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # private_money_id: 支払いマネーのマネーID
1065
1295
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # shop_id: 支払い先(受け取り人)の店舗ID
1066
- amount: 1855, # 支払い額
1296
+ amount: 6948, # 支払い額
1067
1297
  description: "test bill" # 説明文(アプリ上で取引の説明文として表示される)
1068
1298
  ))
1069
1299
  ```
@@ -1087,7 +1317,7 @@ response = $client.send(Pokepay::Request::CreateBill.new(
1087
1317
  ```ruby
1088
1318
  response = $client.send(Pokepay::Request::UpdateBill.new(
1089
1319
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # bill_id: 支払いQRコードのID
1090
- amount: 7862, # 支払い額
1320
+ amount: 4364, # 支払い額
1091
1321
  description: "test bill", # 説明文
1092
1322
  is_disabled: false # 無効化されているかどうか
1093
1323
  ))
@@ -1152,9 +1382,9 @@ Cashtrayを作成します。
1152
1382
  response = $client.send(Pokepay::Request::CreateCashtray.new(
1153
1383
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # private_money_id: マネーID
1154
1384
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # shop_id: 店舗ユーザーID
1155
- 2752, # amount: 金額
1385
+ 6176, # amount: 金額
1156
1386
  description: "たい焼き(小倉)", # 取引履歴に表示する説明文
1157
- expires_in: 1057 # 失効時間(秒)
1387
+ expires_in: 2660 # 失効時間(秒)
1158
1388
  ))
1159
1389
  ```
1160
1390
 
@@ -1315,9 +1545,9 @@ Cashtrayの内容を更新します。bodyパラメーターは全て省略可
1315
1545
  ```ruby
1316
1546
  response = $client.send(Pokepay::Request::UpdateCashtray.new(
1317
1547
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # cashtray_id: CashtrayのID
1318
- amount: 781, # 金額
1548
+ amount: 366, # 金額
1319
1549
  description: "たい焼き(小倉)", # 取引履歴に表示する説明文
1320
- expires_in: 1632 # 失効時間(秒)
1550
+ expires_in: 1968 # 失効時間(秒)
1321
1551
  ))
1322
1552
  ```
1323
1553
 
@@ -1423,11 +1653,11 @@ response = $client.send(Pokepay::Request::UpdateAccount.new(
1423
1653
  ```ruby
1424
1654
  response = $client.send(Pokepay::Request::ListAccountBalances.new(
1425
1655
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # account_id: ウォレットID
1426
- page: 1479, # ページ番号
1427
- per_page: 7500, # 1ページ分の取引数
1428
- expires_at_from: "2021-02-11T09:11:28.000000+09:00", # 有効期限の期間によるフィルター(開始時点)
1429
- expires_at_to: "2022-08-08T00:02:11.000000+09:00", # 有効期限の期間によるフィルター(終了時点)
1430
- direction: "asc" # 有効期限によるソート順序
1656
+ page: 6477, # ページ番号
1657
+ per_page: 9184, # 1ページ分の取引数
1658
+ expires_at_from: "2017-04-24T14:26:14.000000+09:00", # 有効期限の期間によるフィルター(開始時点)
1659
+ expires_at_to: "2024-04-06T21:34:06.000000+09:00", # 有効期限の期間によるフィルター(終了時点)
1660
+ direction: "desc" # 有効期限によるソート順序
1431
1661
  ))
1432
1662
  ```
1433
1663
 
@@ -1501,11 +1731,11 @@ response = $client.send(Pokepay::Request::ListAccountBalances.new(
1501
1731
  ```ruby
1502
1732
  response = $client.send(Pokepay::Request::ListAccountExpiredBalances.new(
1503
1733
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # account_id: ウォレットID
1504
- page: 8104, # ページ番号
1505
- per_page: 1970, # 1ページ分の取引数
1506
- expires_at_from: "2019-12-01T21:52:13.000000+09:00", # 有効期限の期間によるフィルター(開始時点)
1507
- expires_at_to: "2022-06-02T02:05:40.000000+09:00", # 有効期限の期間によるフィルター(終了時点)
1508
- direction: "desc" # 有効期限によるソート順序
1734
+ page: 6364, # ページ番号
1735
+ per_page: 3320, # 1ページ分の取引数
1736
+ expires_at_from: "2019-01-03T04:33:36.000000+09:00", # 有効期限の期間によるフィルター(開始時点)
1737
+ expires_at_to: "2025-03-06T14:10:05.000000+09:00", # 有効期限の期間によるフィルター(終了時点)
1738
+ direction: "asc" # 有効期限によるソート順序
1509
1739
  ))
1510
1740
  ```
1511
1741
 
@@ -1579,11 +1809,14 @@ response = $client.send(Pokepay::Request::ListAccountExpiredBalances.new(
1579
1809
  ```ruby
1580
1810
  response = $client.send(Pokepay::Request::GetCustomerAccounts.new(
1581
1811
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # private_money_id: マネーID
1582
- page: 3492, # ページ番号
1583
- per_page: 7179, # 1ページ分のウォレット数
1584
- created_at_from: "2019-05-15T08:37:19.000000+09:00", # ウォレット作成日によるフィルター(開始時点)
1585
- created_at_to: "2016-06-13T22:28:14.000000+09:00", # ウォレット作成日によるフィルター(終了時点)
1586
- is_suspended: false # ウォレットが凍結状態かどうかでフィルターする
1812
+ page: 6663, # ページ番号
1813
+ per_page: 6699, # 1ページ分のウォレット数
1814
+ created_at_from: "2023-01-21T06:56:24.000000+09:00", # ウォレット作成日によるフィルター(開始時点)
1815
+ created_at_to: "2018-04-22T09:42:28.000000+09:00", # ウォレット作成日によるフィルター(終了時点)
1816
+ is_suspended: false, # ウォレットが凍結状態かどうかでフィルターする
1817
+ external_id: "wbFSZ2qU3L9frpqlrETgz3O9wlyQ0TWfR4Gx21zM7WIQGDsP", # 外部ID
1818
+ tel: "0463-532236", # エンドユーザーの電話番号
1819
+ email: "JPjtVj6RA5@8jW2.com" # エンドユーザーのメールアドレス
1587
1820
  ))
1588
1821
  ```
1589
1822
 
@@ -1646,6 +1879,36 @@ response = $client.send(Pokepay::Request::GetCustomerAccounts.new(
1646
1879
  ```
1647
1880
  このパラメータが指定されている場合、ウォレットの凍結状態で結果がフィルターされます。デフォルトでは未指定です。
1648
1881
 
1882
+ ---
1883
+ `external_id`
1884
+ ```json
1885
+ {
1886
+ "type": "string",
1887
+ "maxLength": 50
1888
+ }
1889
+ ```
1890
+ 外部IDでのフィルタリングです。デフォルトでは未指定です。
1891
+
1892
+ ---
1893
+ `tel`
1894
+ ```json
1895
+ {
1896
+ "type": "string",
1897
+ "pattern": "^0[0-9]{1,3}-?[0-9]{2,4}-?[0-9]{3,4}$"
1898
+ }
1899
+ ```
1900
+ エンドユーザーの電話番号でのフィルタリングです。デフォルトでは未指定です。
1901
+
1902
+ ---
1903
+ `email`
1904
+ ```json
1905
+ {
1906
+ "type": "string",
1907
+ "format": "email"
1908
+ }
1909
+ ```
1910
+ エンドユーザーのメールアドレスでのフィルタリングです。デフォルトでは未指定です。
1911
+
1649
1912
  ---
1650
1913
  成功したときは[PaginatedAccountWithUsers](#paginated-account-with-users)オブジェクトを返します
1651
1914
  <a name="create-customer-account"></a>
@@ -1655,7 +1918,8 @@ response = $client.send(Pokepay::Request::GetCustomerAccounts.new(
1655
1918
  response = $client.send(Pokepay::Request::CreateCustomerAccount.new(
1656
1919
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # private_money_id: マネーID
1657
1920
  user_name: "ポケペイ太郎", # ユーザー名
1658
- account_name: "ポケペイ太郎のアカウント" # アカウント名
1921
+ account_name: "ポケペイ太郎のアカウント", # アカウント名
1922
+ external_id: "8noWbhryHKQAP2bBeZkmIh2UeN7Z047tEp9MnaMKkPT" # 外部ID
1659
1923
  ))
1660
1924
  ```
1661
1925
 
@@ -1691,6 +1955,16 @@ response = $client.send(Pokepay::Request::CreateCustomerAccount.new(
1691
1955
  ```
1692
1956
  作成するウォレット名です。省略した場合は空文字となります。
1693
1957
 
1958
+ ---
1959
+ `external_id`
1960
+ ```json
1961
+ {
1962
+ "type": "string",
1963
+ "maxLength": 50
1964
+ }
1965
+ ```
1966
+ PAPIクライアントシステムから利用するPokepayユーザーのIDです。デフォルトでは未指定です。
1967
+
1694
1968
  ---
1695
1969
  成功したときは[AccountWithUser](#account-with-user)オブジェクトを返します
1696
1970
  <a name="get-shop-accounts"></a>
@@ -1699,11 +1973,11 @@ response = $client.send(Pokepay::Request::CreateCustomerAccount.new(
1699
1973
  ```ruby
1700
1974
  response = $client.send(Pokepay::Request::GetShopAccounts.new(
1701
1975
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # private_money_id: マネーID
1702
- page: 6974, # ページ番号
1703
- per_page: 6258, # 1ページ分のウォレット数
1704
- created_at_from: "2021-12-09T06:29:53.000000+09:00", # ウォレット作成日によるフィルター(開始時点)
1705
- created_at_to: "2022-01-08T09:28:00.000000+09:00", # ウォレット作成日によるフィルター(終了時点)
1706
- is_suspended: false # ウォレットが凍結状態かどうかでフィルターする
1976
+ page: 1954, # ページ番号
1977
+ per_page: 1616, # 1ページ分のウォレット数
1978
+ created_at_from: "2023-12-27T10:50:24.000000+09:00", # ウォレット作成日によるフィルター(開始時点)
1979
+ created_at_to: "2015-10-22T21:26:52.000000+09:00", # ウォレット作成日によるフィルター(終了時点)
1980
+ is_suspended: true # ウォレットが凍結状態かどうかでフィルターする
1707
1981
  ))
1708
1982
  ```
1709
1983
 
@@ -1776,10 +2050,10 @@ response = $client.send(Pokepay::Request::ListCustomerTransactions.new(
1776
2050
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # private_money_id: マネーID
1777
2051
  sender_customer_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # 送金エンドユーザーID
1778
2052
  receiver_customer_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # 受取エンドユーザーID
1779
- type: "N9jftsBTkZ", # 取引種別、チャージ=topup、支払い=payment、個人間送金=transfer
1780
- is_modified: true, # キャンセル済みかどうか
1781
- from: "2019-07-11T14:20:45.000000+09:00", # 開始日時
1782
- to: "2019-01-16T06:48:10.000000+09:00", # 終了日時
2053
+ type: "XKgtixs", # 取引種別、チャージ=topup、支払い=payment、個人間送金=transfer
2054
+ is_modified: false, # キャンセル済みかどうか
2055
+ from: "2025-03-12T21:36:40.000000+09:00", # 開始日時
2056
+ to: "2021-03-13T21:54:48.000000+09:00", # 終了日時
1783
2057
  page: 1, # ページ番号
1784
2058
  per_page: 50 # 1ページ分の取引数
1785
2059
  ))
@@ -1904,11 +2178,11 @@ response = $client.send(Pokepay::Request::ListShops.new(
1904
2178
  organization_code: "pocketchange", # 組織コード
1905
2179
  private_money_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # マネーID
1906
2180
  name: "oxスーパー三田店", # 店舗名
1907
- postal_code: "9793795", # 店舗の郵便番号
2181
+ postal_code: "4920338", # 店舗の郵便番号
1908
2182
  address: "東京都港区芝...", # 店舗の住所
1909
- tel: "03-45-292", # 店舗の電話番号
1910
- email: "gXoYNaRDH3@xa5Z.com", # 店舗のメールアドレス
1911
- external_id: "Xl3L94kmDiQZVmfdCV9wG", # 店舗の外部ID
2183
+ tel: "01106454-536", # 店舗の電話番号
2184
+ email: "uhUCHWp85q@yAYW.com", # 店舗のメールアドレス
2185
+ external_id: "UJWst1yIlHOt0XiM6Qkur8SbZd3wcu", # 店舗の外部ID
1912
2186
  page: 1, # ページ番号
1913
2187
  per_page: 50 # 1ページ分の取引数
1914
2188
  ))
@@ -2033,11 +2307,11 @@ response = $client.send(Pokepay::Request::ListShops.new(
2033
2307
  ```ruby
2034
2308
  response = $client.send(Pokepay::Request::CreateShop.new(
2035
2309
  "oxスーパー三田店", # shop_name: 店舗名
2036
- shop_postal_code: "5270015", # 店舗の郵便番号
2310
+ shop_postal_code: "375-3088", # 店舗の郵便番号
2037
2311
  shop_address: "東京都港区芝...", # 店舗の住所
2038
- shop_tel: "0434-32-763", # 店舗の電話番号
2039
- shop_email: "ZmJCZwuee4@w9Rk.com", # 店舗のメールアドレス
2040
- shop_external_id: "vag9C19xRl1IlJpGXqlhd5uwOg", # 店舗の外部ID
2312
+ shop_tel: "0247-609-190", # 店舗の電話番号
2313
+ shop_email: "lQvL5t780R@8L5V.com", # 店舗のメールアドレス
2314
+ shop_external_id: "xzRQlVu0ZdkmH", # 店舗の外部ID
2041
2315
  organization_code: "ox-supermarket" # 組織コード
2042
2316
  ))
2043
2317
  ```
@@ -2047,14 +2321,14 @@ response = $client.send(Pokepay::Request::CreateShop.new(
2047
2321
  ```ruby
2048
2322
  response = $client.send(Pokepay::Request::CreateShopV2.new(
2049
2323
  "oxスーパー三田店", # name: 店舗名
2050
- postal_code: "534-0319", # 店舗の郵便番号
2324
+ postal_code: "1770589", # 店舗の郵便番号
2051
2325
  address: "東京都港区芝...", # 店舗の住所
2052
- tel: "09598-3740", # 店舗の電話番号
2053
- email: "nZxaZi9iCa@2kj9.com", # 店舗のメールアドレス
2054
- external_id: "DD4FLU53H4", # 店舗の外部ID
2326
+ tel: "06415506", # 店舗の電話番号
2327
+ email: "cQVtlOjSB3@1Mxq.com", # 店舗のメールアドレス
2328
+ external_id: "8SXpxSHJRZi52y7KvoeklIR5ig74", # 店舗の外部ID
2055
2329
  organization_code: "ox-supermarket", # 組織コード
2056
2330
  private_money_ids: ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], # 店舗で有効にするマネーIDの配列
2057
- can_topup_private_money_ids: ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"] # 店舗でチャージ可能にするマネーIDの配列
2331
+ can_topup_private_money_ids: ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"] # 店舗でチャージ可能にするマネーIDの配列
2058
2332
  ))
2059
2333
  ```
2060
2334
 
@@ -2125,13 +2399,13 @@ response = $client.send(Pokepay::Request::GetShop.new(
2125
2399
  response = $client.send(Pokepay::Request::UpdateShop.new(
2126
2400
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # shop_id: 店舗ユーザーID
2127
2401
  name: "oxスーパー三田店", # 店舗名
2128
- postal_code: "445-1656", # 店舗の郵便番号
2402
+ postal_code: "662-5422", # 店舗の郵便番号
2129
2403
  address: "東京都港区芝...", # 店舗の住所
2130
- tel: "008767500", # 店舗の電話番号
2131
- email: "SdiADG37ey@dGEN.com", # 店舗のメールアドレス
2132
- external_id: "PuSUGCPNHip0Y3", # 店舗の外部ID
2133
- private_money_ids: ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], # 店舗で有効にするマネーIDの配列
2134
- can_topup_private_money_ids: [] # 店舗でチャージ可能にするマネーIDの配列
2404
+ tel: "020-21-2482", # 店舗の電話番号
2405
+ email: "Q8WxGHxi6f@0cuW.com", # 店舗のメールアドレス
2406
+ external_id: "hxLtCHCm7yUfJm7Fg98YgjSKRGL", # 店舗の外部ID
2407
+ private_money_ids: ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], # 店舗で有効にするマネーIDの配列
2408
+ can_topup_private_money_ids: ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"] # 店舗でチャージ可能にするマネーIDの配列
2135
2409
  ))
2136
2410
  ```
2137
2411
 
@@ -2231,7 +2505,9 @@ response = $client.send(Pokepay::Request::UpdateShop.new(
2231
2505
  ユーザーIDを指定してそのユーザーのウォレット一覧を取得します。
2232
2506
  ```ruby
2233
2507
  response = $client.send(Pokepay::Request::ListUserAccounts.new(
2234
- "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # user_id: ユーザーID
2508
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # user_id: ユーザーID
2509
+ page: 7281, # ページ番号
2510
+ per_page: 7375 # 1ページ分の取引数
2235
2511
  ))
2236
2512
  ```
2237
2513
 
@@ -2248,7 +2524,62 @@ response = $client.send(Pokepay::Request::ListUserAccounts.new(
2248
2524
  指定したユーザーIDのウォレット一覧を取得します。パートナーキーと紐づく組織が発行しているマネーのウォレットのみが表示されます。
2249
2525
 
2250
2526
  ---
2251
- 成功したときは[PaginatedAccounts](#paginated-accounts)オブジェクトを返します
2527
+ `page`
2528
+ ```json
2529
+ {
2530
+ "type": "integer",
2531
+ "minimum": 1
2532
+ }
2533
+ ```
2534
+ 取得したいページ番号です。デフォルト値は1です。
2535
+
2536
+ ---
2537
+ `per_page`
2538
+ ```json
2539
+ {
2540
+ "type": "integer",
2541
+ "minimum": 1
2542
+ }
2543
+ ```
2544
+ 1ページ当たりのウォレット数です。デフォルト値は50です。
2545
+
2546
+ ---
2547
+ 成功したときは[PaginatedAccountDetails](#paginated-account-details)オブジェクトを返します
2548
+ <a name="create-user-account"></a>
2549
+ #### エンドユーザーのウォレットを作成する
2550
+ ```ruby
2551
+ response = $client.send(Pokepay::Request::CreateUserAccount.new(
2552
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # user_id: ユーザーID
2553
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # private_money_id: マネーID
2554
+ name: "x8ciNrKweGJtnGqdSp90ci6D0iGddOVzLT6tirwJLurByrAGwszVwlQAuTXTWtKg2YB5YxVquVYsbDyysRisRQ9ectqoj4yKOsEPCrpQPvSjUDltH57ysDpO4lTbJ9dqwKn5NSHIJ7mbc5qbOnYC", # ウォレット名
2555
+ external_id: "xA4AjI47p6qtIsaCpt80GzH1FR" # 外部ID
2556
+ ))
2557
+ ```
2558
+
2559
+ ---
2560
+ `user_id`
2561
+ ```json
2562
+ {
2563
+ "type": "string",
2564
+ "format": "uuid"
2565
+ }
2566
+ ```
2567
+ ユーザーIDです。
2568
+
2569
+ ---
2570
+ `private_money_id`
2571
+ ```json
2572
+ {
2573
+ "type": "string",
2574
+ "format": "uuid"
2575
+ }
2576
+ ```
2577
+ マネーIDです。
2578
+
2579
+ 作成するウォレットのマネーを指定します。このパラメータは必須です。
2580
+
2581
+ ---
2582
+ 成功したときは[AccountDetail](#account-detail)オブジェクトを返します
2252
2583
  ### Private Money
2253
2584
  <a name="get-private-moneys"></a>
2254
2585
  #### マネー一覧を取得する
@@ -2281,8 +2612,8 @@ response = $client.send(Pokepay::Request::GetPrivateMoneys.new(
2281
2612
  ```ruby
2282
2613
  response = $client.send(Pokepay::Request::GetPrivateMoneyOrganizationSummaries.new(
2283
2614
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # private_money_id: マネーID
2284
- from: "2022-03-23T13:20:28.000000+09:00", # 開始日時(toと同時に指定する必要有)
2285
- to: "2016-02-11T07:58:41.000000+09:00", # 終了日時(fromと同時に指定する必要有)
2615
+ from: "2017-09-13T23:45:00.000000+09:00", # 開始日時(toと同時に指定する必要有)
2616
+ to: "2024-11-16T14:58:53.000000+09:00", # 終了日時(fromと同時に指定する必要有)
2286
2617
  page: 1, # ページ番号
2287
2618
  per_page: 50 # 1ページ分の取引数
2288
2619
  ))
@@ -2296,10 +2627,10 @@ response = $client.send(Pokepay::Request::GetPrivateMoneyOrganizationSummaries.n
2296
2627
  CSVファイルから一括取引をします。
2297
2628
  ```ruby
2298
2629
  response = $client.send(Pokepay::Request::BulkCreateTransaction.new(
2299
- "cNdXe1sI", # name: 一括取引タスク名
2300
- "S", # content: 取引する情報のCSV
2301
- "VztCspdpKcDGU85LATApzQ2dQG1XtK0UfX1f", # request_id: リクエストID
2302
- description: "zmKZw4jAX5TdVMZA3FsBWHTaR7q8iHovbTWoPNbCUX3WmvU0lnYW7MWulxJqejEo" # 一括取引の説明
2630
+ "LcwMHaeJGFXqwAY75stQD6SAh41", # name: 一括取引タスク名
2631
+ "Zii84vy", # content: 取引する情報のCSV
2632
+ "bd1Jsf0jR3rzbwtxyn2FAh1zUedGEpNztrZH", # request_id: リクエストID
2633
+ description: "4AytTHxVvHVgjPvTnTRbAGxJFBzSBdN9rH7Ml90EeuZgaP20pyyEjfyZnRCBH" # 一括取引の説明
2303
2634
  ))
2304
2635
  ```
2305
2636
 
@@ -2364,6 +2695,155 @@ response = $client.send(Pokepay::Request::BulkCreateTransaction.new(
2364
2695
 
2365
2696
  ---
2366
2697
  成功したときは[BulkTransaction](#bulk-transaction)オブジェクトを返します
2698
+ ### Event
2699
+ <a name="create-external-transaction"></a>
2700
+ #### ポケペイ外部取引を作成する
2701
+ ポケペイ外部取引を作成します。
2702
+
2703
+ ポケペイ外の現金決済やクレジットカード決済に対してポケペイのポイントを付けたいというときに使用します。
2704
+
2705
+ ```ruby
2706
+ response = $client.send(Pokepay::Request::CreateExternalTransaction.new(
2707
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # shop_id: 店舗ID
2708
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # customer_id: エンドユーザーID
2709
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # private_money_id: マネーID
2710
+ 1937, # amount: 取引額
2711
+ description: "たい焼き(小倉)", # 取引説明文
2712
+ metadata: "pzVqBZ", # ポケペイ外部取引メタデータ
2713
+ products: [{"jan_code":"abc",
2714
+ "name":"name1",
2715
+ "unit_price":100,
2716
+ "price": 100,
2717
+ "is_discounted": false,
2718
+ "other":"{}"}, {"jan_code":"abc",
2719
+ "name":"name1",
2720
+ "unit_price":100,
2721
+ "price": 100,
2722
+ "is_discounted": false,
2723
+ "other":"{}"}], # 商品情報データ
2724
+ request_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" # リクエストID
2725
+ ))
2726
+ ```
2727
+
2728
+ ---
2729
+ `shop_id`
2730
+ ```json
2731
+ {
2732
+ "type": "string",
2733
+ "format": "uuid"
2734
+ }
2735
+ ```
2736
+ 店舗IDです。
2737
+
2738
+ ポケペイ外部取引が行なう店舗を指定します。
2739
+
2740
+ ---
2741
+ `customer_id`
2742
+ ```json
2743
+ {
2744
+ "type": "string",
2745
+ "format": "uuid"
2746
+ }
2747
+ ```
2748
+ エンドユーザーIDです。
2749
+
2750
+ エンドユーザーを指定します。
2751
+
2752
+ ---
2753
+ `private_money_id`
2754
+ ```json
2755
+ {
2756
+ "type": "string",
2757
+ "format": "uuid"
2758
+ }
2759
+ ```
2760
+ マネーIDです。
2761
+
2762
+ マネーを指定します。
2763
+
2764
+ ---
2765
+ `amount`
2766
+ ```json
2767
+ {
2768
+ "type": "number",
2769
+ "minimum": 0
2770
+ }
2771
+ ```
2772
+ 取引金額です。
2773
+
2774
+ ---
2775
+ `description`
2776
+ ```json
2777
+ {
2778
+ "type": "string",
2779
+ "maxLength": 200
2780
+ }
2781
+ ```
2782
+ 取引説明文です。
2783
+
2784
+ 任意入力で、取引履歴に表示される説明文です。
2785
+
2786
+ ---
2787
+ `metadata`
2788
+ ```json
2789
+ {
2790
+ "type": "string",
2791
+ "format": "json"
2792
+ }
2793
+ ```
2794
+ ポケペイ外部取引作成時に指定され、取引と紐付けられるメタデータです。
2795
+
2796
+ 任意入力で、全てのkeyとvalueが文字列であるようなフラットな構造のJSONで指定します。
2797
+
2798
+ ---
2799
+ `products`
2800
+ ```json
2801
+ {
2802
+ "type": "array",
2803
+ "items": { "type": "object" }
2804
+ }
2805
+ ```
2806
+ 一つの取引に含まれる商品情報データです。
2807
+ 以下の内容からなるJSONオブジェクトの配列で指定します。
2808
+
2809
+ - `jan_code`: JANコード。64字以下の文字列
2810
+ - `name`: 商品名。256字以下の文字列
2811
+ - `unit_price`: 商品単価。0以上の数値
2812
+ - `price`: 全体の金額(例: 商品単価 × 個数)。0以上の数値
2813
+ - `is_discounted`: 賞味期限が近いなどの理由で商品が値引きされているかどうかのフラグ。boolean
2814
+ - `other`: その他商品に関する情報。JSONオブジェクトで指定します。
2815
+
2816
+ ---
2817
+ `request_id`
2818
+ ```json
2819
+ {
2820
+ "type": "string",
2821
+ "format": "uuid"
2822
+ }
2823
+ ```
2824
+ 取引作成APIの羃等性を担保するためのリクエスト固有のIDです。
2825
+
2826
+ 取引作成APIで結果が受け取れなかったなどの理由で再試行する際に、二重に取引が作られてしまうことを防ぐために、クライアント側から指定されます。指定は任意で、UUID V4フォーマットでランダム生成した文字列です。リクエストIDは一定期間で削除されます。
2827
+
2828
+ リクエストIDを指定したとき、まだそのリクエストIDに対する取引がない場合、新規に取引が作られレスポンスとして返されます。もしそのリクエストIDに対する取引が既にある場合、既存の取引がレスポンスとして返されます。
2829
+
2830
+ ---
2831
+ 成功したときは[ExternalTransaction](#external-transaction)オブジェクトを返します
2832
+ <a name="refund-external-transaction"></a>
2833
+ #### ポケペイ外部取引をキャンセルする
2834
+ 取引IDを指定して取引をキャンセルします。
2835
+
2836
+ 発行体の管理者は自組織の直営店、または発行しているマネーの決済加盟店組織での取引をキャンセルできます。
2837
+ キャンセル対象のポケペイ外部取引に付随するポイント還元キャンペーンも取り消されます。
2838
+
2839
+ 取引をキャンセルできるのは1回きりです。既にキャンセルされた取引を重ねてキャンセルしようとすると `transaction_already_refunded (422)` エラーが返ります。
2840
+ ```ruby
2841
+ response = $client.send(Pokepay::Request::RefundExternalTransaction.new(
2842
+ "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", # transaction_id: 取引ID
2843
+ description: "返品対応のため" # 取引履歴に表示する返金事由
2844
+ ))
2845
+ ```
2846
+ 成功したときは[ExternalTransaction](#external-transaction)オブジェクトを返します
2367
2847
  ## Responses
2368
2848
 
2369
2849
 
@@ -2388,9 +2868,12 @@ response = $client.send(Pokepay::Request::BulkCreateTransaction.new(
2388
2868
  * `money_balance (double)`:
2389
2869
  * `point_balance (double)`:
2390
2870
  * `private_money (PrivateMoney)`:
2871
+ * `user (User)`:
2391
2872
 
2392
2873
  `private_money`は [PrivateMoney](#private-money) オブジェクトを返します。
2393
2874
 
2875
+ `user`は [User](#user) オブジェクトを返します。
2876
+
2394
2877
  <a name="bill"></a>
2395
2878
  ## Bill
2396
2879
  * `id (string)`: 支払いQRコードのID
@@ -2404,6 +2887,22 @@ response = $client.send(Pokepay::Request::BulkCreateTransaction.new(
2404
2887
 
2405
2888
  `account`は [AccountWithUser](#account-with-user) オブジェクトを返します。
2406
2889
 
2890
+ <a name="cpm-token"></a>
2891
+ ## CpmToken
2892
+ * `cpm_token (string)`:
2893
+ * `account (AccountDetail)`:
2894
+ * `transaction (Transaction)`:
2895
+ * `event (ExternalTransaction)`:
2896
+ * `scopes (array of strings)`: 許可された取引種別
2897
+ * `expires_at (string)`: CPMトークンの失効日時
2898
+ * `metadata (string)`: エンドユーザー側メタデータ
2899
+
2900
+ `account`は [AccountDetail](#account-detail) オブジェクトを返します。
2901
+
2902
+ `transaction`は [Transaction](#transaction) オブジェクトを返します。
2903
+
2904
+ `event`は [ExternalTransaction](#external-transaction) オブジェクトを返します。
2905
+
2407
2906
  <a name="cashtray"></a>
2408
2907
  ## Cashtray
2409
2908
  * `id (string)`: Cashtray自体のIDです。
@@ -2485,6 +2984,22 @@ response = $client.send(Pokepay::Request::BulkCreateTransaction.new(
2485
2984
  * `submitted_at (string)`: バルク取引が登録された日時
2486
2985
  * `updated_at (string)`: バルク取引が更新された日時
2487
2986
 
2987
+ <a name="external-transaction"></a>
2988
+ ## ExternalTransaction
2989
+ * `id (string)`: ポケペイ外部取引ID
2990
+ * `is_modified (boolean)`: 返金された取引かどうか
2991
+ * `sender (User)`: 送金者情報
2992
+ * `sender_account (Account)`: 送金ウォレット情報
2993
+ * `receiver (User)`: 受取者情報
2994
+ * `receiver_account (Account)`: 受取ウォレット情報
2995
+ * `amount (double)`: 決済額
2996
+ * `done_at (string)`: 取引日時
2997
+ * `description (string)`: 取引説明文
2998
+
2999
+ `receiver`と`sender`は [User](#user) オブジェクトを返します。
3000
+
3001
+ `receiver_account`と`sender_account`は [Account](#account) オブジェクトを返します。
3002
+
2488
3003
  <a name="paginated-private-money-organization-summaries"></a>
2489
3004
  ## PaginatedPrivateMoneyOrganizationSummaries
2490
3005
  * `rows (array of PrivateMoneyOrganizationSummaries)`:
@@ -2515,23 +3030,23 @@ response = $client.send(Pokepay::Request::BulkCreateTransaction.new(
2515
3030
 
2516
3031
  `pagination`は [Pagination](#pagination) オブジェクトを返します。
2517
3032
 
2518
- <a name="paginated-accounts"></a>
2519
- ## PaginatedAccounts
2520
- * `rows (array of Accounts)`:
3033
+ <a name="paginated-account-with-users"></a>
3034
+ ## PaginatedAccountWithUsers
3035
+ * `rows (array of AccountWithUsers)`:
2521
3036
  * `count (integer)`:
2522
3037
  * `pagination (Pagination)`:
2523
3038
 
2524
- `rows`は [Account](#account) オブジェクトの配列を返します。
3039
+ `rows`は [AccountWithUser](#account-with-user) オブジェクトの配列を返します。
2525
3040
 
2526
3041
  `pagination`は [Pagination](#pagination) オブジェクトを返します。
2527
3042
 
2528
- <a name="paginated-account-with-users"></a>
2529
- ## PaginatedAccountWithUsers
2530
- * `rows (array of AccountWithUsers)`:
3043
+ <a name="paginated-account-details"></a>
3044
+ ## PaginatedAccountDetails
3045
+ * `rows (array of AccountDetails)`:
2531
3046
  * `count (integer)`:
2532
3047
  * `pagination (Pagination)`:
2533
3048
 
2534
- `rows`は [AccountWithUser](#account-with-user) オブジェクトの配列を返します。
3049
+ `rows`は [AccountDetail](#account-detail) オブジェクトの配列を返します。
2535
3050
 
2536
3051
  `pagination`は [Pagination](#pagination) オブジェクトを返します。
2537
3052