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

# Capture

> Capture an authorized payment



## OpenAPI

````yaml /api-reference/openapi.en.json post /v1/payments/{id}/capture
openapi: 3.1.0
info:
  title: ZAFA PAY API
  description: Payment API platform integrating multiple PSPs
  version: 1.0.0
servers:
  - url: https://api.sandbox.zafapay.com
    description: Sandbox environment
  - url: https://api.zafapay.com
    description: Production environment
security:
  - bearerAuth: []
paths:
  /v1/payments/{id}/capture:
    post:
      tags:
        - Payments
      summary: Capture
      description: Capture an authorized payment
      operationId: capturePayment
      parameters:
        - name: id
          in: path
          required: true
          description: Transaction ID
          schema:
            type: string
            example: tx_abc123
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CaptureRequest'
      responses:
        '200':
          description: Capture successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CaptureResponse'
        '400':
          description: Capture error (already captured, etc.)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Transaction not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    CaptureRequest:
      type: object
      properties:
        amount:
          type: number
          description: >-
            Capture amount (supports up to 2 decimal places; full amount if
            omitted)
          example: 17.62
    CaptureResponse:
      type: object
      properties:
        id:
          type: string
          description: Transaction ID
          example: tx_abc123
        status:
          type: string
          description: Status
          example: completed
        amount:
          type: number
          description: Captured amount
          example: 17.62
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              description: Error type
              enum:
                - authentication_error
                - authorization_error
                - invalid_request_error
                - payment_error
                - rate_limit_error
                - api_error
              example: invalid_request_error
            code:
              type: string
              description: Error code
              example: validation_error
            message:
              type: string
              description: Error message
              example: Invalid request parameters
            param:
              type: string
              description: Parameter that caused the error
              example: amount
            details:
              type: array
              description: Validation error details
              items:
                type: object
                properties:
                  path:
                    type: array
                    items:
                      type: string
                  message:
                    type: string
            request_id:
              type: string
              description: Request ID
              example: req_abc123xyz789
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer authentication using access token

````