pokepay_partner_ruby_sdk 0.1.13 → 0.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/docs/index.md +614 -99
- data/lib/pokepay_partner_ruby_sdk/client.rb +24 -13
- data/lib/pokepay_partner_ruby_sdk/request/create_cpm_transaction.rb +17 -0
- data/lib/pokepay_partner_ruby_sdk/request/create_external_transaction.rb +18 -0
- data/lib/pokepay_partner_ruby_sdk/request/create_user_account.rb +15 -0
- data/lib/pokepay_partner_ruby_sdk/request/get_cpm_token.rb +15 -0
- data/lib/pokepay_partner_ruby_sdk/request/list_user_accounts.rb +4 -4
- data/lib/pokepay_partner_ruby_sdk/request/refund_external_transaction.rb +15 -0
- data/lib/pokepay_partner_ruby_sdk/response/account_detail.rb +3 -0
- data/lib/pokepay_partner_ruby_sdk/response/cashtray_attempt.rb +1 -1
- data/lib/pokepay_partner_ruby_sdk/response/cashtray_with_result.rb +2 -2
- data/lib/pokepay_partner_ruby_sdk/response/cpm_token.rb +26 -0
- data/lib/pokepay_partner_ruby_sdk/response/external_transaction.rb +31 -0
- data/lib/pokepay_partner_ruby_sdk/response/paginated_account_details.rb +16 -0
- data/lib/pokepay_partner_ruby_sdk/response/product.rb +21 -0
- data/lib/pokepay_partner_ruby_sdk/version.rb +1 -1
- data/lib/pokepay_partner_ruby_sdk.rb +9 -0
- data/partner.yaml +681 -8
- data/pokepay_partner_ruby_sdk.gemspec +3 -3
- metadata +15 -6
data/partner.yaml
CHANGED
@@ -36,6 +36,7 @@ tags:
|
|
36
36
|
- name: Account
|
37
37
|
- name: Private Money
|
38
38
|
- name: Bulk
|
39
|
+
- name: Event
|
39
40
|
|
40
41
|
components:
|
41
42
|
schemas:
|
@@ -145,6 +146,8 @@ components:
|
|
145
146
|
format: decimal
|
146
147
|
private_money:
|
147
148
|
$ref: '#/components/schemas/PrivateMoney'
|
149
|
+
user:
|
150
|
+
$ref: '#/components/schemas/User'
|
148
151
|
ShopAccount:
|
149
152
|
x-pokepay-schema-type: "response"
|
150
153
|
properties:
|
@@ -262,6 +265,40 @@ components:
|
|
262
265
|
token:
|
263
266
|
type: string
|
264
267
|
title: チャージQRコードを解析したときに出てくるURL
|
268
|
+
CpmToken:
|
269
|
+
x-pokepay-schema-type: "response"
|
270
|
+
type: object
|
271
|
+
properties:
|
272
|
+
cpm_token:
|
273
|
+
type: string
|
274
|
+
minLength: 22
|
275
|
+
maxLength: 22
|
276
|
+
account:
|
277
|
+
$ref: '#/components/schemas/AccountDetail'
|
278
|
+
transaction:
|
279
|
+
$ref: '#/components/schemas/Transaction'
|
280
|
+
nullable: true
|
281
|
+
event:
|
282
|
+
$ref: '#/components/schemas/ExternalTransaction'
|
283
|
+
nullable: true
|
284
|
+
scopes:
|
285
|
+
type: array
|
286
|
+
title: 許可された取引種別
|
287
|
+
description: エンドユーザーがCPMトークンを生成する際に指定する、CPMトークンに許可された取引の種別。
|
288
|
+
items:
|
289
|
+
type: string
|
290
|
+
enum: [payment, topup, external-transaction]
|
291
|
+
expires_at:
|
292
|
+
type: string
|
293
|
+
format: date-time
|
294
|
+
title: CPMトークンの失効日時
|
295
|
+
metadata:
|
296
|
+
type: string
|
297
|
+
format: json
|
298
|
+
title: エンドユーザー側メタデータ
|
299
|
+
description: |-
|
300
|
+
取引作成時に店舗側から指定されるメタデータです。
|
301
|
+
全てのkeyとvalueが文字列であるようなフラットな構造のJSON文字列です。
|
265
302
|
|
266
303
|
Cashtray:
|
267
304
|
x-pokepay-schema-type: "response"
|
@@ -680,6 +717,58 @@ components:
|
|
680
717
|
transaction_id:
|
681
718
|
type: string
|
682
719
|
format: uuid
|
720
|
+
ExternalTransaction:
|
721
|
+
x-pokepay-schema-type: "response"
|
722
|
+
properties:
|
723
|
+
id:
|
724
|
+
type: string
|
725
|
+
format: uuid
|
726
|
+
title: ポケペイ外部取引ID
|
727
|
+
is_modified:
|
728
|
+
type: boolean
|
729
|
+
title: 返金された取引かどうか
|
730
|
+
sender:
|
731
|
+
$ref: '#/components/schemas/User'
|
732
|
+
title: 送金者情報
|
733
|
+
sender_account:
|
734
|
+
$ref: '#/components/schemas/Account'
|
735
|
+
title: 送金ウォレット情報
|
736
|
+
receiver:
|
737
|
+
$ref: '#/components/schemas/User'
|
738
|
+
title: 受取者情報
|
739
|
+
receiver_account:
|
740
|
+
$ref: '#/components/schemas/Account'
|
741
|
+
title: 受取ウォレット情報
|
742
|
+
amount:
|
743
|
+
type: number
|
744
|
+
title: 決済額
|
745
|
+
done_at:
|
746
|
+
type: string
|
747
|
+
format: date-time
|
748
|
+
title: 取引日時
|
749
|
+
description:
|
750
|
+
type: string
|
751
|
+
title: 取引説明文
|
752
|
+
Product:
|
753
|
+
x-pokepay-schema-type: "response"
|
754
|
+
properties:
|
755
|
+
jan_code:
|
756
|
+
type: string
|
757
|
+
maxLength: 64
|
758
|
+
name:
|
759
|
+
type: string
|
760
|
+
maxLength: 256
|
761
|
+
unit_price:
|
762
|
+
type: number
|
763
|
+
minimum: 0
|
764
|
+
price:
|
765
|
+
type: number
|
766
|
+
minimum: 0
|
767
|
+
is_discounted:
|
768
|
+
type: boolean
|
769
|
+
other:
|
770
|
+
type: string
|
771
|
+
format: json
|
683
772
|
|
684
773
|
OrganizationSummary:
|
685
774
|
x-pokepay-schema-type: "response"
|
@@ -769,6 +858,18 @@ components:
|
|
769
858
|
minimum: 0
|
770
859
|
pagination:
|
771
860
|
$ref: '#/components/schemas/Pagination'
|
861
|
+
PaginatedAccountDetails:
|
862
|
+
x-pokepay-schema-type: "response"
|
863
|
+
properties:
|
864
|
+
rows:
|
865
|
+
type: array
|
866
|
+
items:
|
867
|
+
$ref: '#/components/schemas/AccountDetail'
|
868
|
+
count:
|
869
|
+
type: integer
|
870
|
+
minimum: 0
|
871
|
+
pagination:
|
872
|
+
$ref: '#/components/schemas/Pagination'
|
772
873
|
PaginatedAccountBalance:
|
773
874
|
x-pokepay-schema-type: "response"
|
774
875
|
properties:
|
@@ -915,6 +1016,20 @@ components:
|
|
915
1016
|
message:
|
916
1017
|
type: string
|
917
1018
|
|
1019
|
+
PrivateMoneyNotAvailable:
|
1020
|
+
properties:
|
1021
|
+
type:
|
1022
|
+
type: string
|
1023
|
+
pattern: '^unpermitted_private_money$'
|
1024
|
+
message:
|
1025
|
+
type: string
|
1026
|
+
example: 'This money is not available'
|
1027
|
+
object:
|
1028
|
+
type: array
|
1029
|
+
items:
|
1030
|
+
type: string
|
1031
|
+
format: uuid
|
1032
|
+
|
918
1033
|
responses:
|
919
1034
|
BadRequest:
|
920
1035
|
description: Bad Request
|
@@ -1014,19 +1129,83 @@ paths:
|
|
1014
1129
|
ユーザーIDです。
|
1015
1130
|
|
1016
1131
|
指定したユーザーIDのウォレット一覧を取得します。パートナーキーと紐づく組織が発行しているマネーのウォレットのみが表示されます。
|
1132
|
+
requestBody:
|
1133
|
+
required: true
|
1134
|
+
content:
|
1135
|
+
application/json:
|
1136
|
+
schema:
|
1137
|
+
properties:
|
1138
|
+
page:
|
1139
|
+
type: integer
|
1140
|
+
minimum: 1
|
1141
|
+
title: 'ページ番号'
|
1142
|
+
description: 取得したいページ番号です。デフォルト値は1です。
|
1143
|
+
per_page:
|
1144
|
+
type: integer
|
1145
|
+
minimum: 1
|
1146
|
+
title: '1ページ分の取引数'
|
1147
|
+
description: 1ページ当たりのウォレット数です。デフォルト値は50です。
|
1017
1148
|
responses:
|
1018
1149
|
'200':
|
1019
1150
|
description: OK
|
1020
1151
|
content:
|
1021
1152
|
application/json:
|
1022
1153
|
schema:
|
1023
|
-
$ref: '#/components/schemas/
|
1154
|
+
$ref: '#/components/schemas/PaginatedAccountDetails'
|
1024
1155
|
'400':
|
1025
1156
|
$ref: '#/components/responses/BadRequest'
|
1026
1157
|
'403':
|
1027
1158
|
$ref: '#/components/responses/Forbidden'
|
1028
1159
|
'404':
|
1029
1160
|
$ref: '#/components/responses/NotFound'
|
1161
|
+
post:
|
1162
|
+
tags:
|
1163
|
+
- Account
|
1164
|
+
summary: 'エンドユーザーのウォレットを作成する'
|
1165
|
+
x-pokepay-operator-name: "CreateUserAccount"
|
1166
|
+
x-pokepay-allow-server-side: true
|
1167
|
+
parameters:
|
1168
|
+
- in: path
|
1169
|
+
name: user_id
|
1170
|
+
required: true
|
1171
|
+
schema:
|
1172
|
+
type: string
|
1173
|
+
format: uuid
|
1174
|
+
title: 'ユーザーID'
|
1175
|
+
description: |-
|
1176
|
+
ユーザーIDです。
|
1177
|
+
requestBody:
|
1178
|
+
required: true
|
1179
|
+
content:
|
1180
|
+
application/json:
|
1181
|
+
schema:
|
1182
|
+
required: ["private_money_id"]
|
1183
|
+
properties:
|
1184
|
+
private_money_id:
|
1185
|
+
title: 'マネーID'
|
1186
|
+
description: |-
|
1187
|
+
マネーIDです。
|
1188
|
+
|
1189
|
+
作成するウォレットのマネーを指定します。このパラメータは必須です。
|
1190
|
+
type: string
|
1191
|
+
format: uuid
|
1192
|
+
name:
|
1193
|
+
title: 'ウォレット名'
|
1194
|
+
type: string
|
1195
|
+
maxLength: 256
|
1196
|
+
external_id:
|
1197
|
+
title: '外部ID'
|
1198
|
+
type: string
|
1199
|
+
maxLength: 50
|
1200
|
+
responses:
|
1201
|
+
'200':
|
1202
|
+
description: OK
|
1203
|
+
content:
|
1204
|
+
application/json:
|
1205
|
+
schema:
|
1206
|
+
$ref: '#/components/schemas/AccountDetail'
|
1207
|
+
'422':
|
1208
|
+
$ref: '#/components/responses/UnprocessableEntity'
|
1030
1209
|
/accounts/{account_id}:
|
1031
1210
|
get:
|
1032
1211
|
tags:
|
@@ -1277,6 +1456,21 @@ paths:
|
|
1277
1456
|
type: boolean
|
1278
1457
|
title: 'ウォレットが凍結状態かどうかでフィルターする'
|
1279
1458
|
description: このパラメータが指定されている場合、ウォレットの凍結状態で結果がフィルターされます。デフォルトでは未指定です。
|
1459
|
+
external_id:
|
1460
|
+
type: string
|
1461
|
+
maxLength: 50
|
1462
|
+
title: '外部ID'
|
1463
|
+
description: 外部IDでのフィルタリングです。デフォルトでは未指定です。
|
1464
|
+
tel:
|
1465
|
+
type: string
|
1466
|
+
pattern: '^0[0-9]{1,3}-?[0-9]{2,4}-?[0-9]{3,4}$'
|
1467
|
+
title: 'エンドユーザーの電話番号'
|
1468
|
+
description: エンドユーザーの電話番号でのフィルタリングです。デフォルトでは未指定です。
|
1469
|
+
email:
|
1470
|
+
type: string
|
1471
|
+
format: email
|
1472
|
+
title: 'エンドユーザーのメールアドレス'
|
1473
|
+
description: エンドユーザーのメールアドレスでのフィルタリングです。デフォルトでは未指定です。
|
1280
1474
|
responses:
|
1281
1475
|
'200':
|
1282
1476
|
description: OK
|
@@ -1327,6 +1521,12 @@ paths:
|
|
1327
1521
|
type: string
|
1328
1522
|
maxLength: 256
|
1329
1523
|
example: ポケペイ太郎のアカウント
|
1524
|
+
external_id:
|
1525
|
+
title: '外部ID'
|
1526
|
+
description: |-
|
1527
|
+
PAPIクライアントシステムから利用するPokepayユーザーのIDです。デフォルトでは未指定です。
|
1528
|
+
type: string
|
1529
|
+
maxLength: 50
|
1330
1530
|
responses:
|
1331
1531
|
'200':
|
1332
1532
|
description: OK
|
@@ -1674,6 +1874,37 @@ paths:
|
|
1674
1874
|
$ref: '#/components/schemas/Check'
|
1675
1875
|
'400':
|
1676
1876
|
$ref: '#/components/responses/InvalidParameters'
|
1877
|
+
/cpm/{cpm_token}:
|
1878
|
+
get:
|
1879
|
+
tags:
|
1880
|
+
- Transaction
|
1881
|
+
summary: 'CPMトークンの状態取得'
|
1882
|
+
description: CPMトークンの現在の状態を取得します。CPMトークンの有効期限やCPM取引の状態を返します。
|
1883
|
+
x-pokepay-operator-name: "GetCpmToken"
|
1884
|
+
x-pokepay-allow-server-side: true
|
1885
|
+
parameters:
|
1886
|
+
- in: path
|
1887
|
+
name: cpm_token
|
1888
|
+
required: true
|
1889
|
+
schema:
|
1890
|
+
type: string
|
1891
|
+
minLength: 22
|
1892
|
+
maxLength: 22
|
1893
|
+
title: CPMトークン
|
1894
|
+
description: CPM取引時にエンドユーザーが店舗に提示するバーコードを解析して得られる22桁の文字列です。
|
1895
|
+
responses:
|
1896
|
+
'200':
|
1897
|
+
description: OK
|
1898
|
+
content:
|
1899
|
+
application/json:
|
1900
|
+
schema:
|
1901
|
+
$ref: '#/components/schemas/CpmToken'
|
1902
|
+
'400':
|
1903
|
+
$ref: '#/components/responses/BadRequest'
|
1904
|
+
'403':
|
1905
|
+
$ref: '#/components/responses/Forbidden'
|
1906
|
+
'422':
|
1907
|
+
$ref: '#/components/responses/UnprocessableEntity'
|
1677
1908
|
/transactions:
|
1678
1909
|
get:
|
1679
1910
|
tags:
|
@@ -1959,6 +2190,16 @@ paths:
|
|
1959
2190
|
|
1960
2191
|
任意入力で、取引履歴に表示される説明文です。
|
1961
2192
|
example: 初夏のチャージキャンペーン
|
2193
|
+
metadata:
|
2194
|
+
type: string
|
2195
|
+
format: json
|
2196
|
+
title: '取引メタデータ'
|
2197
|
+
description: |-
|
2198
|
+
取引作成時に指定されるメタデータです。
|
2199
|
+
|
2200
|
+
任意入力で、全てのkeyとvalueが文字列であるようなフラットな構造のJSON文字列で指定します。
|
2201
|
+
example: |-
|
2202
|
+
{"key":"value"}
|
1962
2203
|
request_id:
|
1963
2204
|
type: string
|
1964
2205
|
format: uuid
|
@@ -2090,6 +2331,56 @@ paths:
|
|
2090
2331
|
|
2091
2332
|
任意入力で、取引履歴に表示される説明文です。
|
2092
2333
|
example: たい焼き(小倉)
|
2334
|
+
metadata:
|
2335
|
+
type: string
|
2336
|
+
format: json
|
2337
|
+
title: '取引メタデータ'
|
2338
|
+
description: |-
|
2339
|
+
取引作成時に指定されるメタデータです。
|
2340
|
+
|
2341
|
+
任意入力で、全てのkeyとvalueが文字列であるようなフラットな構造のJSON文字列で指定します。
|
2342
|
+
example: |-
|
2343
|
+
{"key":"value"}
|
2344
|
+
products:
|
2345
|
+
type: array
|
2346
|
+
items:
|
2347
|
+
type: object
|
2348
|
+
properties:
|
2349
|
+
jan_code:
|
2350
|
+
type: string
|
2351
|
+
maxLength: 64
|
2352
|
+
name:
|
2353
|
+
type: string
|
2354
|
+
maxLength: 256
|
2355
|
+
unit_price:
|
2356
|
+
type: number
|
2357
|
+
minimum: 0
|
2358
|
+
price:
|
2359
|
+
type: number
|
2360
|
+
minimum: 0
|
2361
|
+
is_discounted:
|
2362
|
+
type: boolean
|
2363
|
+
other:
|
2364
|
+
type: string
|
2365
|
+
format: json
|
2366
|
+
example: |-
|
2367
|
+
{"jan_code":"abc",
|
2368
|
+
"name":"name1",
|
2369
|
+
"unit_price":100,
|
2370
|
+
"price": 100,
|
2371
|
+
"is_discounted": false,
|
2372
|
+
"other":"{}"}
|
2373
|
+
title: '商品情報データ'
|
2374
|
+
description: |-
|
2375
|
+
一つの取引に含まれる商品情報データです。
|
2376
|
+
以下の内容からなるJSONオブジェクトの配列で指定します。
|
2377
|
+
|
2378
|
+
- `jan_code`: JANコード。64字以下の文字列
|
2379
|
+
- `name`: 商品名。256字以下の文字列
|
2380
|
+
- `unit_price`: 商品単価。0以上の数値
|
2381
|
+
- `price`: 全体の金額(例: 商品単価 × 個数)。0以上の数値
|
2382
|
+
- `is_discounted`: 賞味期限が近いなどの理由で商品が値引きされているかどうかのフラグ。boolean
|
2383
|
+
- `other`: その他商品に関する情報。JSONオブジェクトで指定します。
|
2093
2384
|
request_id:
|
2094
2385
|
type: string
|
2095
2386
|
format: uuid
|
@@ -2114,6 +2405,187 @@ paths:
|
|
2114
2405
|
$ref: '#/components/responses/Forbidden'
|
2115
2406
|
'422':
|
2116
2407
|
$ref: '#/components/responses/UnprocessableEntity'
|
2408
|
+
/transactions/cpm:
|
2409
|
+
post:
|
2410
|
+
tags:
|
2411
|
+
- Transaction
|
2412
|
+
summary: 'CPMトークンによる取引作成'
|
2413
|
+
description: |
|
2414
|
+
CPMトークンにより取引を作成します。
|
2415
|
+
CPMトークンに設定されたスコープの取引を作ることができます。
|
2416
|
+
x-pokepay-operator-name: "CreateCpmTransaction"
|
2417
|
+
x-pokepay-allow-server-side: true
|
2418
|
+
requestBody:
|
2419
|
+
required: true
|
2420
|
+
content:
|
2421
|
+
application/json:
|
2422
|
+
schema:
|
2423
|
+
required: ["cpm_token", "shop_id", "amount"]
|
2424
|
+
properties:
|
2425
|
+
cpm_token:
|
2426
|
+
type: string
|
2427
|
+
minLength: 22
|
2428
|
+
maxLength: 22
|
2429
|
+
title: 'CPMトークン'
|
2430
|
+
description: |-
|
2431
|
+
エンドユーザーによって作られ、アプリなどに表示され、店舗に対して提示される22桁の文字列です。
|
2432
|
+
|
2433
|
+
エンドユーザーによって許可された取引のスコープを持っています。
|
2434
|
+
shop_id:
|
2435
|
+
type: string
|
2436
|
+
format: uuid
|
2437
|
+
title: '店舗ID'
|
2438
|
+
description: |-
|
2439
|
+
店舗IDです。
|
2440
|
+
|
2441
|
+
支払いやチャージを行う店舗を指定します。
|
2442
|
+
amount:
|
2443
|
+
type: number
|
2444
|
+
title: '取引金額'
|
2445
|
+
description: |-
|
2446
|
+
取引金額を指定します。
|
2447
|
+
|
2448
|
+
正の値を与えるとチャージになり、負の値を与えると支払いとなります。
|
2449
|
+
description:
|
2450
|
+
type: string
|
2451
|
+
maxLength: 200
|
2452
|
+
title: '取引説明文'
|
2453
|
+
description: |-
|
2454
|
+
取引説明文です。
|
2455
|
+
|
2456
|
+
エンドユーザーアプリの取引履歴などに表示されます。
|
2457
|
+
example: たい焼き(小倉)
|
2458
|
+
metadata:
|
2459
|
+
type: string
|
2460
|
+
format: json
|
2461
|
+
title: '店舗側メタデータ'
|
2462
|
+
description: |-
|
2463
|
+
取引作成時に店舗側から指定されるメタデータです。
|
2464
|
+
|
2465
|
+
任意入力で、全てのkeyとvalueが文字列であるようなフラットな構造のJSON文字列で指定します。
|
2466
|
+
example: |-
|
2467
|
+
{"key":"value"}
|
2468
|
+
products:
|
2469
|
+
type: array
|
2470
|
+
items:
|
2471
|
+
type: object
|
2472
|
+
properties:
|
2473
|
+
jan_code:
|
2474
|
+
type: string
|
2475
|
+
maxLength: 64
|
2476
|
+
name:
|
2477
|
+
type: string
|
2478
|
+
maxLength: 256
|
2479
|
+
unit_price:
|
2480
|
+
type: number
|
2481
|
+
minimum: 0
|
2482
|
+
price:
|
2483
|
+
type: number
|
2484
|
+
minimum: 0
|
2485
|
+
is_discounted:
|
2486
|
+
type: boolean
|
2487
|
+
other:
|
2488
|
+
type: string
|
2489
|
+
format: json
|
2490
|
+
example: |-
|
2491
|
+
{"jan_code":"abc",
|
2492
|
+
"name":"name1",
|
2493
|
+
"unit_price":100,
|
2494
|
+
"price": 100,
|
2495
|
+
"is_discounted": false,
|
2496
|
+
"other":"{}"}
|
2497
|
+
title: 商品情報データ
|
2498
|
+
description: |-
|
2499
|
+
一つの取引に含まれる商品情報データです。
|
2500
|
+
以下の内容からなるJSONオブジェクトの配列で指定します。
|
2501
|
+
|
2502
|
+
- `jan_code`: JANコード。64字以下の文字列
|
2503
|
+
- `name`: 商品名。256字以下の文字列
|
2504
|
+
- `unit_price`: 商品単価。0以上の数値
|
2505
|
+
- `price`: 全体の金額(例: 商品単価 × 個数)。0以上の数値
|
2506
|
+
- `is_discounted`: 賞味期限が近いなどの理由で商品が値引きされているかどうかのフラグ。boolean
|
2507
|
+
- `other`: その他商品に関する情報。JSONオブジェクトで指定します。
|
2508
|
+
request_id:
|
2509
|
+
type: string
|
2510
|
+
format: uuid
|
2511
|
+
title: 'リクエストID'
|
2512
|
+
description: |-
|
2513
|
+
取引作成APIの羃等性を担保するためのリクエスト固有のIDです。
|
2514
|
+
|
2515
|
+
取引作成APIで結果が受け取れなかったなどの理由で再試行する際に、二重に取引が作られてしまうことを防ぐために、クライアント側から指定されます。指定は任意で、UUID V4フォーマットでランダム生成した文字列です。リクエストIDは一定期間で削除されます。
|
2516
|
+
|
2517
|
+
リクエストIDを指定したとき、まだそのリクエストIDに対する取引がない場合、新規に取引が作られレスポンスとして返されます。もしそのリクエストIDに対する取引が既にある場合、既存の取引がレスポンスとして返されます。
|
2518
|
+
example: '9dbfd997-b948-40d3-a3bf-6bc1a01368d2'
|
2519
|
+
responses:
|
2520
|
+
'200':
|
2521
|
+
description: OK
|
2522
|
+
content:
|
2523
|
+
application/json:
|
2524
|
+
schema:
|
2525
|
+
$ref: '#/components/schemas/Transaction'
|
2526
|
+
examples:
|
2527
|
+
example-1:
|
2528
|
+
value:
|
2529
|
+
id: 497f6eca-6276-4993-bfeb-53cbbbba6f08
|
2530
|
+
type: string
|
2531
|
+
is_modified: true
|
2532
|
+
sender:
|
2533
|
+
id: 497f6eca-6276-4993-bfeb-53cbbbba6f08
|
2534
|
+
name: string
|
2535
|
+
is_merchant: true
|
2536
|
+
sender_account:
|
2537
|
+
id: 497f6eca-6276-4993-bfeb-53cbbbba6f08
|
2538
|
+
name: string
|
2539
|
+
is_suspended: true
|
2540
|
+
private_money:
|
2541
|
+
id: 497f6eca-6276-4993-bfeb-53cbbbba6f08
|
2542
|
+
name: string
|
2543
|
+
unit: string
|
2544
|
+
is_exclusive: true
|
2545
|
+
description: string
|
2546
|
+
oneline_message: string
|
2547
|
+
organization:
|
2548
|
+
code: string
|
2549
|
+
name: string
|
2550
|
+
max_balance: 0
|
2551
|
+
transfer_limit: 0
|
2552
|
+
type: own
|
2553
|
+
expiration_type: static
|
2554
|
+
enable_topup_by_member: true
|
2555
|
+
receiver:
|
2556
|
+
id: 497f6eca-6276-4993-bfeb-53cbbbba6f08
|
2557
|
+
name: string
|
2558
|
+
is_merchant: true
|
2559
|
+
receiver_account:
|
2560
|
+
id: 497f6eca-6276-4993-bfeb-53cbbbba6f08
|
2561
|
+
name: string
|
2562
|
+
is_suspended: true
|
2563
|
+
private_money:
|
2564
|
+
id: 497f6eca-6276-4993-bfeb-53cbbbba6f08
|
2565
|
+
name: string
|
2566
|
+
unit: string
|
2567
|
+
is_exclusive: true
|
2568
|
+
description: string
|
2569
|
+
oneline_message: string
|
2570
|
+
organization:
|
2571
|
+
code: string
|
2572
|
+
name: string
|
2573
|
+
max_balance: 0
|
2574
|
+
transfer_limit: 0
|
2575
|
+
type: own
|
2576
|
+
expiration_type: static
|
2577
|
+
enable_topup_by_member: true
|
2578
|
+
amount: 0
|
2579
|
+
money_amount: 0
|
2580
|
+
point_amount: 0
|
2581
|
+
done_at: '2019-08-24T14:15:22Z'
|
2582
|
+
description: string
|
2583
|
+
'400':
|
2584
|
+
$ref: '#/components/responses/BadRequest'
|
2585
|
+
'403':
|
2586
|
+
$ref: '#/components/responses/Forbidden'
|
2587
|
+
'422':
|
2588
|
+
$ref: '#/components/responses/UnprocessableEntity'
|
2117
2589
|
/transactions/transfer:
|
2118
2590
|
post:
|
2119
2591
|
tags:
|
@@ -2163,6 +2635,16 @@ paths:
|
|
2163
2635
|
マネー額です。
|
2164
2636
|
|
2165
2637
|
送金するマネー額を指定します。
|
2638
|
+
metadata:
|
2639
|
+
type: string
|
2640
|
+
format: json
|
2641
|
+
title: '取引メタデータ'
|
2642
|
+
description: |-
|
2643
|
+
取引作成時に指定されるメタデータです。
|
2644
|
+
|
2645
|
+
任意入力で、全てのkeyとvalueが文字列であるようなフラットな構造のJSON文字列で指定します。
|
2646
|
+
example: |-
|
2647
|
+
{"key":"value"}
|
2166
2648
|
description:
|
2167
2649
|
type: string
|
2168
2650
|
maxLength: 200
|
@@ -2355,8 +2837,16 @@ paths:
|
|
2355
2837
|
post:
|
2356
2838
|
tags:
|
2357
2839
|
- Transaction
|
2358
|
-
summary: '
|
2359
|
-
|
2840
|
+
summary: '取引をキャンセルする'
|
2841
|
+
description: |-
|
2842
|
+
取引IDを指定して取引をキャンセルします。
|
2843
|
+
|
2844
|
+
発行体の管理者は自組織の直営店、または発行しているマネーの決済加盟店組織での取引をキャンセルできます。
|
2845
|
+
キャンセル対象の取引に付随するポイント還元キャンペーンやクーポン適用も取り消されます。
|
2846
|
+
|
2847
|
+
チャージ取引のキャンセル時に返金すべき残高が足りないときは `account_balance_not_enough (422)` エラーが返ります。
|
2848
|
+
取引をキャンセルできるのは1回きりです。既にキャンセルされた取引を重ねてキャンセルしようとすると `transaction_already_refunded (422)` エラーが返ります。
|
2849
|
+
x-pokepay-operator-name: RefundTransaction
|
2360
2850
|
x-pokepay-allow-server-side: true
|
2361
2851
|
parameters:
|
2362
2852
|
- in: path
|
@@ -2388,6 +2878,183 @@ paths:
|
|
2388
2878
|
$ref: '#/components/responses/Forbidden'
|
2389
2879
|
'422':
|
2390
2880
|
$ref: '#/components/responses/UnprocessableEntity'
|
2881
|
+
/external-transactions:
|
2882
|
+
post:
|
2883
|
+
tags:
|
2884
|
+
- Event
|
2885
|
+
summary: 'ポケペイ外部取引を作成する'
|
2886
|
+
description: |
|
2887
|
+
ポケペイ外部取引を作成します。
|
2888
|
+
|
2889
|
+
ポケペイ外の現金決済やクレジットカード決済に対してポケペイのポイントを付けたいというときに使用します。
|
2890
|
+
x-pokepay-operator-name: "CreateExternalTransaction"
|
2891
|
+
x-pokepay-allow-server-side: true
|
2892
|
+
requestBody:
|
2893
|
+
required: true
|
2894
|
+
content:
|
2895
|
+
application/json:
|
2896
|
+
schema:
|
2897
|
+
required:
|
2898
|
+
- private_money_id
|
2899
|
+
- shop_id
|
2900
|
+
- customer_id
|
2901
|
+
- amount
|
2902
|
+
properties:
|
2903
|
+
shop_id:
|
2904
|
+
type: string
|
2905
|
+
format: uuid
|
2906
|
+
title: 店舗ID
|
2907
|
+
description: |-
|
2908
|
+
店舗IDです。
|
2909
|
+
|
2910
|
+
ポケペイ外部取引が行なう店舗を指定します。
|
2911
|
+
customer_id:
|
2912
|
+
type: string
|
2913
|
+
format: uuid
|
2914
|
+
title: エンドユーザーID
|
2915
|
+
description: |-
|
2916
|
+
エンドユーザーIDです。
|
2917
|
+
|
2918
|
+
エンドユーザーを指定します。
|
2919
|
+
private_money_id:
|
2920
|
+
type: string
|
2921
|
+
format: uuid
|
2922
|
+
title: マネーID
|
2923
|
+
description: |-
|
2924
|
+
マネーIDです。
|
2925
|
+
|
2926
|
+
マネーを指定します。
|
2927
|
+
amount:
|
2928
|
+
type: number
|
2929
|
+
minimum: 0
|
2930
|
+
title: 取引額
|
2931
|
+
description: |-
|
2932
|
+
取引金額です。
|
2933
|
+
description:
|
2934
|
+
type: string
|
2935
|
+
maxLength: 200
|
2936
|
+
title: 取引説明文
|
2937
|
+
description: |-
|
2938
|
+
取引説明文です。
|
2939
|
+
|
2940
|
+
任意入力で、取引履歴に表示される説明文です。
|
2941
|
+
example: たい焼き(小倉)
|
2942
|
+
metadata:
|
2943
|
+
type: string
|
2944
|
+
format: json
|
2945
|
+
title: ポケペイ外部取引メタデータ
|
2946
|
+
description: |-
|
2947
|
+
ポケペイ外部取引作成時に指定され、取引と紐付けられるメタデータです。
|
2948
|
+
|
2949
|
+
任意入力で、全てのkeyとvalueが文字列であるようなフラットな構造のJSONで指定します。
|
2950
|
+
products:
|
2951
|
+
type: array
|
2952
|
+
items:
|
2953
|
+
type: object
|
2954
|
+
properties:
|
2955
|
+
jan_code:
|
2956
|
+
type: string
|
2957
|
+
maxLength: 64
|
2958
|
+
name:
|
2959
|
+
type: string
|
2960
|
+
maxLength: 256
|
2961
|
+
unit_price:
|
2962
|
+
type: number
|
2963
|
+
minimum: 0
|
2964
|
+
price:
|
2965
|
+
type: number
|
2966
|
+
minimum: 0
|
2967
|
+
is_discounted:
|
2968
|
+
type: boolean
|
2969
|
+
other:
|
2970
|
+
type: string
|
2971
|
+
format: json
|
2972
|
+
example: |-
|
2973
|
+
{"jan_code":"abc",
|
2974
|
+
"name":"name1",
|
2975
|
+
"unit_price":100,
|
2976
|
+
"price": 100,
|
2977
|
+
"is_discounted": false,
|
2978
|
+
"other":"{}"}
|
2979
|
+
title: '商品情報データ'
|
2980
|
+
description: |-
|
2981
|
+
一つの取引に含まれる商品情報データです。
|
2982
|
+
以下の内容からなるJSONオブジェクトの配列で指定します。
|
2983
|
+
|
2984
|
+
- `jan_code`: JANコード。64字以下の文字列
|
2985
|
+
- `name`: 商品名。256字以下の文字列
|
2986
|
+
- `unit_price`: 商品単価。0以上の数値
|
2987
|
+
- `price`: 全体の金額(例: 商品単価 × 個数)。0以上の数値
|
2988
|
+
- `is_discounted`: 賞味期限が近いなどの理由で商品が値引きされているかどうかのフラグ。boolean
|
2989
|
+
- `other`: その他商品に関する情報。JSONオブジェクトで指定します。
|
2990
|
+
request_id:
|
2991
|
+
type: string
|
2992
|
+
format: uuid
|
2993
|
+
title: リクエストID
|
2994
|
+
description: |-
|
2995
|
+
取引作成APIの羃等性を担保するためのリクエスト固有のIDです。
|
2996
|
+
|
2997
|
+
取引作成APIで結果が受け取れなかったなどの理由で再試行する際に、二重に取引が作られてしまうことを防ぐために、クライアント側から指定されます。指定は任意で、UUID V4フォーマットでランダム生成した文字列です。リクエストIDは一定期間で削除されます。
|
2998
|
+
|
2999
|
+
リクエストIDを指定したとき、まだそのリクエストIDに対する取引がない場合、新規に取引が作られレスポンスとして返されます。もしそのリクエストIDに対する取引が既にある場合、既存の取引がレスポンスとして返されます。
|
3000
|
+
example: 9dbfd997-b948-40d3-a3bf-6bc1a01368d2
|
3001
|
+
responses:
|
3002
|
+
'200':
|
3003
|
+
description: OK
|
3004
|
+
content:
|
3005
|
+
application/json:
|
3006
|
+
schema:
|
3007
|
+
$ref: '#/components/schemas/ExternalTransaction'
|
3008
|
+
'400':
|
3009
|
+
$ref: '#/components/responses/BadRequest'
|
3010
|
+
'403':
|
3011
|
+
$ref: '#/components/responses/Forbidden'
|
3012
|
+
'422':
|
3013
|
+
$ref: '#/components/responses/UnprocessableEntity'
|
3014
|
+
/external-transaction/{event_id}/refund:
|
3015
|
+
post:
|
3016
|
+
tags:
|
3017
|
+
- Event
|
3018
|
+
summary: 'ポケペイ外部取引をキャンセルする'
|
3019
|
+
description: |-
|
3020
|
+
取引IDを指定して取引をキャンセルします。
|
3021
|
+
|
3022
|
+
発行体の管理者は自組織の直営店、または発行しているマネーの決済加盟店組織での取引をキャンセルできます。
|
3023
|
+
キャンセル対象のポケペイ外部取引に付随するポイント還元キャンペーンも取り消されます。
|
3024
|
+
|
3025
|
+
取引をキャンセルできるのは1回きりです。既にキャンセルされた取引を重ねてキャンセルしようとすると `transaction_already_refunded (422)` エラーが返ります。
|
3026
|
+
x-pokepay-operator-name: RefundExternalTransaction
|
3027
|
+
x-pokepay-allow-server-side: true
|
3028
|
+
parameters:
|
3029
|
+
- in: path
|
3030
|
+
name: transaction_id
|
3031
|
+
required: true
|
3032
|
+
schema:
|
3033
|
+
type: string
|
3034
|
+
format: uuid
|
3035
|
+
title: '取引ID'
|
3036
|
+
requestBody:
|
3037
|
+
required: true
|
3038
|
+
content:
|
3039
|
+
application/json:
|
3040
|
+
schema:
|
3041
|
+
properties:
|
3042
|
+
description:
|
3043
|
+
type: string
|
3044
|
+
maxLength: 200
|
3045
|
+
title: '取引履歴に表示する返金事由'
|
3046
|
+
example: '返品対応のため'
|
3047
|
+
responses:
|
3048
|
+
'200':
|
3049
|
+
description: OK
|
3050
|
+
content:
|
3051
|
+
application/json:
|
3052
|
+
schema:
|
3053
|
+
$ref: '#/components/schemas/ExternalTransaction'
|
3054
|
+
'403':
|
3055
|
+
$ref: '#/components/responses/Forbidden'
|
3056
|
+
'422':
|
3057
|
+
$ref: '#/components/responses/UnprocessableEntity'
|
2391
3058
|
/transfers:
|
2392
3059
|
get:
|
2393
3060
|
tags:
|
@@ -2497,7 +3164,7 @@ paths:
|
|
2497
3164
|
type: string
|
2498
3165
|
maxLength: 32
|
2499
3166
|
title: '新規組織コード'
|
2500
|
-
example:
|
3167
|
+
example: ox-supermarket
|
2501
3168
|
name:
|
2502
3169
|
type: string
|
2503
3170
|
maxLength: 256
|
@@ -2527,7 +3194,7 @@ paths:
|
|
2527
3194
|
type: string
|
2528
3195
|
pattern: '^$|^[0-9]{4}$'
|
2529
3196
|
title: '銀行金融機関コード'
|
2530
|
-
example:
|
3197
|
+
example: '1234'
|
2531
3198
|
bank_branch_name:
|
2532
3199
|
type: string
|
2533
3200
|
maxLength: 64
|
@@ -2537,7 +3204,7 @@ paths:
|
|
2537
3204
|
type: string
|
2538
3205
|
pattern: '^(|[0-9]{3})$'
|
2539
3206
|
title: '銀行支店コード'
|
2540
|
-
example:
|
3207
|
+
example: '123'
|
2541
3208
|
bank_account_type:
|
2542
3209
|
type: string
|
2543
3210
|
enum: [saving, current, other]
|
@@ -2547,7 +3214,7 @@ paths:
|
|
2547
3214
|
maxLength: 7
|
2548
3215
|
pattern: '[0-9]{0,7}'
|
2549
3216
|
title: '銀行口座番号'
|
2550
|
-
example:
|
3217
|
+
example: '1234567'
|
2551
3218
|
bank_account_holder_name:
|
2552
3219
|
# TODO: flico
|
2553
3220
|
type: string
|
@@ -2815,7 +3482,13 @@ paths:
|
|
2815
3482
|
'409':
|
2816
3483
|
$ref: '#/components/responses/Conflict'
|
2817
3484
|
'422':
|
2818
|
-
|
3485
|
+
description:
|
3486
|
+
content:
|
3487
|
+
application/json:
|
3488
|
+
schema:
|
3489
|
+
oneOf:
|
3490
|
+
- $ref: '#/components/schemas/PrivateMoneyNotAvailable'
|
3491
|
+
- $ref: '#/components/schemas/UnprocessableEntity'
|
2819
3492
|
/shops/{shop_id}:
|
2820
3493
|
get:
|
2821
3494
|
tags:
|