Reverse a Credit Card Payment
The Process Reverse Transaction endpoint can be used to reverse a purchase or capture payment processed through the Helcim system. This endpoint will accept a combination of header and body parameters and return a response indicating the outcome of the transaction.
Reverse Requests
The Process Reverse Transaction endpoint will allow you to process a process a reverse of a purchase or capture credit card payment. Reversing a payment will reverse the full amount
of the of the original purchase or capture.
The Reverse API Reference outlines the required and optional body parameters needed for your request. The minimum required information in the body of your request must include a valid cardTransactionId
, and the ipAddress
where the payment is processed.
Review Process Reverse Transaction API Reference
Request Requirements
In order to reverse a transaction, the transaction must be in an open credit card batch. If the credit card batch of the transaction has closed, you must use the Process Refund Transaction endpoint.
// Example Reverse request
const options = {
method: 'POST',
headers: {
accept: 'application/json',
'idempotency-key': 'Idempotency20240514test11',
'content-type': 'application/json',
'api-token': 'YOUR_API_TOKEN'
},
body: JSON.stringify({
cardTransactionId: 25600002,
ipAddress: '192.168.1.1'
})
};
fetch('https://api.helcim.com/v2/payment/reverse', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
Potential Payment Responses
The Process Reverse Transaction endpoint will respond to all requests with either:
- A
transaction
object with a type of 'reverse', indicating the outcome of the payment. - An
error
response indicating the reason for the error.
Potential Payment Outcomes
A successful payment request will create a transaction
object in the Helcim system with a status
that indicates the outcome of the payment.
- A successful payment will contain a status with the value of 'APPROVAL'.
{
"transactionId": 25603517,
"dateCreated": "2024-05-15 11:20:39",
"cardBatchId": 0,
"status": "APPROVAL",
"user": "Helcim System",
"type": "reverse",
"amount": 50,
"currency": "CAD",
"avsResponse": "",
"cvvResponse": "",
"cardType": "MC"
}
- An unsuccessful payment will contain a
status
with the value of 'DECLINED'.
Developer Test Accounts and Reverse Transactions
Helcim Developer Test Accounts are not able to process reverse transactions. Attempting to reverse a payment in your test account will result in a declined payment response, that would be successful on a production account.
Why Reverse a Payment Instead of Refund?
Reversing a purchase or capture payment in an open credit card batch stop it from going through settlement between Helcim and the customers issuing bank. Because the transaction did not go through settlement, fees are not applied for the original payment.
Once a credit card batch has closed and the payment has gone through settlement, the processing fees are applied and valid even if the payment is subsequently refunded. To lower processing fee costs, we recommend reversing payments where possible, rather than processing refund transactions.
Updated 1 day ago