/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
idstringβœ…The 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",
  }
}

⚠️ 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!