/api/partner/v2/transactions/{id}/cancel

Cancels a previously created on-ramp or off-ramp transaction.
Cancellation is only allowed if the transaction has not yet received the funds.


🔐 Headers

HeaderDescription
partner-api-keyAPI key associated with your partner account. Required. See API Key Generation Guide.

⚠️

This endpoint requires authentication using a valid partner-api-key.


📥 Path Parameters

ParameterTypeRequiredDescription
idstringThe unique ID of the transaction to cancel. Must be owned by the authenticated partner and in a cancellable state.

📨 Example Request

curl --request PUT \
     --url https://staging-api.capa.fi/api/partner/v2/transactions/8374f327-38bd-4b0b-b8a7-2524599eb903/cancel \
     --header 'accept: application/json' \
     --header 'partner-api-key: {{API-KEY}}'

📤 Response Body

FieldTypeDescription
successbooleanIndicates whether the cancellation was successful.
dataobjectContains the updated transaction object after cancellation.

The returned transaction object will have its status updated to "CANCELLED".


📘 Example Response

{
  "success": true,
  "data": {
    "id": "0483907e-ca31-432c-8234-fc401a921ef9",
    "userId": "d3127f5f-ff64-47f9-a9cc-ff603862eca6",
    "status": "CANCELLED",
    "type": "OFF_RAMP",
    "tokenSymbol": "USDC",
    "blockchainSymbol": "POL",
    "fiatCurrency": "MXN",
    "fiatAmount": 4.728013,
    "cryptoAmount": "0.260000",
    "exchangeRate": "18.184665",
    "premiumSpread": "0.005",
    "createdAt": "2025-06-09T21:51:32.288Z",
    "completedAt": null,
    "destinationWalletAddress": "0x620e598c65d8c42d4d19e05c3bec53fc6f19cdec",
    "bankAccount": {
      "country": "MX",
      "accountIdentifier": "012345678902422382",
      "isVerified": true
    },
    "invoice": {
      "transactionHash": null,
      "paymentUrl": null
    }
  }
}

⚠️ Important Notes & Requirements

  • Only transactions in a cancellable state can be cancelled (e.g., PENDING, BANK_TRANSFER_PENDING, CRYPTO_NOT_RECEIVED).
  • Completed or locked transactions cannot be cancelled.
  • 🔐 The transaction must belong to the authenticated partner account.
  • 🕒 Cancelling an off-ramp transaction may abort a pending withdrawal attempt (if not yet initiated).
  • This operation is idempotent: calling it multiple times will not cause errors once cancelled.

✅ Use Cases

  • Abort abandoned payments: Allow your users to cancel stuck or forgotten on-ramp flows.
  • Back-office controls: Let your support or finance team reverse a pending transaction before execution.
  • Automatic timeout flows: Integrate cancellation after X minutes of inactivity via cron jobs or watchdog logic.
Language
URL
Click Try It! to start a request and see the response here!