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

# Cancel transaction

> The transaction will either be aborted or the terminal will receive a cancellation notification.

<Note>
  Cancel **returns 200** before the transaction was canceled on terminal.

  It is important that the status endpoint is used for polling or webhook to confirm the status change. There might be a case where the terminal could not process cancellation or the transaction was already completed before the terminal received the cancellation.
</Note>


## OpenAPI

````yaml POST /v1/pay-connect/transactions/{transaction_id}/cancel/
openapi: 3.1.0
info:
  title: Pay-Connect API
  description: >-
    Pay-Connect is a unified payment integration platform that enables reliable
    communication between software applications and payment terminals. With a
    single integration, developers can manage terminals, execute payment
    operations, and retrieve transaction data consistently across hardware and
    platforms.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api-payment.lab4pay.com
  - url: https://api-payment.lab4pay.dev
security:
  - bearerAuth: []
paths:
  /v1/pay-connect/transactions/{transaction_id}/cancel/:
    post:
      description: >-
        The transaction will either be aborted or the terminal will receive a
        cancellation notification.
      parameters:
        - name: X-Pay-Connect-Integrator-Id
          in: header
          description: Pay-Connect Integrator ID
          required: true
          schema:
            type: string
        - name: transaction_id
          in: path
          description: ID of the transaction
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
        '500':
          description: Internal Server Error
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````