Skip to main content
PUT
/
api
/
partner
/
v2
/
transactions
/
{id}
/
cancel
cURL
curl --request PUT \
  --url https://staging-api.capa.fi/api/partner/v2/transactions/{id}/cancel \
  --header 'partner-api-key: <partner-api-key>'
{
  "success": true,
  "data": {
    "id": "<string>",
    "userId": "<string>",
    "status": "<string>"
  }
}
Cancels a previously created on-ramp, off-ramp, or cross-ramp transaction. Cancellation is only allowed if the transaction has not yet received funds.

Important Notes

  • 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.
  • This operation is idempotent — calling it multiple times on a cancelled transaction will not cause errors.

Use Cases

  • Abort abandoned payments: Cancel stuck or forgotten transaction flows.
  • Back-office controls: Let support teams reverse pending transactions before execution.
  • Automatic timeout flows: Cancel after inactivity via cron jobs or watchdog logic.

Error Codes

Common Errors

HTTP StatusCodeMessage
401UNAUTHORIZED”API Key is missing”
401UNAUTHORIZED”Invalid API Key format”
401UNAUTHORIZED”Invalid API Key”
403INVALID_PARTNER_FLOW”The partner has an invalid flow.”

Endpoint-Specific Errors

HTTP StatusCodeMessage
400INVALID_USER_INPUT_ERROR”Invalid User Input”
400BAD_REQUEST”Invalid transaction state transition”
403PARTNER_NOT_OWNER_OF_TRANSACTION_ERROR”Partner is not the owner of the transaction.”
403USER_NOT_OWNER_OF_TRANSACTION_ERROR”User is not the owner of the transaction.”

Headers

partner-api-key
string
required

Api key for the affiliated partner that is performing the request

Path Parameters

id
string
required

Transaction identifier

Example:

"8374f327-38bd-4b0b-b8a7-2524599eb903"

Response

200 - application/json
success
boolean
Example:

true

data
object