doTransaction method allows you to process refunds. There are two primary scenarios for this operation:
- Standard Refund: Done on the same terminal where the original sale occurred.
- External Refund: Done on a different terminal, requiring additional metadata for server-side validation.
To perform a Refund transaction, save the
originalTransactionId from the original transaction.Standard Refund
A Standard Refund is utilized when a transaction needs to be reversed or partially returned using the same terminal that processed the original sale.Request
The following example shows a typical request body for a standard refund:JSON
External Refund [from other device]
To refund a transaction initiated on a different terminal, the system requires the following metadata from the original transaction to ensure security and validity:transactionOriginalTimetransactionOriginalAmounttransactionOriginalRequestIdmainBoardSerialhwSerial
Request
The following example shows a typical request body for an external refund:Response
A successful request will return a response similar to the one in the code block below:Refund Request Parameters
To perform a refund, you must include the following parameters within theparams object of the doTransaction method.
Refund Response Parameters
Below are the parameters returned in theresult object following a refund request: