> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paymentoptions.com/llms.txt
> Use this file to discover all available pages before exploring further.

# キャプチャAPI

> キャプチャAPIは、以前に認証APIを通じて認可された資金を転送することにより、支払いを完了させます。

### 重要なポイント

<Info>
  * キャプチャAPIは、顧客のアカウントから加盟店のアカウントに認可された資金を移動させることにより、決済プロセスを完了させます。

  * このAPIは通常、認証後に最終金額が確認された後（商品発送後やサービス提供後など）に使用されます。

  * 以前に認可された金額のみがキャプチャできます。キャプチャ金額が少ない場合、残りの資金は返金されます。
</Info>

## フローダイアグラム

<img src="https://mintcdn.com/dasdoc/kfo25CLU3J6KbVVp/images/timeline-diagram/flows-API-capture-jp.svg?fit=max&auto=format&n=kfo25CLU3J6KbVVp&q=85&s=a84128b6405c2f141d9771448f5901ec" alt="フローダイアグラム画像" width="1997" height="868" data-path="images/timeline-diagram/flows-API-capture-jp.svg" />

## APIパラメータ


## OpenAPI

````yaml api-reference/jp/open-api-config/server-to-server/capture.json POST /api/v1/server-to-server-interface/capture
openapi: 3.0.1
info:
  title: Payment Options API
  description: ホストされた支払いページ（HPP）リンクを生成し、支払いを処理するためのAPI。
  version: 1.0.0
servers:
  - url: https://api-dev.paymentoptions.com
security:
  - apiKeyAuth: []
    xApiKeyAuth: []
paths:
  /api/v1/server-to-server-interface/capture:
    post:
      summary: 取引をキャプチャする
      description: このエンドポイントは、加盟店が承認済みの取引金額をキャプチャできるようにします。
      operationId: captureTransaction
      requestBody:
        description: 取引をキャプチャするためのリクエストペイロード。
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                transactionId:
                  type: string
                  description: 承認された取引の元の取引ID。
                  example: e0b0731e-7170-4b64-8a21-7d835eebd641
                  maxLength: 36
                amount:
                  type: integer
                  description: キャプチャする金額。これは承認された金額を超えてはなりません。金額の制限は銀行によって異なります。
                  example: 1000
                merchant_id:
                  type: string
                  description: 加盟店ID（DASMID）。
                  example: < Merchant ID >
                  maxLength: 10
                notes:
                  type: string
                  description: キャプチャ取引の参照（オプション）。
                  example: Capturing authorised amount
                  maxLength: 128
              required:
                - transactionId
                - amount
                - merchant_id
      responses:
        '201':
          description: 取引が正常にキャプチャされました。
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: 取引が成功した場合はtrue、失敗した場合はfalse。
                    example: true
                  status_code:
                    type: integer
                    description: 取引のステータスコード。
                    example: 201
                  is_live:
                    type: boolean
                    description: 本番取引の場合はtrue、テスト取引の場合はfalse。
                    example: false
                  transaction_type:
                    type: string
                    description: 取引タイプ（例：CAPTURE）。
                    example: CAPTURE
                  gateway_response:
                    type: object
                    description: ゲートウェイからの応答を含むJSONオブジェクト。
                    properties:
                      version:
                        type: string
                        description: ゲートウェイのバージョン。
                        example: '1'
                      type:
                        type: string
                        description: 応答のタイプ（例：INFO）。
                        example: INFO
                      message:
                        type: string
                        description: ゲートウェイからのメッセージ応答。
                        example: 金額が正常にキャプチャされました。
                      code:
                        type: string
                        description: 応答のメッセージコード。
                        example: INFO0001
                  merchant_details:
                    type: object
                    description: 加盟店の詳細を含むJSONオブジェクト。
                    properties:
                      legal_name:
                        type: string
                        description: 加盟店の正式名称。
                        example: Tink15 Factory
                      mid:
                        type: string
                        description: 加盟店ID（DASMID）。
                        example: < Merchant ID >
                      merchant_txn_ref:
                        type: string
                        description: 加盟店の取引参照。
                        example: qwe
                  payment_details:
                    type: object
                    description: 取引の支払い詳細を含むJSONオブジェクト。
                    properties:
                      amount:
                        type: number
                        description: 取引の金額。
                        example: 1000
                      response_code:
                        type: integer
                        description: アクワイアラー応答コード。
                        example: 0
                      auth_code:
                        type: string
                        description: アクワイアラーの認証コード。
                        example: '264302'
                      currency:
                        type: string
                        description: 取引の通貨。
                        example: JPY
                      payment_method:
                        type: string
                        description: 支払いカードの種類（例：クレジットカードまたはデビットカード）。
                        example: ECMC-SSL
                      scheme:
                        type: string
                        description: カードブランドのスキーム（例：MASTERCARD）。
                        example: MASTERCARD
                      card:
                        type: object
                        description: カードの詳細を含むJSONオブジェクト。
                        properties:
                          name:
                            type: string
                            description: カード所有者の名前。
                            example: John Doe
                          number:
                            type: string
                            description: カード番号（マスク済み）。
                            example: '5200000000001005'
                          exp_month:
                            type: string
                            description: カードの有効期限の月。
                            example: '12'
                          exp_year:
                            type: string
                            description: カードの有効期限の年。
                            example: '29'
                      additional_data:
                        type: object
                        description: 追加データを含むJSONオブジェクト。
                        properties:
                          payment_data_source:
                            type: object
                            description: 支払いデータソースを含むJSONオブジェクト。
                            properties:
                              type:
                                type: string
                                description: 支払いデータソースの種類（例：カード、GooglePay、ApplePay）。
                                example: card
                  transaction_details:
                    type: object
                    description: 取引の詳細を含むJSONオブジェクト。
                    properties:
                      id:
                        type: string
                        description: 取引のトランザクションID。
                        example: 9dfd39ec-eb4a-4f8b-a526-17abf140a717
                      ref:
                        type: integer
                        description: 取引の認証コード。
                        example: 74819
                      timestamp:
                        type: string
                        description: 取引の日付と時刻。
                        example: '2024-11-25T08:41:15.000Z'
                      merchant_txn_ref:
                        type: string
                        description: 加盟店の取引参照ID。
                        example: qwe
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      name: Authorization
      in: header
      description: 認証のためのAPIキー。形式：'Basic YOUR_API_KEY_HERE'
    xApiKeyAuth:
      type: apiKey
      name: x-api-key
      in: header
      description: x-api-key専用のAPIキー。

````