4. Reversing a transaction

Cancellation reverses a transaction that has already completed and returned a result. For stopping an in-progress transaction, use Aborting a transaction; for returning funds independently of any original transaction, use Refunding a transaction — same decision logic as everywhere: same-day undo referencing the original → cancellation; standalone return → refund.

The request

POST /cancel-transaction/PAX:{serialNumber}?waitTime=60
{
  "terminalTransactionId": "123456789",
  "ecrTransactionId": "CANCEL-2026-07-06-0007",
  "amount": 1199,
  "currency": "EUR"
}

The rules:

  • terminalTransactionId — the platform identifier from the original process-transaction response. This is why storing it at payment time is non-negotiable; without it there is no cancellation.
  • ecrTransactionId — a new identifier for the cancellation itself (≤ 35 characters).
  • amount and currency must match the original transaction.

Reading the outcome

status in the body: OK = reversed; NOK = refused — read responseCode. The HTTP code is not the outcome. If a cancellation is refused because the original has moved on to clearing, the fallback is a refund for the same amount — build the fallback in, as on every method.

Note

Ensure the deployed driver version is current before testing cancellation — a defect in versions before 24.0.1 crashed the driver on cancel-transaction.

Related

  • Refunding a transaction (Cloud API) — the fallback and the standalone return.
  • Taking a payment (Cloud API) — where the terminalTransactionId you need comes from.