---
title: Cancellation
slug: TSQy-cancellation
docTags: 
createdAt: 2025-05-12T11:48:06.274Z
---

To cancel an authorisation which has not yet cleared, you can send cancellation advice to the Toro gateway as shown below.

```kotlin
val originalTransactionDetails = OriginalTransactionDetails(
    saleReferenceId = "sale-12345",
    amount = 1000,
    currency = CurrencyCode.GBP,
    dateTime = "2025-01-01T00:00:00.000Z",
    transactionReference = "purchase_12345123",
    responseCode = ResponseCode.APPROVED,
    authCode = "123456",
    paymentInterface = PaymentInterface.CONTACT,
    terminalSerialNumber = "2110022",
    additionalResponseInformation = "01:XZZ022a3a0a9a99f1B5MXJYICT525HCF"
)

toro.sendCancellationAdvice(
    originalTransaction = originalTransactionDetails,
    onCompleted = { response ->
        println("Cancellation advice response received: ${response.name}")
    },
    onError = { error ->
        println("Cancellation advice error: $error")
    }
)
```

