---
title: Cancellation
slug: cancellation
docTags: 
createdAt: 2025-05-20T11:26:27.404Z
---

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

```swift
let originalTransactionDetails = OriginalTransactionDetails(
    saleReferenceId: "sale-12345",
    amount: 1000,
    currency: .gbp,
    dateTime: "2025-01-01T00:00:00.000Z",
    transactionReference: "purchase_12345123",
    responseCode: .approved,
    authCode: "123456",
    paymentInterface: .contact,
    terminalSerialNumber: "2110022",
    additionalResponseInformation: "01:XZZ022a3a0a9a99f1B5MXJYICT525HCF"
)

toro.sendCancellationAdvice(
    originalTransactionDetails: originalTransactionDetails,
    onCompleted: { responseCode in
        print("Cancellation advice response received \(responseCode)")
    },
    onError: { error in
        print("Cancellation advice error: \(error)")
    }
)
```

