Update/Refund API

Zaakpay provides functionality to update the transaction to desired state and to make full or partial refunds to customers using the Merchant Dashboard and API.

🚧

Update/Refund API: Only below kind of updates are possible.

  • Authorised to Cancel.
  • Authorised to Capture.
  • Capture to Refund Before Payout Initiated.
  • Capture to Partial Refund Before Payout Initiated.
  • Payout Initiated to Refund Initiated.
  • Payout Initiated to Partial Refund Initiated.
  • Payout Completed to Refund Initiated.
  • Payout Completed to Partial Refund Initiated.

Refund through Merchant Dashboard

You can initiate the refund of transaction using the Zaakpay Dashboard. You need to follow the steps as given below.

To initiate refunds,

  • Go to Zaakpay Merchant Dashboard > Click Transactions.
  • Search for the transaction which you want to refund and click on "full Refund" or "Partial Refund".
1277

Update-Refund API

Purpose: The purpose of this API is to update the status or to refund the transaction.

Environment details:

Request Type: POST
Endpoint: /updateTxn

Request Attributes

These are the Request Attributes of Zaakpay Update/Refund API.

Fields DataType Mandatory Description
merchantIdentifier String Y Zaakpay’s unique alphanumeric merchant identifier. You can get it from Zaakpay dashboard.
orderId String Y It is a unique transaction identifier for merchant.
Mode String Y 1 digit only, numeric, Allowed value is 0.
updateDesired String Y Numeric digit,values predefined by Zaakpay. E.g. 7="Captured", 8="Canceled", 14="Refunded", 22=”Partial Refund”. Note:If you request a state update to "Refunded" we will issue the full amount refund to the user.
updateReason String Y Description of the reason for update. min5, max30 alphanumeric characters. no special characters or dashes.
Amount String Y - In case of Partial-Refund Refund Amount, which needs to be refunded in case of partial refunds. In case of full refund this can be omitted. For E.g. Rs 1 is 100 paisa, Rs 777.50 is 77750 paisa.
merchantRefId String N Unique refund transaction id sent by merchant.
Checksum String Y Checksum Calculated on all above request parameters.

Response Attributes

These are the Response Attributes of Zaakpay Update/Refund API.

Fields Description
merchantIdentifier Zaakpay’s unique alphanumeric merchant identifier. You can get it from Zaakpay dashboard.
orderDetail It is a unique transaction identifier for merchant.
responseCode It is a max 3 digits Zaakpay’s Response code.
responseDescription It is a description of Zaakpay’s Response code. E.g. Description of Response code 100 is “The transaction was completed successfully”.
Checksum Checksum calculated by MobiKwik Payment Gateway on all above response parameters
merchantRefId Unique refund transaction id sent by merchant.

Checksum Calculation

Create a concatenated string using the request parameters as given below. Checksum string will create based on the request parameters which are posted to Zaakpay in the same order as given in below string.
Now, Calculate the checksum using the HMAC SHA-256 algorithm using the string as data and your generated secret key.

data={"merchantIdentifier":"fb2016ffd3a64b2994a6289dc2b671a4","orderDetail":{"orderId":"ZPLive1632373152375","amount":"100","productDescription":"test product"},"mode":"0","updateDesired":"14","updateReason":"test reason","merchantRefId":"TESTINGtugh3"}

Secret Key (staging) : 0678056d96914a8583fb518caf42828a
{"merchantIdentifier":"fb2016ffd3a64b2994a6289dc2b671a4","orderDetail":{"orderId":"ZPLive1632373152375","amount":"100","productDescription":"test product"},"mode":"0","updateDesired":"14","updateReason":"test reason","merchantRefId":"TESTINGtugh3"}
f70f43590249d2ef82ceb2d851109b5b61e2f35e43931eef529ffaa34243a834

❗️

Refunds can’t be made on the Transactions at “Settled” States

You can initiate refunds only on those Transaction that are not in settled state. To check the latest status of Transaction, Use our Check Transaction Status API/Zaakpay Dashboard.

Sample Request & Response

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

Sample Request

We have create a sample request of Refund API with all attributes and their values, in the order in which they’ll be sent to the API.

The resulting checksum calculated should be posted to the Zaakpay API along with other data.

curl --location --request POST 'https://zaakstaging.zaakpay.com/updateTxn' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Cookie: JSESSIONID=3253388BCF7BF29453346258402DBC3E; JSESSIONID=DCAA163F07B1059473CF320670097D62' \
--data-urlencode 'data={"merchantIdentifier":"fb2016ffd3a64b2994a6289dc2b671a4","orderDetail":{"orderId":"ZPLive1632373152375","amount":"100","productDescription":"test product"},"mode":"0","updateDesired":"14","updateReason":"test reason","merchantRefId":"TESTINGtugh3"}' \
--data-urlencode 'checksum=f70f43590249d2ef82ceb2d851109b5b61e2f35e43931eef529ffaa34243a834'

Sample Response

The Response will be in JSON Format.

{
    "merchantIdentifier": "fb2016ffd3a64b2994a6289dc2b671a4",
    "orderDetail": {
        "orderId": "ZPLive1632373152375"
    },
    "responseCode": "230",
    "responseDescription": "Transaction Refund Initiated",
    "merchantRefId": "TESTINGtugh3"
}
{
    "merchantIdentifier": "fb2016ffd3a64b2994a6289dc2b671a4",
    "orderDetail": {
        "orderId": "ZPLive1632373152375"
    },
    "responseCode": "200",
    "responseDescription": "Transaction already refunded.",
    "merchantRefId": "TestNewRefund123456"
}

👍

Auto Refund

This feature will allow the Merchants to automatically refund the transactions which are getting successful in non-real time.

Please raise a ticket to our support team or Connect with Business Partner to enable the same.

Update/Refund API Response codes

These are the Update/Refund API response codes.

Response Code Response Description Retryable Is Success? Details
184Update Desired blank.YN
185Update Desired not ValidYN
186Update Reason blank.YN
187Update Reason Not Valid.YN
189Checksum was blank.YN
190orderId either not Processed or RejectedNN
201Transaction cannot be refunded.YN
203Transaction status could not be updated try again.NAN
229Transaction cannot be captured.NAN
230Transaction Refund InitiatedNYFull Refund Success code
242Transaction captured successfully.NAY
243Transaction canceled successfully.NAY
245Transaction Partial Refund InitiatedNYPartial Refund Success code
19Refund scheduled with bank. Please try again after some time if not refundedNNPending case . Use Check status API with merchantRefId for final confirmation on refund. When failure is recieved in check status , then retry
20Refund already scheduled with bank. Please try again after some time if not refundedNNFull Refund Pending case . Use Check status API with merchantRefId for final confirmation on refund. When failure is recieved in check status , then retry
21Some Refunds already scheduled with bank. Please try other requests after some timeNNPrevious Partial Refunds Pending case . Check status for existing request with old merchantRefIds. For new partial refund send new unique merchantRefId in request
843Not enough unsettled funds available with MobiKwik.YN
844Transaction cannot be refunded from 'Settled' state. Please try again later.YN
846Transactions older than 6 months cannot be refunded.NN