This guide is for the deprecated Flex.API. If you are starting with a new integration, please refer to the Guide for the secuconnect API: Link
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:
POST /payment/tujevzgobryk3303/cancel HTTP/1.1
Content-Type: application/json; charset=utf-8;
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.