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

# Cancel a Payment

> Withdraw a payment while it can still be taken back — before anything has
been sent to the bank. Three moments qualify:

- it is parked for review (`pending_review`);
- it is approved but not yet executed (`pending`);
- it is `processing` but still queued on our side — for example a same-day
  payment created after the day's last cutoff, waiting for the next window.

The funds return where they came from: a deposit's expected credit is
cancelled, a payout's reserved amount is released back to the wallet. The
payment ends `voided` with `failure_reason: cancelled_by_platform`, a
`payment_intent.voided` webhook is sent, and the payment is returned as
`GET /platform/payments/{payment_id}` shows it. Cancelling a payment you
already cancelled returns it again.

A payment that has already been sent, charged, settled or otherwise finished
is refused with `payment_not_cancellable`; `reason` says why (`in_progress`,
`already_settled`, …). Card payments have their own reversal paths and are
refused here.



## OpenAPI

````yaml POST /v1/platform/payments/{payment_id}/cancel
openapi: 3.1.0
info:
  title: Finogate Platform API v1
  version: 0.1.0
servers:
  - url: https://api-sandbox.finogates.com
    description: Sandbox
  - url: https://api.finogates.com
    description: Production
security: []
tags:
  - name: auth
  - name: users
  - name: payees
  - name: verification
  - name: bank accounts
  - name: card processing
  - name: digital-assets
  - name: international
  - name: fees
  - name: onboarding
  - name: Redirect URLs
  - name: pending-applications
  - name: wallets
  - name: payments
  - name: document mailing
  - name: merchant onboarding
  - name: catalog
  - name: webhooks
  - name: screening
  - name: Platform - File Scanning
  - name: phone-numbers
  - name: sms
  - name: calls
  - name: listings
  - name: Card Transfers
  - name: Accounting
  - name: embed-tokens
paths:
  /v1/platform/payments/{payment_id}/cancel:
    post:
      tags:
        - payments
      summary: Cancel a payment that has not reached the bank
      description: >-
        Withdraw a payment while it can still be taken back — before anything
        has

        been sent to the bank. Three moments qualify:


        - it is parked for review (`pending_review`);

        - it is approved but not yet executed (`pending`);

        - it is `processing` but still queued on our side — for example a
        same-day
          payment created after the day's last cutoff, waiting for the next window.

        The funds return where they came from: a deposit's expected credit is

        cancelled, a payout's reserved amount is released back to the wallet.
        The

        payment ends `voided` with `failure_reason: cancelled_by_platform`, a

        `payment_intent.voided` webhook is sent, and the payment is returned as

        `GET /platform/payments/{payment_id}` shows it. Cancelling a payment you

        already cancelled returns it again.


        A payment that has already been sent, charged, settled or otherwise
        finished

        is refused with `payment_not_cancellable`; `reason` says why
        (`in_progress`,

        `already_settled`, …). Card payments have their own reversal paths and
        are

        refused here.
      operationId: cancel_payment_transaction_v1_platform_payments__payment_id__cancel_post
      parameters:
        - name: payment_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: The payment to cancel.
            title: Payment Id
          description: The payment to cancel.
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/PaymentCancelCreate'
                - type: 'null'
              title: Payload
      responses:
        '200':
          description: Payment cancelled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommonResponse'
              example:
                status_code: 200
                data:
                  payment_id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                  status: voided
                  failure_reason: cancelled_by_platform
                  amount: 250
                  currency: USD
                  intent_type: payout
                query_generated_time: 1712847600000
        '409':
          description: payment_not_cancellable
          content:
            application/json:
              examples:
                payment_not_cancellable:
                  summary: payment_not_cancellable (error_code 1117)
                  value:
                    status_code: 409
                    data:
                      detail: >-
                        This payment can no longer be cancelled: it has already
                        been sent to the bank, or it has already finished.
                      code: payment_not_cancellable
                      error_code: 1117
                    query_generated_time: 1750000000000
              schema:
                $ref: '#/components/schemas/CodedErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - _AuthenticatedBearer: []
components:
  schemas:
    PaymentCancelCreate:
      properties:
        reason:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Reason
          description: Why you are cancelling, for your own records and ours. Optional.
          examples:
            - Customer asked to hold the payment
      additionalProperties: false
      type: object
      title: PaymentCancelCreate
      description: Optional body for ``POST /v1/platform/payments/{payment_id}/cancel``.
    CommonResponse:
      properties:
        status_code:
          type: integer
          title: Status Code
          description: HTTP status code for the response.
        data:
          title: Data
          description: Payload or error details.
        query_generated_time:
          type: integer
          title: Query Generated Time
          description: >-
            UTC timestamp (milliseconds since epoch) when response was
            generated.
      type: object
      required:
        - status_code
        - data
        - query_generated_time
      title: CommonResponse
      description: |-
        Standard response wrapper for single-object responses and errors.

        Generic over the payload type. A route that declares
        ``CommonResponse[SomeModel]`` gets the real ``data`` schema rendered in
        OpenAPI/Swagger; a bare ``CommonResponse`` leaves ``data`` untyped.
    CodedErrorResponse:
      properties:
        status_code:
          type: integer
          title: Status Code
          description: HTTP status code for the response.
        data:
          $ref: '#/components/schemas/CodedErrorBody'
          description: Payload or error details.
        query_generated_time:
          type: integer
          title: Query Generated Time
          description: >-
            UTC timestamp (milliseconds since epoch) when response was
            generated.
      type: object
      required:
        - status_code
        - data
        - query_generated_time
      title: CodedErrorResponse
      description: Standard envelope wrapping a :class:`CodedErrorBody`.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CodedErrorBody:
      properties:
        detail:
          type: string
          title: Detail
          description: Human-readable error message.
        code:
          type: string
          title: Code
          description: Stable string error code — the canonical value to branch on.
        error_code:
          type: integer
          title: Error Code
          description: >-
            Numeric custom error code from the Finogate registry. Unique per
            condition and stable forever.
      type: object
      required:
        - detail
        - code
        - error_code
      title: CodedErrorBody
      description: >-
        The ``data`` payload of a coded-error response.


        Condition-specific extras (e.g. ``remaining_time``) may also appear;
        only

        the always-present fields are typed here.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    _AuthenticatedBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: /v1/platform/auth/token

````