# NOTE: # エントリーポイントについて、x-pokepay-allow-server-side: true がついているものはサーバーサイドで正しいことが保証されているが # それ以外は存在しないか間違っているので注意 openapi: '3.0.1' info: description: >- Partner APIs title: Partner APIs version: 0.0.0 components: schemas: Pong: x-pokepay-schema-type: "response" properties: pong: type: string pattern: '^ok$' Echo: x-pokepay-schema-type: "response" properties: status: type: string pattern: '^ok$' message: type: string Pagination: x-pokepay-schema-type: "response" properties: current: type: integer per_page: type: integer minimum: 1 max_page: type: integer minimum: 1 has_prev: type: boolean has_next: type: boolean AdminUserWithShopsAndPrivateMoneys: x-pokepay-schema-type: "response" properties: id: type: string format: uuid role: type: string pattern: '^(SERVICE|ORGANIZATION|SHOP)-(MANAGER|STAFF)$' email: type: string format: email name: type: string is_active: type: boolean organization: $ref: '#/components/schemas/Organization' shops: type: array items: $ref: '#/components/schemas/User' private_moneys: type: array items: $ref: '#/components/schemas/PrivateMoney' Account: x-pokepay-schema-type: "response" properties: id: type: string format: uuid summary: 'ウォレットID' name: type: string summary: 'ウォレット名' is_suspended: type: boolean summary: 'ウォレットが凍結されているかどうか' private_money: $ref: '#/components/schemas/PrivateMoney' summary: '設定マネー情報' AccountWithUser: x-pokepay-schema-type: "response" properties: id: type: string format: uuid name: type: string is_suspended: type: boolean private_money: $ref: '#/components/schemas/PrivateMoney' user: $ref: '#/components/schemas/User' AccountDetail: x-pokepay-schema-type: "response" properties: id: type: string format: uuid name: type: string is_suspended: type: boolean balance: type: number format: decimal money_balance: type: number format: decimal point_balance: type: number format: decimal private_money: $ref: '#/components/schemas/PrivateMoney' AccountBalance: x-pokepay-schema-type: "response" properties: expires_at: type: string format: date-time money_amount: type: number format: decimal point_amount: type: number format: decimal Bill: x-pokepay-schema-type: "response" properties: id: type: string format: uuid summary: 支払いQRコードのID amount: type: number format: decimal nullable: true summary: 支払い額 description: 支払い額。支払い額未指定の場合は支払い時に任意金額を入力できます。 max_amount: type: number format: decimal nullable: true summary: 支払い額を範囲指定した場合の上限 description: 支払い額に任意金額を入力する際の上限です。 min_amount: type: number format: decimal nullable: true summary: 支払い額を範囲指定した場合の下限 description: 支払い額に任意金額を入力する際の下限です。 description: type: string summary: 支払いQRコードの説明文(アプリ上で取引の説明文として表示される) account: $ref: '#/components/schemas/AccountWithUser' summary: 支払いQRコード発行ウォレット description: 支払いQRコードを発行した店舗のウォレットです。ユーザやマネーの情報を含みます。 is_disabled: type: boolean summary: 無効化されているかどうか Check: x-pokepay-schema-type: "response" properties: id: type: string format: uuid summary: チャージQRコードのID amount: type: number format: decimal deprecated: true summary: チャージマネー額 money_amount: type: number format: decimal summary: チャージマネー額 point_amount: type: number format: decimal summary: チャージポイント額 description: type: string summary: チャージQRコードの説明文(アプリ上で取引の説明文として表示される) user: $ref: '#/components/schemas/User' summary: 送金元ユーザ情報 is_onetime: type: boolean summary: 使用回数が一回限りかどうか is_disabled: type: boolean summary: 無効化されているかどうか expires_at: type: string format: date-time summary: チャージQRコード自体の失効日時 private_money: $ref: '#/components/schemas/PrivateMoney' summary: 対象マネー情報 usage_limit: type: integer summary: 一回限りでない場合の最大読み取り回数 usage_count: type: number summary: 一回限りでない場合の現在までに読み取られた回数 token: type: string summary: チャージQRコードを解析したときに出てくるURL User: x-pokepay-schema-type: "response" properties: id: type: string format: uuid summary: 'ユーザー (または店舗) ID' name: type: string summary: 'ユーザー (または店舗) 名' is_merchant: type: boolean summary: '店舗ユーザーかどうか' PrivateMoney: x-pokepay-schema-type: "response" properties: id: type: string format: uuid summary: 'マネーID' name: type: string maxLength: 256 summary: 'マネー名' unit: type: string summary: 'マネー単位 (例: 円)' is_exclusive: type: boolean summary: '会員制のマネーかどうか' description: type: string summary: 'マネー説明文' oneline_message: type: string summary: 'マネーの要約' organization: summary: 'マネーを発行した組織' $ref: '#/components/schemas/Organization' max_balance: type: number format: decimal summary: 'ウォレットの上限金額' transfer_limit: type: number format: decimal summary: 'マネーの取引上限額' type: type: string enum: [own, third-party] summary: 'マネー種別 (自家型=own, 第三者型=third-party)' expiration_type: type: string enum: [static, last-update, last-topup-update] summary: '有効期限種別 (チャージ日起算=static, 最終利用日起算=last-update, 最終チャージ日起算=last-topup-update)' enable_topup_by_member: type: boolean nullable: true summary: '加盟店によるチャージが有効かどうか' account_image: type: string nullable: true summary: 'マネーの画像URL' Organization: x-pokepay-schema-type: "response" properties: code: type: string maxLength: 32 summary: '組織コード' name: type: string maxLength: 256 summary: '組織名' Transaction: x-pokepay-schema-type: "response" properties: id: type: string format: uuid summary: '取引ID' type: type: string summary: '取引種別 (チャージ=topup, 支払い=payment)' is_modified: type: boolean summary: '返金された取引かどうか' sender: $ref: '#/components/schemas/User' summary: '送金者情報' sender_account: $ref: '#/components/schemas/Account' summary: '送金ウォレット情報' receiver: $ref: '#/components/schemas/User' summary: '受取者情報' receiver_account: $ref: '#/components/schemas/Account' summary: '受取ウォレット情報' amount: type: number summary: '決済総額 (マネー額 + ポイント額)' money_amount: type: number summary: '決済マネー額' point_amount: type: number summary: '決済ポイント額' done_at: type: string format: date-time summary: '取引日時' description: type: string summary: '取引説明文' ShopWithMetadata: x-pokepay-schema-type: "response" properties: id: type: string format: uuid summary: 店舗ID name: type: string summary: 店舗名 organization_code: type: string maxLength: 256 summary: 組織コード postal_code: type: string nullable: true summary: '店舗の郵便番号' address: type: string nullable: true summary: '店舗の住所' tel: type: string nullable: true summary: '店舗の電話番号' email: type: string nullable: true format: email maxLength: 256 summary: '店舗のメールアドレス' external_id: type: string nullable: true maxLength: 36 summary: '店舗の外部ID' UserTransaction: x-pokepay-schema-type: "response" properties: id: type: string format: uuid user: $ref: '#/components/schemas/User' balance: type: number format: decimal amount: type: number format: decimal minimum: 0 money_amount: type: number format: decimal minimum: 0 point_amount: type: number format: decimal minimum: 0 account: $ref: '#/components/schemas/Account' description: type: string done_at: type: string format: date-time type: type: string enum: [topup, payment, transfer, exchange] is_modified: type: boolean AccountWithoutPrivateMoneyDetail: x-pokepay-schema-type: "response" properties: id: type: string format: uuid name: type: string is_suspended: type: boolean private_money_id: type: string format: uuid user: $ref: '#/components/schemas/User' Transfer: x-pokepay-schema-type: "response" properties: id: type: string format: uuid sender_account: $ref: '#/components/schemas/AccountWithoutPrivateMoneyDetail' receiver_account: $ref: '#/components/schemas/AccountWithoutPrivateMoneyDetail' amount: type: number format: decimal minimum: 0 money_amount: type: number format: decimal minimum: 0 point_amount: type: number format: decimal minimum: 0 done_at: type: string format: date-time type: type: string enum: [topup, payment, refund-topup, refund-payment, transfer, exchange-inflow, exchange-outflow] description: type: string transaction_id: type: string format: uuid OrganizationSummary: x-pokepay-schema-type: "response" properties: count: type: integer money_amount: type: number format: decimal minimum: 0 money_count: type: integer point_amount: type: number format: decimal minimum: 0 point_count: type: integer PrivateMoneyOrganizationSummary: x-pokepay-schema-type: "response" properties: organization_code: type: string pattern: '^[a-zA-Z0-9-]*$' maxLength: 32 topup: $ref: '#/components/schemas/OrganizationSummary' payment: $ref: '#/components/schemas/OrganizationSummary' PaginatedPrivateMoneyOrganizationSummaries: x-pokepay-schema-type: "response" properties: rows: type: array items: $ref: '#/components/schemas/PrivateMoneyOrganizationSummary' count: type: integer minimum: 0 pagination: $ref: '#/components/schemas/Pagination' PaginatedTransaction: x-pokepay-schema-type: "response" properties: rows: type: array items: $ref: '#/components/schemas/Transaction' count: type: integer minimum: 0 pagination: $ref: '#/components/schemas/Pagination' PaginatedTransfers: x-pokepay-schema-type: "response" properties: rows: type: array items: $ref: '#/components/schemas/Transfer' count: type: integer minimum: 0 pagination: $ref: '#/components/schemas/Pagination' PaginatedAccounts: x-pokepay-schema-type: "response" properties: rows: type: array items: $ref: '#/components/schemas/Account' count: type: integer minimum: 0 pagination: $ref: '#/components/schemas/Pagination' PaginatedAccountBalance: x-pokepay-schema-type: "response" properties: rows: type: array items: $ref: '#/components/schemas/AccountBalance' count: type: integer minimum: 0 pagination: $ref: '#/components/schemas/Pagination' PaginatedShops: x-pokepay-schema-type: "response" properties: rows: type: array items: $ref: '#/components/schemas/ShopWithMetadata' count: type: integer minimum: 0 pagination: $ref: '#/components/schemas/Pagination' PaginatedBills: x-pokepay-schema-type: "response" properties: rows: type: array items: $ref: '#/components/schemas/Bill' count: type: integer minimum: 0 pagination: $ref: '#/components/schemas/Pagination' BadRequest: x-pokepay-schema-type: "response" oneOf: - $ref: '#/components/schemas/PartnerClientNotFound' - $ref: '#/components/schemas/PartnerDecryptionFailed' - $ref: '#/components/schemas/PartnerRequestExpired' - $ref: '#/components/schemas/PartnerRequestAlreadyDone' - $ref: '#/components/schemas/InvalidParameters' PartnerClientNotFound: x-pokepay-schema-type: "response" properties: type: type: string pattern: '^partner_client_not_found$' message: type: string PartnerDecryptionFailed: x-pokepay-schema-type: "response" properties: type: type: string pattern: '^partner_decryption_failed$' message: type: string PartnerRequestExpired: x-pokepay-schema-type: "response" properties: type: type: string pattern: '^partner_request_expired$' message: type: string example: 'This request is expired.' PartnerRequestAlreadyDone: x-pokepay-schema-type: "response" properties: type: type: string pattern: '^partner_request_already_done$' message: type: string InvalidParameters: x-pokepay-schema-type: "response" properties: type: type: string pattern: '^invalid_parameter' message: type: string errors: type: object properties: missing: type: array nullable: true items: type: string invalid: type: array nullable: true items: type: string unpermitted: type: array nullable: true items: type: string Forbidden: properties: type: type: string example: forbidden message: type: string example: Forbidden NotFound: properties: type: type: string example: api_error message: type: string example: Not Found UnprocessableEntity: properties: type: type: string example: unprocessable message: type: string Conflict: properties: type: type: string message: type: string responses: BadRequest: description: Bad Request content: application/json: schema: $ref: '#/components/schemas/BadRequest' InvalidParameters: description: Invalid Parameters content: application/json: schema: $ref: '#/components/schemas/InvalidParameters' Forbidden: description: Forbidden content: application/json: schema: $ref: '#/components/schemas/Forbidden' NotFound: description: Not Found content: application/json: schema: $ref: '#/components/schemas/NotFound' UnprocessableEntity: description: Unprocessable Entity content: application/json: schema: $ref: '#/components/schemas/UnprocessableEntity' Conflict: description: Conflict content: application/json: schema: $ref: '#/components/schemas/Conflict' paths: /ping: get: responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Pong' /echo: post: x-pokepay-operator-name: "SendEcho" x-pokepay-allow-server-side: true requestBody: required: true content: application/json: schema: required: ["message"] properties: message: type: string responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Echo' '400': $ref: '#/components/responses/BadRequest' /user: get: responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/AdminUserWithShopsAndPrivateMoneys' /users/{user_id}/accounts: get: summary: 'エンドユーザー、店舗ユーザーのウォレット一覧を表示する' description: ユーザーIDを指定してそのユーザーのウォレット一覧を取得します。 x-pokepay-operator-name: "ListUserAccounts" x-pokepay-allow-server-side: true parameters: - in: path name: user_id required: true schema: type: string format: uuid summary: 'ユーザーID' description: |- ユーザーIDです。 指定したユーザーIDのウォレット一覧を取得します。パートナーキーと紐づく組織が発行しているマネーのウォレットのみが表示されます。 responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/PaginatedAccounts' '400': $ref: '#/components/responses/BadRequest' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' /accounts/{account_id}: get: summary: 'エンドユーザーのウォレット情報を表示する' description: ウォレットを取得します。 x-pokepay-operator-name: "GetAccount" x-pokepay-allow-server-side: true parameters: - in: path name: account_id required: true schema: type: string format: uuid summary: 'ウォレットID' description: |- ウォレットIDです。 フィルターとして使われ、指定したウォレットIDのウォレットを取得します。 responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/AccountDetail' '400': $ref: '#/components/responses/BadRequest' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' patch: description: ウォレットの状態を更新します。現在はウォレットの凍結/凍結解除の切り替えにのみ対応しています。 x-pokepay-operator-name: "UpdateAccount" x-pokepay-allow-server-side: true parameters: - in: path name: account_id required: true schema: type: string format: uuid description: |- ウォレットIDです。 指定したウォレットIDのウォレットの状態を更新します。 requestBody: required: true content: application/json: schema: properties: is_suspended: type: boolean description: ウォレットの凍結状態です。真にするとウォレットが凍結され、そのウォレットでは新規取引ができなくなります。偽にすると凍結解除されます。 responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/AccountDetail' '400': $ref: '#/components/responses/BadRequest' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' /accounts/{account_id}/balances: get: summary: 'エンドユーザーの残高内訳を表示する' description: エンドユーザーの残高は有効期限別のリストとして取得できます。 x-pokepay-operator-name: "ListAccountBalances" x-pokepay-allow-server-side: true parameters: - name: account_id in: path required: true schema: type: string format: uuid summary: 'ウォレットID' description: |- ウォレットIDです。 フィルターとして使われ、指定したウォレットIDのウォレット残高を取得します。 requestBody: required: true content: application/json: schema: properties: page: type: integer minimum: 1 summary: 'ページ番号' description: 取得したいページ番号です。 per_page: type: integer minimum: 1 summary: '1ページ分の取引数' description: 1ページ分のウォレット残高数です。 responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/PaginatedAccountBalance' '400': $ref: '#/components/responses/BadRequest' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' /accounts/customers: post: summary: '新規エンドユーザーウォレットを追加する' description: |- 指定したマネーのウォレットを作成し、同時にそのウォレットを保有するユーザも作成します。 x-pokepay-operator-name: "CreateCustomerAccount" x-pokepay-allow-server-side: true requestBody: required: true content: application/json: schema: required: ["private_money_id"] properties: private_money_id: summary: 'マネーID' description: |- マネーIDです。 これによって作成するウォレットのマネーを指定します。 type: string format: uuid user_name: summary: 'ユーザー名' description: |- ウォレットと共に作成するユーザ名です。省略した場合は空文字となります。 type: string maxLength: 256 example: ポケペイ太郎 account_name: summary: 'アカウント名' description: |- 作成するウォレット名です。省略した場合は空文字となります。 type: string maxLength: 256 example: ポケペイ太郎のアカウント responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/AccountWithUser' '400': $ref: '#/components/responses/BadRequest' '403': $ref: '#/components/responses/Forbidden' '422': $ref: '#/components/responses/UnprocessableEntity' /bills: get: summary: '支払いQRコード一覧を表示する' description: 支払いQRコード一覧を表示します。 x-pokepay-operator-name: "ListBills" x-pokepay-allow-server-side: true requestBody: required: true content: application/json: schema: properties: page: type: integer minimum: 1 summary: 'ページ番号' description: 取得したいページ番号です。 per_page: type: integer minimum: 1 summary: '1ページの表示数' description: 1ページに表示する支払いQRコードの数です。 bill_id: type: string summary: '支払いQRコードのID' description: 支払いQRコードのIDを指定して検索します。IDは部分一致で検索できます。 private_money_id: type: string format: uuid summary: 'マネーID' description: 支払いQRコードの送金元ウォレットのマネーIDでフィルターします。 organization_code: type: string pattern: '^[a-zA-Z0-9-]*$' maxLength: 32 summary: '組織コード' description: 支払いQRコードの送金元店舗が所属する組織の組織コードでフィルターします。 description: type: string maxLength: 200 summary: '取引説明文' description: 支払いQRコードを読み取ることで作られた取引の説明文としてアプリなどに表示されます。 example: 'test bill' created_from: type: string format: date-time summary: '作成日時(起点)' description: |- 支払いQRコードの作成日時でフィルターします。 これ以降に作成された支払いQRコードのみ一覧に表示されます。 created_to: type: string format: date-time summary: '作成日時(終点)' description: |- 支払いQRコードの作成日時でフィルターします。 これ以前に作成された支払いQRコードのみ一覧に表示されます。 shop_name: type: string maxLength: 256 summary: '店舗名' description: 支払いQRコードを作成した店舗名でフィルターします。 example: 'bill test shop1' shop_id: type: string format: uuid summary: '店舗ID' description: 支払いQRコードを作成した店舗IDでフィルターします。 lower_limit_amount: type: number minimum: 0 format: decimal summary: '金額の範囲によるフィルタ(下限)' description: 支払いQRコードの金額の下限を指定してフィルターします。 upper_limit_amount: type: number minimum: 0 format: decimal summary: '金額の範囲によるフィルタ(上限)' description: 支払いQRコードの金額の上限を指定してフィルターします。 is_disabled: type: boolean summary: '支払いQRコードが無効化されているかどうか' description: 支払いQRコードが無効化されているかどうかを表します。デフォルト値は偽(有効)です。 responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/PaginatedBills' '400': $ref: '#/components/responses/BadRequest' '403': $ref: '#/components/responses/Forbidden' /checks: post: summary: 'チャージQRコードの発行' x-pokepay-operator-name: "CreateCheck" requestBody: required: true content: application/json: schema: required: ["account_id"] x-pokepay-conditional-parameters: {or: [money_amount, point_amount]} properties: money_amount: type: number minimum: 0 format: decimal summary: '付与マネー額' point_amount: type: number minimum: 0 format: decimal summary: '付与ポイント額' account_id: type: string format: uuid summary: '送金元の店舗アカウントID' description: type: string maxLength: 200 summary: '説明文(アプリ上で取引の説明文として表示される)' example: 'test check' is_onetime: type: boolean summary: 'ワンタイムかどうか。真の場合1度読み込まれた時点でそのチャージQRは失効する(デフォルト値は真)' description: | チャージQRコードが一度の読み取りで失効するときに`true`にします。デフォルト値は`true`です。 `false`の場合、そのチャージQRコードは1ユーザについては1回きりですが、複数ユーザによって読み取り可能なQRコードになります。 usage_limit: type: integer nullable: true summary: 'ワンタイムでない場合、複数ユーザから読み取られ得る。その場合の最大読み取り回数' description: | 複数ユーザによって読み取り可能なチャージQRコードの読み取り回数に制限をつけるために指定します。 省略すると無制限に読み取り可能なチャージQRコードになります。 チャージQRコードは管理画面からいつでも無効化(有効化)することができます。 expires_at: type: string format: date-time summary: 'チャージQR自体の失効日時' point_expires_at: type: string format: date-time summary: 'チャージQRによって付与されるポイントの失効日時' point_expires_in_days: type: integer minimum: 1 summary: 'チャージQRによって付与されるポイントの有効期限(相対指定、単位は日)' example: 60 bear_point_account: type: string format: uuid summary: 'ポイント額を負担する店舗アカウントのID' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Check' '400': $ref: '#/components/responses/InvalidParameters' /transactions: get: summary: '取引履歴を取得する' description: 取引一覧を返します。 x-pokepay-operator-name: "ListTransactions" x-pokepay-allow-server-side: true requestBody: required: true content: application/json: schema: properties: from: type: string format: date-time summary: '開始日時' description: |- 抽出期間の開始日時です。 フィルターとして使われ、開始日時以降に発生した取引のみ一覧に表示されます。 to: type: string format: date-time summary: '終了日時' description: |- 抽出期間の終了日時です。 フィルターとして使われ、終了日時以前に発生した取引のみ一覧に表示されます。 page: type: integer minimum: 1 summary: 'ページ番号' description: 取得したいページ番号です。 example: 1 per_page: type: integer minimum: 1 summary: '1ページ分の取引数' description: 1ページ分の取引数です。 example: 50 shop_id: type: string format: uuid summary: '店舗ID' description: |- 店舗IDです。 フィルターとして使われ、指定された店舗での取引のみ一覧に表示されます。 customer_id: type: string format: uuid summary: 'エンドユーザーID' description: |- エンドユーザーIDです。 フィルターとして使われ、指定されたエンドユーザーでの取引のみ一覧に表示されます。 customer_name: type: string maxLength: 256 summary: 'エンドユーザー名' description: |- エンドユーザー名です。 フィルターとして使われ、入力された名前に部分一致するエンドユーザーでの取引のみ一覧に表示されます。 example: 太郎 terminal_id: type: string format: uuid summary: '端末ID' description: |- 端末IDです。 フィルターとして使われ、指定された端末での取引のみ一覧に表示されます。 transaction_id: type: string format: uuid summary: '取引ID' description: |- 取引IDです。 フィルターとして使われ、指定された取引のみ一覧に表示されます。 organization_code: type: string pattern: '^[a-zA-Z0-9-]*$' maxLength: 32 summary: '組織コード' description: |- 組織コードです。 フィルターとして使われ、指定された組織での取引のみ一覧に表示されます。 example: 'pocketchange' private_money_id: type: string format: uuid summary: 'マネーID' description: |- マネーIDです。 フィルターとして使われ、指定したマネーでの取引のみ一覧に表示されます。 is_modified: type: boolean summary: 'キャンセルフラグ' description: |- キャンセルフラグです。 これにtrueを指定するとキャンセルされた取引のみ一覧に表示されます。 デフォルト値はfalseで、キャンセルの有無にかかわらず一覧に表示されます。 types: type: array summary: '取引種別 (複数指定可)、チャージ=topup、支払い=payment' example: '["topup", "payment"]' description: |- 取引の種類でフィルターします。 以下の種類を指定できます。 1. topup 店舗からエンドユーザーへの送金取引(チャージ) 2. payment エンドユーザーから店舗への送金取引(支払い) 3. exchange-outflow   他マネーへの流出 4. exchange-inflow 他マネーからの流入 items: type: string enum: [topup, payment, exchange_outflow, exchange_inflow] responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/PaginatedTransaction' '400': $ref: '#/components/responses/InvalidParameters' post: x-pokepay-operator-name: "CreateTransaction" x-pokepay-allow-server-side: true deprecated: true requestBody: required: true content: application/json: schema: required: ["private_money_id", "shop_id", "customer_id"] properties: shop_id: type: string format: uuid customer_id: type: string format: uuid private_money_id: type: string format: uuid money_amount: type: integer format: decimal minimum: 0 point_amount: type: integer format: decimal minimum: 0 description: type: string maxLength: 200 responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Transaction' '400': $ref: '#/components/responses/BadRequest' '403': $ref: '#/components/responses/Forbidden' '422': $ref: '#/components/responses/UnprocessableEntity' /transactions/topup: post: summary: 'チャージする' description: チャージ取引を作成します。 x-pokepay-operator-name: "CreateTopupTransaction" x-pokepay-allow-server-side: true requestBody: required: true content: application/json: schema: required: ["private_money_id", "shop_id", "customer_id"] properties: shop_id: type: string format: uuid summary: '店舗ID' description: |- 店舗IDです。 送金元の店舗を指定します。 customer_id: type: string format: uuid summary: 'エンドユーザーのID' description: |- エンドユーザーIDです。 送金先のエンドユーザーを指定します。 private_money_id: type: string format: uuid summary: 'マネーID' description: |- マネーIDです。 マネーを指定します。 bear_point_shop_id: type: string format: uuid summary: 'ポイント支払時の負担店舗ID' description: |- ポイント支払時の負担店舗IDです。 ポイント支払い時に実際お金を負担する店舗を指定します。 money_amount: type: number minimum: 0 summary: 'マネー額' description: |- マネー額です。 送金するマネー額を指定します。 point_amount: type: number minimum: 0 summary: 'ポイント額' description: |- ポイント額です。 送金するポイント額を指定します。 description: type: string maxLength: 200 summary: '取引履歴に表示する説明文' description: |- 取引説明文です。 任意入力で、取引履歴に表示される説明文です。 example: 初夏のチャージキャンペーン responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Transaction' '400': $ref: '#/components/responses/BadRequest' '403': $ref: '#/components/responses/Forbidden' '422': $ref: '#/components/responses/UnprocessableEntity' /transactions/topup/check: post: summary: 'チャージQRコードを読み取ることでチャージする' description: | 通常チャージQRコードはエンドユーザのアプリによって読み取られ、アプリとポケペイサーバとの直接通信によって取引が作られます。 もしエンドユーザとの通信をパートナーのサーバのみに限定したい場合、パートナーのサーバがチャージQRの情報をエンドユーザから代理受けして、サーバ間連携APIによって実際のチャージ取引をリクエストすることになります。 エンドユーザから受け取ったチャージ用QRコードのIDをエンドユーザIDと共に渡すことでチャージ取引が作られます。 x-pokepay-operator-name: "CreateTopupTransactionWithCheck" x-pokepay-allow-server-side: true requestBody: required: true content: application/json: schema: required: ["check_id", "customer_id"] properties: check_id: type: string format: uuid summary: 'チャージ用QRコードのID' description: |- チャージ用QRコードのIDです。 QRコード生成時に送金元店舗のウォレット情報や、送金額などが登録されています。 customer_id: type: string format: uuid summary: 'エンドユーザーのID' description: |- エンドユーザーIDです。 送金先のエンドユーザーを指定します。 responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Transaction' '400': $ref: '#/components/responses/BadRequest' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '422': $ref: '#/components/responses/UnprocessableEntity' /transactions/payment: post: summary: '支払いする' description: | 支払取引を作成します。 支払い時には、エンドユーザーの残高のうち、ポイント残高から優先的に消費されます。 x-pokepay-operator-name: "CreatePaymentTransaction" x-pokepay-allow-server-side: true requestBody: required: true content: application/json: schema: required: ["private_money_id", "shop_id", "customer_id", "amount"] properties: shop_id: type: string format: uuid summary: '店舗ID' description: |- 店舗IDです。 送金先の店舗を指定します。 customer_id: type: string format: uuid summary: 'エンドユーザーID' description: |- エンドユーザーIDです。 送金元のエンドユーザーを指定します。 private_money_id: type: string format: uuid summary: 'マネーID' description: |- マネーIDです。 マネーを指定します。 amount: type: number minimum: 0 summary: '支払い額' description: |- マネー額です。 送金するマネー額を指定します。 description: type: string maxLength: 200 summary: '取引履歴に表示する説明文' description: |- 取引説明文です。 任意入力で、取引履歴に表示される説明文です。 example: たい焼き(小倉) responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Transaction' '400': $ref: '#/components/responses/BadRequest' '403': $ref: '#/components/responses/Forbidden' '422': $ref: '#/components/responses/UnprocessableEntity' /transactions/transfer: post: summary: '個人間送金' description: | エンドユーザー間での送金取引(個人間送金)を作成します。 個人間送金で送れるのはマネーのみで、ポイントを送ることはできません。送金元のマネー残高のうち、有効期限が最も遠いものから順に送金されます。 x-pokepay-operator-name: "CreateTransferTransaction" x-pokepay-allow-server-side: true requestBody: required: true content: application/json: schema: required: ["private_money_id", "sender_id", "receiver_id", "amount"] properties: sender_id: type: string format: uuid summary: '送金元ユーザーID' description: |- エンドユーザーIDです。 送金元のエンドユーザー(送り主)を指定します。 receiver_id: type: string format: uuid summary: '受取ユーザーID' description: |- エンドユーザーIDです。 送金先のエンドユーザー(受け取り人)を指定します。 private_money_id: type: string format: uuid summary: 'マネーID' description: |- マネーIDです。 マネーを指定します。 amount: type: number minimum: 0 summary: '送金額' description: |- マネー額です。 送金するマネー額を指定します。 description: type: string maxLength: 200 summary: '取引履歴に表示する説明文' description: |- 取引説明文です。 任意入力で、取引履歴に表示される説明文です。 example: たい焼き(小倉) responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Transaction' '400': $ref: '#/components/responses/BadRequest' '403': $ref: '#/components/responses/Forbidden' '422': $ref: '#/components/responses/UnprocessableEntity' /transactions/exchange: post: x-pokepay-allow-server-side: true requestBody: required: true content: application/json: schema: required: ["user_id", "sender_private_money_id", "receiver_private_money_id", "amount"] properties: user_id: type: string format: uuid sender_private_money_id: type: string format: uuid receiver_private_money_id: type: string format: uuid amount: type: number minimum: 1 description: type: string maxLength: 200 responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Transaction' '400': $ref: '#/components/responses/BadRequest' '422': $ref: '#/components/responses/UnprocessableEntity' /transactions/{transaction_id}: get: summary: '取引情報を取得する' description: 取引を取得します。 x-pokepay-operator-name: "GetTransaction" x-pokepay-allow-server-side: true parameters: - in: path name: transaction_id required: true schema: type: string format: uuid summary: '取引ID' description: |- 取引IDです。 フィルターとして使われ、指定した取引IDの取引を取得します。 responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Transaction' '400': $ref: '#/components/responses/InvalidParameters' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' /transactions/{transaction_id}/refund: post: summary: 返金する x-pokepay-operator-name: RefundTransaction parameters: - in: path name: transaction_id required: true schema: type: string format: uuid summary: '取引ID' requestBody: required: true content: application/json: schema: properties: description: type: string maxLength: 200 summary: '取引履歴に表示する返金事由' example: '返品対応のため' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Transfer' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '422': $ref: '#/components/responses/UnprocessableEntity' /transfers: get: x-pokepay-operator-name: "ListTransfers" x-pokepay-allow-server-side: true requestBody: required: true content: application/json: schema: properties: from: type: string format: date-time to: type: string format: date-time page: type: integer minimum: 1 per_page: type: integer minimum: 1 shop_id: type: string format: uuid shop_name: type: string maxLength: 256 customer_id: type: string format: uuid customer_name: type: string maxLength: 256 transaction_id: type: string format: uuid private_money_id: type: string format: uuid is_modified: type: boolean transaction_types: type: array items: type: string enum: [topup, payment, transfer, exchange] transfer_types: type: array items: type: string enum: [topup, payment, exchange, transfer] responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/PaginatedTransfers' '400': $ref: '#/components/responses/InvalidParameters' /organizations: post: summary: '新規加盟店組織を追加する' x-pokepay-operator-name: "CreateOrganization" requestBody: required: true content: application/json: schema: required: ["code", "name", "private_money_ids", "issuer_admin_user_email", "member_admin_user_email"] properties: code: type: string maxLength: 32 summary: '新規組織コード' example: ox_supermarket name: type: string maxLength: 256 summary: '新規組織名' example: oxスーパー private_money_ids: type: array items: type: string format: uuid minItems: 1 summary: '加盟店組織で有効にするマネーIDの配列' issuer_admin_user_email: type: string format: email summary: '発行体担当者メールアドレス' member_admin_user_email: type: string format: email summary: '新規組織担当者メールアドレス' bank_name: type: string maxLength: 64 summary: '銀行名' example: XYZ銀行 bank_code: type: string pattern: '^$|^[0-9]{4}$' summary: '銀行金融機関コード' example: 99X bank_branch_name: type: string maxLength: 64 summary: '銀行支店名' example: ABC支店 bank_branch_code: type: string pattern: '^(|[0-9]{3})$' summary: '銀行支店コード' example: 99X bank_account_type: type: string enum: [saving, current, other] summary: '銀行口座種別 (普通=saving, 当座=current, その他=other)' bank_account: type: string maxLength: 7 pattern: '[0-9]{0,7}' summary: '銀行口座番号' example: 9999999 bank_account_holder_name: # TODO: flico type: string maxLength: 30 pattern: '^[0-9A-Zヲア-゚ (-),-/\\「-」]$' summary: '口座名義人名' example: フクザワユキチ contact_name: type: string maxLength: 256 summary: '担当者名' example: 佐藤清 responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Organization' /shops: get: summary: '店舗一覧を取得する' x-pokepay-operator-name: "ListShops" x-pokepay-allow-server-side: true requestBody: required: true content: application/json: schema: properties: organization_code: type: string pattern: '^[a-zA-Z0-9-]*$' maxLength: 32 summary: '組織コード' description: | このパラメータを渡すとその組織の店舗のみが返され、省略すると加盟店も含む店舗が返されます。 example: 'pocketchange' private_money_id: type: string format: uuid summary: 'マネーID' description: | このパラメータを渡すとそのマネーのウォレットを持つ店舗のみが返されます。 page: type: integer minimum: 1 summary: 'ページ番号' description: 取得したいページ番号です。 example: 1 per_page: type: integer minimum: 1 summary: '1ページ分の取引数' description: 1ページ分の取引数です。 example: 50 responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/PaginatedShops' '400': $ref: '#/components/responses/BadRequest' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' '422': $ref: '#/components/responses/UnprocessableEntity' post: summary: '新規店舗を追加する' x-pokepay-operator-name: "CreateShop" x-pokepay-allow-server-side: true requestBody: required: true content: application/json: schema: required: ["shop_name"] properties: shop_name: type: string minLength: 1 maxLength: 256 summary: '店舗名' example: 'oxスーパー三田店' shop_postal_code: type: string pattern: '^[0-9]{3}-?[0-9]{4}$' summary: '店舗の郵便番号' shop_address: type: string maxLength: 256 summary: '店舗の住所' example: '東京都港区芝...' shop_tel: type: string pattern: '^0[0-9]{1,3}-?[0-9]{2,4}-?[0-9]{3,4}$' summary: '店舗の電話番号' shop_email: type: string format: email maxLength: 256 summary: '店舗のメールアドレス' shop_external_id: type: string maxLength: 36 summary: '店舗の外部ID' organization_code: type: string pattern: '^[a-zA-Z0-9-]*$' maxLength: 32 summary: '組織コード' example: 'ox-supermarket' responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/User' '400': $ref: '#/components/responses/InvalidParameters' '403': $ref: '#/components/responses/Forbidden' '409': $ref: '#/components/responses/Conflict' '422': $ref: '#/components/responses/UnprocessableEntity' /private-moneys/{private_money_id}/organization-summaries: get: summary: 決済加盟店の取引サマリを取得する x-pokepay-operator-name: "GetPrivateMoneyOrganizationSummaries" x-pokepay-allow-server-side: true requestBody: required: true content: application/json: schema: x-pokepay-conditional-parameters: {xnor: [from, to]} properties: from: type: string format: date-time summary: '開始日時(toと同時に指定する必要有)' to: type: string format: date-time summary: '終了日時(fromと同時に指定する必要有)' page: type: integer minimum: 1 summary: 'ページ番号' example: 1 per_page: type: integer minimum: 1 summary: '1ページ分の取引数' example: 50 parameters: - in: path name: private_money_id required: true schema: type: string format: uuid summary: マネーID responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/PaginatedPrivateMoneyOrganizationSummaries' '400': $ref: '#/components/responses/InvalidParameters' '403': $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound'