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

# Cancel an operation

> Cancels a transfer using the same rules as the widget receipt button. Allowed only inside the cancellation window, and only when the operation is not in flight, already paid out, failed, or already cancelled. `void` stops the canonical operation before funds move. `request` also asks the corridor to cancel native execution (that can reverse funds). A refusal is HTTP 409 with `error.code`, `error.data.unavailableReason`, `error.data.retryable`, and `error.data.nextStep`.



## OpenAPI

````yaml /raas-widgets/openapi.json post /partner/operations/{operationId}/cancel
openapi: 3.0.0
info:
  title: RaaS Widgets Partner API
  description: >
    REST API for RaaS Widgets partner integrations. Create magic links for
    embeddable flows, manage end users, track transfer operations, handle CIP
    verification, and configure webhooks for real-time event notifications.


    This specification covers the **Partner-accessible API** only (`X-API-Key`
    against `/partner/*`). Widget and Superadmin APIs are out of scope.


    ## Authentication


    All endpoints require an API key passed in the `X-API-Key` header. Use
    `raas_sandbox_*` keys for the sandbox environment and `raas_live_*` keys for
    production.


    ## Environments


    | Environment | Base URL |

    |---|---|

    | Sandbox | `https://api.sandbox.raas-widgets.leapfinancial.com` |
  version: 3.16.2
  contact: {}
servers:
  - url: https://api.sandbox.raas-widgets.leapfinancial.com
    description: Sandbox
security: []
tags:
  - name: Partner - Magic Links
    description: Create, list, and manage magic links for flows
  - name: Partner - Flows
    description: List enabled flows and the full flow catalog
  - name: Partner - Users
    description: View and manage end users associated with your partner account
  - name: Partner - Operations
    description: Track money transfer operations and their statuses
  - name: Partner - Requests
    description: List and inspect money-request records
  - name: Partner - Deferred Payouts
    description: List, inspect, and cancel deferred payout remittances
  - name: Partner - CIP
    description: Customer Identification Program (CIP) verification management
  - name: Partner - Data Requests
    description: Fulfill data requests for additional user information
  - name: Partner - Settings
    description: Configure partner-level settings (redirect URLs, logo, etc.)
  - name: Partner - Webhooks
    description: Configure webhook endpoints and inspect delivery history
  - name: Partner - Pricing
    description: >-
      Indicative pre-quote summaries (best / worst / averages) for partner
      integrations
paths:
  /partner/operations/{operationId}/cancel:
    post:
      tags:
        - Partner - Operations
      summary: Cancel an operation
      description: >-
        Cancels a transfer using the same rules as the widget receipt button.
        Allowed only inside the cancellation window, and only when the operation
        is not in flight, already paid out, failed, or already cancelled. `void`
        stops the canonical operation before funds move. `request` also asks the
        corridor to cancel native execution (that can reverse funds). A refusal
        is HTTP 409 with `error.code`, `error.data.unavailableReason`,
        `error.data.retryable`, and `error.data.nextStep`.
      operationId: OperationsController_cancelOperation
      parameters:
        - name: operationId
          required: true
          in: path
          description: Unique operation identifier
          schema:
            type: string
            example: op_acme_abc123
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CancelPartnerOperationDto'
      responses:
        '200':
          description: Operation cancelled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelPartnerOperationResponseDto'
        '401':
          description: Unauthorized — invalid or missing API key / bearer token
        '404':
          description: Operation not found for this partner
        '409':
          description: >-
            Cannot cancel. error.code is WINDOW_EXPIRED, ALREADY_SETTLED,
            ALREADY_CANCELLED, or IN_FLIGHT. error.data.nextStep says what to
            do.
      security:
        - api-key: []
components:
  schemas:
    CancelPartnerOperationDto:
      type: object
      properties:
        reason:
          type: string
          description: >-
            Why the partner is cancelling. Stored on the operation and sent on
            the operation.cancelled webhook.
          maxLength: 500
          example: Customer asked us to stop this transfer.
    CancelPartnerOperationResponseDto:
      type: object
      properties:
        success:
          type: boolean
          example: true
        data:
          $ref: '#/components/schemas/CancelPartnerOperationDataDto'
      required:
        - success
        - data
    CancelPartnerOperationDataDto:
      type: object
      properties:
        operationId:
          type: string
          example: op_acme_abc123
        status:
          type: string
          enum:
            - cancelled
          example: cancelled
        mode:
          type: string
          enum:
            - void
            - request
          example: request
        cancellationReason:
          type: string
          example: Customer asked us to stop this transfer.
        cancelledAt:
          type: string
          example: '2026-08-28T12:10:00.000Z'
        corridorCancel:
          $ref: '#/components/schemas/PartnerCorridorCancelDto'
      required:
        - operationId
        - status
        - mode
        - cancellationReason
        - cancelledAt
        - corridorCancel
    PartnerCorridorCancelDto:
      type: object
      properties:
        outcome:
          type: string
          enum:
            - ok
            - failed
            - not_applicable
          description: >-
            ok: corridor cancelExecution succeeded. failed: corridor call failed
            after the canonical operation was cancelled (support Inbox is
            raised). not_applicable: no corridor operation id.
        error:
          type: string
          description: Corridor error message when outcome is failed
      required:
        - outcome
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Your partner API key. Use `raas_sandbox_*` keys for the sandbox
        environment and `raas_live_*` keys for production.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.