Integrations GuidesCancel Transaction

Cancel Transaction

This endpoint allows you to cancel an active transaction by its transaction reference. When a transaction is cancelled, the checkout link will be expired and no further payment attempts will be possible.

How to Cancel a Transaction

Endpoint https://api.chapa.co/v1/transaction/cancel/<tx_ref>

<tx_ref> is the transaction reference that you provided when the transaction was initialized.

Method PUT

  • Authorization: Pass your secret key as a bearer token in the request header to authorize this call.

Important Notes

  • Only active transactions can be cancelled
  • Once cancelled, the transaction cannot be reactivated
  • The checkout link will be expired immediately
  • This action is irreversible
1import requests
2
3 url = "https://api.chapa.co/v1/transaction/cancel/chewatatest-6669"
4
5 headers = {
6 'Authorization': 'Bearer CHASECK-xxxxxxxxxxxxxxxx'
7 }
8
9 response = requests.request("PUT", url, headers=headers)
10
11 print(response.text)

ℹ️

Refer to our Error Codes page for all responses for this request.