--- title: "Cancel a transaction" url: "https://docs.adyen.com/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/key-steps-c-library/cancel-or-refund-a-transaction-c-library/cancel-a-transaction-c" source_url: "https://docs.adyen.com/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/key-steps-c-library/cancel-or-refund-a-transaction-c-library/cancel-a-transaction-c.md" canonical: "https://docs.adyen.com/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/key-steps-c-library/cancel-or-refund-a-transaction-c-library/cancel-a-transaction-c" last_modified: "2026-05-24T12:54:31+02:00" language: "en" --- # Cancel a transaction [View source](/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/key-steps-c-library/cancel-or-refund-a-transaction-c-library/cancel-a-transaction-c.md) Use this function to cancel a transaction that is actively being processed on the PED. For transactions that have already been processed by the Adyen payments platform, useĀ [Refund a transaction from the POS - C](/point-of-sale/classic-library-deprecation/classic-library-integrations/c-library-integration/key-steps-c-library/cancel-or-refund-a-transaction-c-library/refund-a-transaction-from-the-pos-c). ## Function | Name | Description | | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `cancel_transaction` | Call this function to cancel a transaction. The POS application must never assume the final state and should wait for the final state of the transaction as reported by the PED (from the library). | ### Parameters | Name | Description | | ------------------ | ------------------------------------------ | | `terminal_id` | The terminal ID of the PED. | | `tender_reference` | A reference for the transaction to cancel. | ### Code example The declaration of the call to cancel a transaction is: ```cpp ADYEN_RESULT cancel_transaction(char * terminal_id, char *tender_reference) ```