--- title: "Cancel or refund a transaction" url: "https://docs.adyen.com/point-of-sale/classic-library-deprecation/classic-library-integrations/ios-integration/key-steps-ios/process-a-basic-transaction-ios/cancel-or-refund-a-transaction-ios" source_url: "https://docs.adyen.com/point-of-sale/classic-library-deprecation/classic-library-integrations/ios-integration/key-steps-ios/process-a-basic-transaction-ios/cancel-or-refund-a-transaction-ios.md" canonical: "https://docs.adyen.com/point-of-sale/classic-library-deprecation/classic-library-integrations/ios-integration/key-steps-ios/process-a-basic-transaction-ios/cancel-or-refund-a-transaction-ios" last_modified: "2026-05-24T12:54:31+02:00" language: "en" --- # Cancel or refund a transaction [View source](/point-of-sale/classic-library-deprecation/classic-library-integrations/ios-integration/key-steps-ios/process-a-basic-transaction-ios/cancel-or-refund-a-transaction-ios.md) ## Cancel or refund with a PSP reference ### Method Call `cancelOrRefundTransactionWithPSPReference` to cancel or refund a transaction where the transaction was processed online successfully and generated a PSP reference. The response from the server indicates if the cancel or refund was received, not if it was performed. If the request is successful, if the `pspReference` of the original transaction is valid, and if the transaction was not already cancelled or refunded, the cancel or refund will always be performed. When the transactions are retrieved and their refunds are examined, each refund will have a `processingState` to indicate whether a `cancelOrRefund` request was sent.  ### Parameters | Name | Type | Required | Description | | ------------------- | ------------------ | ------------------------------------------------------------------------------------------- | ------------------------------------------------------- | | `pspReference` | merchantReference | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | PSP reference of the original transaction. | | `merchantReference` | NSString | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Reference for the merchant, used in reporting. | | `refundState` | ADYProcessingState | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Indicates whether a `cancelOrRefund` request was sent.  | | `error` | NSError | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Information about any errors that occurred. | ## Cancel or refund with a tender reference ### Method Call `cancelOrRefundTransactionWithTenderReference` to cancel or refund a transaction. This is used where the transaction was offline with the provided combination of `tenderReference` and UniqueTerminalId (Model-SerialNumber). The response from the server indicates if the cancel or refund was received, not if it was performed. If the request is successful, if the the combination of `tenderReference` and `UniqueTerminalId` of the original transaction is valid of the original transaction is valid, and if the transaction was not already cancelled or refunded, the cancel or refund will always be performed. When the transactions are retrieved and their refunds are examined, each refund will have a `processingState` to indicate whether a `cancelOrRefund` request was sent.  ### Parameters | Name | Type | Required | Description | | ------------------- | ------------------ | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | | `tenderReference` | NSString | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Reference for the transaction, used as the PSP reference is not available. | | `uniqueTerminalId` | NSString | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Unique terminal ID to reference the PED that is processing the request. | | `merchantReference` | NSString | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Reference for the merchant, used in reporting. | | `refundState` | ADYProcessingState | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Indicates whether a `cancelOrRefund` request was sent.  | | `error` | NSError | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Information about any errors that occurred. |  \* When the transactions are retrieved and their refunds are examined, each refund will have a processingState \* to indicate whether a scheduleRefund-request was sent. \* \*/ - (void)refundTransactionWithPSPReferece:(NSString \*)pspReference amountToRefund:(ADYAmount \*)amount terminalIdentifier:(NSString \*)terminalIdentifier merchantReference:(NSString \*)merchantReference tenderReference:(NSString \*)tenderReference onCompletion:(void (^)(ADYProcessingState, NSError \*))completion; ## Partially refund a transaction ### Method Call `refundTransactionWithPSPReferece` to partially refund a transaction with the provided combination of `pspReference`, `amount`, `terminalIdentifier`, `merchantReference` and `tenderReference`  The response from the server indicates if the `scheduleRefund` request was received, not if it was performed. If the request is successful, if the combination of `tenderReference` and `UniqueTerminalId` of the original transaction is valid of the original transaction is valid, and if the transaction was not already cancelled or refunded, the cancel or refund will always be performed. When the transactions are retrieved and their refunds are examined, each refund will have a `processingState` to indicate whether a `scheduleRefund` request was sent.  ### Parameters | Name | Type | Required | Description | | -------------------------- | ------------------ | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | | `pspReference` | merchantReference | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | PSP reference of the original transaction. | | ``` amount ``` | ADYAmount | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | A container for the amount that needs to be refunded. | | `tenderReference` | NSString | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Reference for the transaction, used as the PSP reference is not available. | | ``` terminalIdentifier ``` | NSString | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Unique terminal ID to reference the PED that is processing the request. | | `merchantReference` | NSString | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Reference for the merchant, used in reporting. | | `refundState` | ADYProcessingState | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Indicates whether a `scheduleRefund` request was sent.  | | ``` onCompletion ``` | completion | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Information about any errors that occurred. | ## Cancel or refund from the terminal transaction list Use this method cancel or refund a transaction from the terminal transaction list, and receive a receipt on the POS or on the PED. You can only use this method for transactions that: * have been completed on the terminal that is receiving the cancel or refund request. * are still within the terminal storage – this is currently limited to 100 tenders. ### Method Call `cancelOrRefundWithRequest` on the selected `ADYDevice`: ```objectivec (void)cancelOrRefundWithRequest:(ADYCancelOrRefundRequest *)request completion:(void (^)(ADYProcessingState state, NSArray *receipts, NSError *error))completion; ``` The response from the device indicates whether the request was received, not whether it was performed.  ### Parameters | Name | Type | Required | Description | | ------------ | ------------------------ | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `request` | ADYCancelOrRefundRequest | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Object containing information about the transaction that you want to cancel or refund. | | `completion` | Block | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | This block called when the request was processed. Parameters:- `state`: contains the processing state of the cancel or refund. - `receipts`: an array that contains cancel/refund receipts if the processing state is `ADYProcessingStateProcessed` - `error`: contains an NSError if the request failed. | ADYCancelOrRefundRequest has the following parameters:  | Name | Type | Required | Description | | ---------------- | ------------------- | ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `reference` | String | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The tender reference for the transaction that you want to cancel or refund. | | `handleReceipt` | Boolean | ![-x-](/user/data/smileys/emoji/x.png "-x-") | Specifies that the POS handles and prints receipts. If omitted, it is required that the PED prints the receipt. If there is no printer unit, the transaction will fail. | | `additionalData` | NSMutableDictionary | ![-x-](/user/data/smileys/emoji/x.png "-x-") | Contains key/value pairs that you can use to specify additional data to be passed to the terminal. |