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".
Update-Refund API
Purpose: The purpose of this API is to update the status or to refund the transaction.
Environment details:
- Staging Server: https://zaakstaging.zaakpay.com / http://zaakpay-stagapi1.mbkinternal.in
- Live Server: https://api.zaakpay.com
Request Type: POST
Endpoint: /updateTxn
Request Attributes
These are the Request Attributes of Zaakpay Update/Refund API.
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.
Updated almost 2 years ago