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

# Cancel an authorized card payment

> Voids a previously authorized card transaction, releasing the reserved funds. Only transactions with status "authorized" can be cancelled.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v1/payments/{id}/cancel
openapi: 3.0.0
info:
  title: PlugToPay API
  description: API to make payments easy in multiple gateways.
  version: 1.0.0
servers:
  - url: http://localhost:7701
    description: Test Server
security: []
paths:
  /api/v1/payments/{id}/cancel:
    post:
      tags:
        - Payments
      summary: Cancel an authorized card payment
      description: >-
        Voids a previously authorized card transaction, releasing the reserved
        funds. Only transactions with status "authorized" can be cancelled.
      parameters:
        - $ref: '#/components/parameters/XClientId'
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Authorization cancelled successfully
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    example: cancelled
                  transaction_id:
                    type: string
                    example: 01hvxyz...
                  amount:
                    type: integer
                    example: 15000
                  message:
                    type: string
                    example: Authorization cancelled successfully.
                type: object
        '401':
          description: Unauthorized — Invalid API Key
        '404':
          description: Transaction not found
        '422':
          description: Validation error or transaction not cancellable
        '500':
          description: Gateway or internal error
      security:
        - ApiKeyAuth: []
components:
  parameters:
    XClientId:
      name: x-client-id
      in: header
      description: Client identifier for the company in the request.
      required: true
      schema:
        type: string
        example: client_abc123
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      description: Company API key. Send in the X-API-Key header.
      name: X-API-Key
      in: header

````