Refund API

This API allows merchants to initiate refunds for previously successful transactions processed through Zaakpay. It supports full or partial refunds and returns standardized response codes along with status details.

REFUND API

Purpose : This API can be used to initiate refunds on a transaction.

Request Type : POST

Endpoint : /api/payments/v1/refund

Request Attributes

These are the Request Attributes of Refund API

FIELDDataTypeMandatoryDESCRIPTION
merchantIdentifierStringYUnique identifier of Zaakpay
orderIdStringYMerchant’s order Id
refundTypeStringYPossible Values :
F - Full refund
P - Partial refund
refundAmountStringYRefund amount in paisa
merchantRefundIdStringYMerchant generated unique refund id for every
refund request

Response Attributes

These are the Response Attributes of Refund API.

FieldTypeDescription
statusBooleanIndicates the overall result of the API request. true if the refund was processed successfully, false if an error occurred.
messageObjectContains response code and description.
dataObjectContains transaction-related information (if applicable).

Checksum Calculation

Calculate the checksum using the HMAC SHA-256 algorithm using the data json as string and
your generated secret key.

Sample Request and Response

For reference, below are the sample cURL Request and Response of API . It takes all required attributes to initiate a Refund of transaction.

cURL

curl -X POST https://api.zaakpay.com/api/payments/v1/refund \
-H "Content-Type: application/json" \
-H "checksum: <calculated-checksum-here>" \
-d '{
  "merchantIdentifier": "03efXXXXXXXXXXXXXXXXX060c35f",
  "merchantRefundId": "REFXXXXXXX33b",
  "orderId": "ORDER98765",
  "refundType": "F",
  "refundAmount": 5000
}'

Sample Request

{
  "merchantIdentifier": "03efXXXXXXXXXXXXXXXXX060c35f",
  "orderId": "ORDER98765",
  "refundType": "F",
  "refundAmount": 5000,
  "merchantRefundId": "REFXXXXXXX33b"
}

Sample Response

{
  "status": true,
  "message": {
    "code": 100,
    "text": "The transaction was completed successfully."
  },
  "data": {
    "merchantIdentifier": "03efXXXXXXXXXXXXXXXXX060c35f",
    "merchantRefundId": "REFXXXXXXX33b",
    "refundAmount": "5000",
    "refundStatus": "PENDING"
  }
}
{
  "status": false,
  "message": {
    "code": 216,
    "text": "Order Id not found."
  },
  "data": {}
}

Refund API Response codes

CodeTextRefund StatusRetry
100The transaction was
completed successfully.
PENDINGN
110MerchantIdentifier field missing or blank.

Y
111MerchantIdentifier not valid.

Y
129OrderId field missing or
blank.

Y
160Transaction amount validation has failed.

Y
180Checksum received
with request is not
equal to what we
calculated

Y
190OrderId either not processed or rejected.

Y
200Transaction already refunded.

Y
216Order Id not found.

Y
801Merchant reference ID was not valid.

Y
802Refund for this unique merchant refund id already processed

Y
1036Something went wrong

Y
( Retry with same merchantRefundId to check if it exists or not)
1049Refund type in request is not valid

Y
4001Refund amount not valid with the provided refund type

Y