Refund a Credit Card Payment
The Refund Transaction endpoint can be used to process a partial or full refund for purchase or capture payments 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.
Refund Requests
The Process Refund Transaction endpoint will allow you to process a process a partial or full refund for a purchase or capture credit card payment. Multiple partial refund requests may be submitted for a payment, up to the full original amount
of that payment.
The Refund 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 originalTransactionId
, the amount
to be refunded, and the ipAddress
where the payment is processed.
Review Process Refund Transaction API Reference
Request Requirements
In order to process a Refund Transaction, the original transaction must be in a closed credit card batch. If the credit card batch of the transaction remains open, you should use the Process Reverse Transaction endpoint.
// Example Refund request
const options = {
method: 'POST',
headers: {
accept: 'application/json',
'idempotency-key': 'Idempotency20240514test14',
'content-type': 'application/json',
'api-token': 'YOUR_API_TOKEN'
},
body: JSON.stringify({
originalTransactionId: 25509391,
amount: 11,
ipAddress: '192.168.1.1'
})
};
fetch('https://api.helcim.com/v2/payment/refund', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
Potential Payment Responses
The Process Refund Transaction endpoint will respond to all requests with either:
- A
transaction
object with a type of 'refund', indicating the outcome of the payment. - An
error
response indicating the reason for the error.
Potential Payment Outcomes
A successful refund 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'. - An unsuccessful payment will contain a
status
with the value of 'DECLINED'.
Attempting to Refund a Payment in an Open Credit Card Batch
Attempting to refund a payment that is in an open credit card batch will result in an error response indicating that the original payment cannot be refunded. To resolve this error you should send a request to the Process Reverse Transaction endpoint.
{
"errors": "Card Transaction cannot be refunded"
}
Updated 1 day ago