> ## 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.

# Capture API

> The Capture API is used to finalize a payment by transferring the funds that were previously authorised via the Authorsation API.

### Key Points

<Info>
  * The Capture API completes the payment process by moving the authorized funds from the customer’s account to the merchant’s account.

  * This API is typically used after an authorisation when the final amount is confirmed, such as after goods are shipped or services are provided.

  * Only the amount that was previously authorised can be captured. If the capture is for a lesser amount, the remaining funds will be released.
</Info>

## Flow diagram

<img src="https://mintcdn.com/dasdoc/kfo25CLU3J6KbVVp/images/timeline-diagram/flows-API-capture.svg?fit=max&auto=format&n=kfo25CLU3J6KbVVp&q=85&s=fe1e8e7d5bdf650e2adeaed5ff4b08eb" alt="Flow diagram image" width="1997" height="868" data-path="images/timeline-diagram/flows-API-capture.svg" />

## Api Parameters


## OpenAPI

````yaml /api-reference/en/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: API for generating Hosted Payment Page (HPP) links and processing payments.
  version: 1.0.0
servers:
  - url: https://api-dev.paymentoptions.com
security:
  - apiKeyAuth: []
    xApiKeyAuth: []
paths:
  /api/v1/server-to-server-interface/capture:
    post:
      summary: Capture a Transaction
      description: >-
        This endpoint allows merchants to capture an authorized transaction
        amount.
      operationId: captureTransaction
      requestBody:
        description: The request payload to capture a transaction.
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                transactionId:
                  type: string
                  description: The original transaction ID of the authorized transaction.
                  example: e0b0731e-7170-4b64-8a21-7d835eebd641
                  maxLength: 36
                amount:
                  type: integer
                  description: >-
                    The amount to be captured. This should not exceed the amount
                    authorized. Amount limit depends on the bank.
                  example: 1000
                merchant_id:
                  type: string
                  description: The merchant ID (DASMID).
                  example: < Merchant ID >
                  maxLength: 10
                notes:
                  type: string
                  description: The reference of the capture transaction (optional).
                  example: Capturing authorised amount
                  maxLength: 128
              required:
                - transactionId
                - amount
                - merchant_id
      responses:
        '201':
          description: Transaction captured successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: True on successful transaction, false on failure.
                    example: true
                  status_code:
                    type: integer
                    description: The status code of the transaction.
                    example: 201
                  is_live:
                    type: boolean
                    description: True if live transaction, false if test transaction.
                    example: false
                  transaction_type:
                    type: string
                    description: The transaction type (e.g., CAPTURE).
                    example: CAPTURE
                  gateway_response:
                    type: object
                    description: A JSON object containing the response from the gateway.
                    properties:
                      version:
                        type: string
                        description: The version of the gateway.
                        example: '1'
                      type:
                        type: string
                        description: Type of response (e.g., INFO).
                        example: INFO
                      message:
                        type: string
                        description: The message response from the gateway.
                        example: Amount successfully captured.
                      code:
                        type: string
                        description: Message code of the response.
                        example: INFO0001
                  merchant_details:
                    type: object
                    description: A JSON object containing the details of the merchant.
                    properties:
                      legal_name:
                        type: string
                        description: The merchant’s legal name.
                        example: Tink15 Factory
                      mid:
                        type: string
                        description: The merchant ID (DASMID).
                        example: < Merchant ID >
                      merchant_txn_ref:
                        type: string
                        description: The merchant transaction reference.
                        example: qwe
                  payment_details:
                    type: object
                    description: >-
                      A JSON object containing the payment details of the
                      transaction.
                    properties:
                      amount:
                        type: number
                        description: The amount value of the transaction.
                        example: 1000
                      response_code:
                        type: integer
                        description: The acquirer response code.
                        example: 0
                      auth_code:
                        type: string
                        description: The acquirer authorization code.
                        example: '264302'
                      currency:
                        type: string
                        description: The currency of the transaction.
                        example: JPY
                      payment_method:
                        type: string
                        description: >-
                          The payment card type (e.g., Credit Card or Debit
                          Card).
                        example: ECMC-SSL
                      scheme:
                        type: string
                        description: The card brand scheme (e.g., MASTERCARD).
                        example: MASTERCARD
                      card:
                        type: object
                        description: A JSON object containing details of the card.
                        properties:
                          name:
                            type: string
                            description: The cardholder’s name on the card.
                            example: John Doe
                          number:
                            type: string
                            description: The card number (masked).
                            example: '5200000000001005'
                          exp_month:
                            type: string
                            description: The expiry month of the card.
                            example: '12'
                          exp_year:
                            type: string
                            description: The expiry year of the card.
                            example: '29'
                      additional_data:
                        type: object
                        description: A JSON object containing additional data.
                        properties:
                          payment_data_source:
                            type: object
                            description: A JSON object containing payment data source.
                            properties:
                              type:
                                type: string
                                description: >-
                                  The type of payment data source (e.g., Card,
                                  GooglePay, ApplePay).
                                example: card
                  transaction_details:
                    type: object
                    description: A JSON object containing details of the transaction.
                    properties:
                      id:
                        type: string
                        description: The transaction ID of the transaction.
                        example: 9dfd39ec-eb4a-4f8b-a526-17abf140a717
                      ref:
                        type: integer
                        description: The authorization code of the transaction.
                        example: 74819
                      timestamp:
                        type: string
                        description: Date and time of the transaction.
                        example: '2024-11-25T08:41:15.000Z'
                      merchant_txn_ref:
                        type: string
                        description: The merchant transaction reference ID.
                        example: qwe
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      name: Authorization
      in: header
      description: 'API Key for Authorization. Format: ''Basic YOUR_API_KEY_HERE'''
    xApiKeyAuth:
      type: apiKey
      name: x-api-key
      in: header
      description: API Key specific to x-api-key.

````