Refund Request
A refund is a transaction process where a merchant returns funds to a customer after a payment has been processed
API Reference
Refund request
To raise a refund after success transaction
Refund list
To view the complete list of refund request records
Refund details
To get complete refund details
Cancel refund
To cancel a refund request using the refund ID
Refund Implementation Steps
Create a Refund Request
To create a refund request for a transaction, pass the following parameters
Sandbox Refund Request API
Below Refund API strictly for sandbox testing only. Never use these sandbox URL's in production environment
Production Refund Request API
Use the following Refund API strictly for production transactions. Ensure that you never use these production URLs in the sandbox or testing environment
$baseUrl = 'http://merchantapisandbox.hesabe.com/api/'; // sandbox
$refundRequestApiUrl = $baseUrl . 'refund';
$data = [
'merchantCode' => '842217', // Sandbox Merchant Code
'token' => '521042117249344539468767555844', // Transaction Token Number
'refundAmount' => 1.000, // Refund Amount
'refundMethod' => 2, // 1 for Full Refund, 2 for Partial Refund
];
$checkoutRequest = Request::create($refundRequestApiUrl, 'POST', $data);
$checkoutRequest->headers->set('accessCode', $accessCode);Here's an refund request parameters details
| Field | Description | Required |
|---|---|---|
merchantCode | Merchant Code is a unique identifier generated by Hesabe for each activated merchant | Yes |
token | Transaction Token of the original transaction | Yes |
refundAmount | Amount to be refunded | Yes |
refundMethod | 1 for Full Refund / 2 for Partial Refund | Yes |
Refund Response Details
Here's an sample refund response structure
{
"status": true,
"message": "Your refund request is waiting for approval",
"data": {
"token": "521042117249344539468767555844",
"amount": "1.000",
"order_reference_number": "1724934434",
"transaction_status": "SUCCESSFUL",
"refund_status": "PENDING",
"payment_type": "KNET",
"service_type": "Payment Gateway",
"transaction_datetime": "2024-08-29 15:27:38",
"refund_requested_at": "2024-09-04 15:04:44"
}
}Hosted Checkout
Integrate Hesabe's payment gateway directly into your website with our embedded checkout solution. Provide customers with a smooth, secure payment experience while maintaining complete control over the user journey.
Dynamic Commission Fees
We have introduced a new enhancement to the Checkout API allowing sub-merchants to dynamically specify a commission amount at the time of checkout. This change provides greater flexibility and control over transaction-level commission settings.