Cancel Payment

DEPRECATED

This guide is for the deprecated Flex.API. Please don't use it for new implementations.

See Integration Options, and feel welcome to ask our friendly help desk.

You can cancel an authorided transaction as long as it is not captured yet. You can also cancel a transaction you have already captured, if the capture has not been executed yet. Direct debit transactions are usually executed the next morning at about 6 a. m.

It is also a good practice to cancel authorized transactions if these shall not be captured anymore.

You can either use the API solution with POST, or the browser solution with GET. The API endpoint to capture the payment is /payment/<hash>/cancel. You need no parameters in addition to your API key.

Example of API solution with POST:

Request
POST /payment/tujevzgobryk3303/cancel HTTP/1.1
Host: api-testing.secupay-ag.de
Content-Type: application/json; charset=utf-8;
Accept: application/json
Accept-Charset: utf-8
 
{
"data": {
"apikey": "6801fxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx7ace"
}
}

Response:

Response
{
"status": "ok",
"data": {
"hash": "tujevzgobryk3303",
"demo": 0,
"trans_id": "1831201"
},
"errors": null
}

There is also a browser solution. It is very similar, but you need to call GET and to append the API key to the URL. To cancel the above transaction your URL is https://api-testing.secupay-ag.de/payment/tujevzgobryk3303/cancel/6801fxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx7ace.

Note: Be aware that the browser might store the API key in the browser history. It must not be revealed to other persons.