--- title: "Refund a transaction from the POS" url: "https://docs.adyen.com/point-of-sale/classic-library-deprecation/classic-library-integrations/java-native-interface-integration/key-steps-jni/cancel-or-refund-a-transaction-jni/refund-a-transaction-from-the-pos-jni" source_url: "https://docs.adyen.com/point-of-sale/classic-library-deprecation/classic-library-integrations/java-native-interface-integration/key-steps-jni/cancel-or-refund-a-transaction-jni/refund-a-transaction-from-the-pos-jni.md" canonical: "https://docs.adyen.com/point-of-sale/classic-library-deprecation/classic-library-integrations/java-native-interface-integration/key-steps-jni/cancel-or-refund-a-transaction-jni/refund-a-transaction-from-the-pos-jni" last_modified: "2026-05-25T12:55:00+02:00" language: "en" --- # Refund a transaction from the POS [View source](/point-of-sale/classic-library-deprecation/classic-library-integrations/java-native-interface-integration/key-steps-jni/cancel-or-refund-a-transaction-jni/refund-a-transaction-from-the-pos-jni.md) ## Class | Name | Description | | ------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | `MerchantPos` | Extends `AdyenPos`. Class used to implement all payment platform functionality. Implements all functions that do not involve the PED. | ## Method | Name | Description | | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `cancelOrRefundAtPsp` | Start a cancel or refund. If a `pspReference` has been generated, pass this as a reference for the transaction. Otherwise, provide the `tenderReference`.This method returns an immediate response of type `LibraryResult`. Check if this result is "OK", before continuing the operation. If the `LibraryResult` value is not "OK", the system will not return the related callback with the asynchronous result. See [here](/point-of-sale/classic-library-deprecation/classic-library-integrations/java-native-interface-integration/key-steps-jni/process-a-basic-transaction-jni/handle-and-extract-data-from-callbacks-jni) for more on extracting data from an event or callback. | ## Tender Parameter | Name | Type | Required | Description | | -------- | ------ | ------------------------------------------------------------------------------------------- | ---------------------- | | `tender` | Tender | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Represents the tender. | ## Attributes | Name | Type | Required | Definition | | ------------------- | ------ | ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | | `merchantAccount` | String | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The `merchantAccount` account to receive the money. | | `merchantReference` | String | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The transaction reference provided by the Merchant (reported in the Adyen payments platform). | | `pspReference` | String | ![-x-](/user/data/smileys/emoji/x.png "-x-") | The reference provided by the Adyen PSP (reported in the Adyen payments platform). Use the PSP reference to identify the transaction to be cancelled. | | `tenderReference` | String | ![-x-](/user/data/smileys/emoji/x.png "-x-") | Tender reference provided by the library if there is no connection to the PSP. Use the Tender reference to identify the transaction to be cancelled. | | `terminalId` | String | ![-x-](/user/data/smileys/emoji/x.png "-x-") | The PED to process the transaction on. | ## Callback | Name | Description | | ------------------------------ | ----------------------------------------- | |  `cancelOrRefundAtPspCallback` | Returns the result of creating the tender | ## Callback Response Attributes | Name | Description | | ----------------- | -------------------------------------------------------------------------------------------------- | | `additionalData` | Adyen returns the `additionalData` object, a generic container that can hold extra response fields | | `tenderReference` | Reference the PED provides for the transaction, used in reporting on the Adyen payments platform. | | `tenderState` | Transaction state | | `adyenResult` | Transaction result details | ## Determine the current and final tender state Adyen provides a method to determine the current, or final, tender state. For more information, see [Determine the current and final tender state - JNI](/point-of-sale/classic-library-deprecation/classic-library-integrations/java-native-interface-integration/key-steps-jni/process-a-basic-transaction-jni/determine-the-current-and-final-tender-state-jni).