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

# Capture Payment

> Captures a payment that was previously authorized by creating an intent with `manualCapture` set to `true`.



## OpenAPI

````yaml POST /payments/capture-payment
openapi: 3.0.1
info:
  title: xPay API Store
  description: ''
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.xpaycheckout.com
security:
  - basicAuth: []
paths:
  /payments/capture-payment:
    post:
      description: >-
        Captures a payment that was previously authorized by creating an intent
        with `manualCapture` set to `true`.
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        description: Capture Payment
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/capture-payment-request'
        required: true
      responses:
        '200':
          description: Capture Payment response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/capture-payment-response'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      schema:
        type: string
        maxLength: 255
        pattern: ^[a-zA-Z0-9\-_:\.]+$
      description: >-
        A unique key for making the request idempotent. Must match pattern:
        `^[a-zA-Z0-9\-_:\.]+$`. See [Idempotent
        Requests](/developer-resources/idempotency) for more details.
      example: KG5LxwFBepaKHyUD
  schemas:
    capture-payment-request:
      required:
        - intentId
      type: object
      properties:
        intentId:
          type: string
          description: Unique identifier of the previously authorized payment intent
          example: in_fooBOwYsaK50AEfK
    capture-payment-response:
      type: object
      properties:
        status:
          type: string
          description: >-
            Current status of the payment intent. Refer to [payment
            statuses](/products/one-time-payments/payment-statuses).
          example: SUCCESS
        errorCode:
          type: string
          nullable: true
          description: >-
            Machine-readable error code when the capture is unsuccessful. Refer
            to [error codes](/products/one-time-payments/error-codes).
          example: null
        errorMessage:
          type: string
          nullable: true
          description: Human-readable error message when the capture is unsuccessful.
          example: null
    Error:
      required:
        - errorCode
        - errorDescription
      type: object
      properties:
        errorCode:
          type: string
          example: bad_request
        errorDescription:
          type: string
          example: Failed to read request
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````