Refund details

To get comprehensive details of a refund, including the refunded amount, status, method, and timestamps

GET
/api/v1/refund/{id}
AuthorizationBearer <token>

Pass access token obtained from login endpoint

In: header

Path Parameters

idnumber

Pass the refund transaction object "id" field number

Query Parameters

datastring

Convert payload JSON object to encrypted string and send it to the server

Sample Encryption and Decryption Process:

The following steps demonstrate how to integrate with this API using sandbox credentials.

Step 1: Create JSON Object

{
  "merchantCode": "842217", // Pass the merchant code provided by Hesabe
}

Payload details:

Contains the list of parameters and their corresponding values required to make the API request.

Field NameDescriptionRequired
merchantCodePass the merchant code provided by HesabeYes

Step 2: Convert the JSON object into an encrypted string format and post to Hesabe

{
  "data": "0e7898bd7464d0c402fe8a949d9cbf9b826ccb9b83b56fa003373275f1947a65"
}

Step 3: Receive encrypted response from Hesabe:

{
  "response": "60a8f6241932227b840a9f5e36987f4d818fba84808037f6ad7f9e741d18e6664ec2852ff018d3a493a35da5f803d38ee68cf1fed422a9b87071759e28a956783c04d39fa4b8e434a0e4c4ec4dc799d73193d93d6202126d206a72569094124267b73f9047de9e3ecfa837da9397e4c0cca55664b34a4a20f32a5c7f8331e0d3bce93d7963d5a4202ccd0bd41a44060908e875be17d6ab0784ba0bcc5c55fe7ac3707e8656dbf0c73a1179ccfe89f4518dd1b1b1f08686bbc7046df85ede63e29b89e4568b7b54cf516490c35846acbf3361841be293b285fde649a7cd171ac4ece77915d412cf8bf7dca18a667b72257d5c4f332a39a853183596f67e343a53c0c444f2ccee3269ffc0f368a50f441ec8ac2998a1eeba745152089789a5c400c6d3ff0893a086829ee254c53aa3037c3e3a9e0c40a4654d4794ceefac6f31800d707c17f45768ab8e8d6d8ff5fcf82d593939a5e17e9e05df3175ce3faa42751a857796b36849be9dc1a1ee5cee23c6923570938640b554e452bd0c57ef15879fb2f0d257809e168288294b80f244744aa1e62da0afe5d0ad8d5c9d90f3b51a68999f3aec334b672b0b2757f482e6346fcbc38a50cb62cd0b0665bd7647fb379f72eeef6c3f8a93dbbc6d5b357025ab3551a656d916b62fdad08a1506af7fed8e3920363fbb9060c4916a8d84265b8e6bff3d9d144561ec5089e69c3da934fb7f56adf796a3eec8550a80fc24356c1fbaf13aac47a5274dc96e76e23abe6c3412a417bbc528dbc537121508b173ed2a459ce004097afbb2c07d896036dcdf75bf606a20a3b184e0de4fea696e4f55f016962226d443dd7bb099bc4868eae24d83babe398feedd85337b354563e23b09b99d613b8cf77b8768953dc12042d64fee3926ff3eff794f1c8ed8f05b21956291fe67f9380aeebbe7d7d8a8070dec30bbac9b34fd759eb5a73f84e2491449102f3b9735e478467071e05597d4664a64bda3de9d177a450dd5a0f2136662b7c62fc43cc8274caf62b7300778dbbb95d9a31750001ca63a0fcd65d4043a5ce99f0eea0e1957d916f5afe8fef398c9fc1eb6000dca185e17c71aa4f99109155cdcc9dd6883147937ebb60a26e7b8488e3cf267be173411867ee3b383e032837fc2d75bd35e146d8ddd5ef77d48b07b138908cf8c84cc0cb8512f376d155e379c6023cc0bb812f08fc3b5fdcc5f037f39d76748b0c553ce5eb1a7665118c72baaaccfa84d54f304e0e6861c30333bde4aa0"
}

Step 4: Decrypt the api response and view the JSON output

{
  "status": true,
  "message": "Refund requests",
  "response": {
    "id": 1468,
    "merchant_id": 84,
    "amount": "1010.000",
    "refund_at": "2025-10-12",
    "document_number": "",
    "token": "84221717602504449336555368722",
    "transaction_date": "2025-10-12 09:27:28",
    "order_reference_number": "45_35810d188b085c159f4b803bd0c895a9",
    "recover_method": "1",
    "status": 1,
    "refund_method": "1",
    "remarks": "Auto Refund Approved",
    "approved_by": "Admin",
    "total_balance_amount": "0.000",
    "total_refunded_amount": "1010.000",
    "total_transaction_amount": "1010.000",
    "created_at": "2025-10-12 10:20:48",
    "updated_at": "2025-10-12 10:36:07",
    "transaction": {
      "id": 162216,
      "amount": 1010,
      "admin_charge": 0,
      "token": "84221717602504449336555368722",
      "payment_id": 1,
      "payment_name": "KNET",
      "display_name": "KNET",
      "track_id": "347122",
      "transaction_id": "528520000860698",
      "service_id": 3,
      "auth": "B02799",
      "status": 1,
      "created_at": "2025-10-12 09:27:28"
    }
  }
}

Header Parameters

accessCodestring

Pass the merchant access code issued by Hesabe

Acceptstring

application/json

Content-Typestring

application/json

Response Body

application/json

application/json

application/json

application/json

application/json

fetch("https://merchantapisandbox.hesabe.com/api/v1/refund/1468?data=0e7898bd7464d0c402fe8a949d9cbf9b826ccb9b83b56fa003373275f1947a65", {  method: "GET",  headers: {    "accessCode": "c333729b-d060-4b74-a49d-7686a8353481",    "Accept": "application/json",    "Content-Type": "application/json"  }})
{
  "status": true,
  "message": "Refund requests",
  "response": {
    "id": 1468,
    "merchant_id": 84,
    "amount": "1010.000",
    "refund_at": "2025-10-12",
    "document_number": "",
    "token": "84221717602504449336555368722",
    "transaction_date": "2025-10-12 09:27:28",
    "order_reference_number": "45_35810d188b085c159f4b803bd0c895a9",
    "recover_method": "1",
    "status": 1,
    "refund_method": "1",
    "remarks": "Auto Refund Approved",
    "approved_by": "Admin",
    "total_balance_amount": "0.000",
    "total_refunded_amount": "1010.000",
    "total_transaction_amount": "1010.000",
    "created_at": "2025-10-12 10:20:48",
    "updated_at": "2025-10-12 10:36:07",
    "transaction": {
      "id": 162216,
      "amount": 1010,
      "admin_charge": 0,
      "token": "84221717602504449336555368722",
      "payment_id": 1,
      "payment_name": "KNET",
      "display_name": "KNET",
      "track_id": "347122",
      "transaction_id": "528520000860698",
      "service_id": 3,
      "auth": "B02799",
      "status": 1,
      "created_at": "2025-10-12 09:27:28"
    }
  }
}
{
  "status": false,
  "message": "Forbidden Access",
  "response": null
}
{
  "status": false,
  "message": "Request not found, Please verify the request data",
  "response": null
}
{
  "message": "Internal server error occurred"
}
{
  "status": false,
  "code": 506,
  "message": "Invalid Request Data",
  "response": null
}