Webhooks

Zaakpay Push Notifications

Webhooks are server to server API Callbacks or Push Notifications triggered on specific events. Zaakpay sends the Callback of the transaction on the merchant's Webhook url.

Configuration

For Production, Zaakpay Webhooks can be configured from Zaakpay Dashboard by merchant and receive notifications when a specific event occurs.

Method Type: POST

End point: Callback URL can be configured by Merchant via Zaakpay Dashboard.

When the events triggered, Zaakpay send an HTTP POST request with two parameters txnData and checksum, both in the POST Body, in application/json format, and the realtime query parameter is the one that is solely being passed in the url on webhook URL.

13561356

Request attributes

Zaakpay POST below 2 attributes along with the realtime=true(false for non real time) as query parameter that is passed in the url.

Fields DataType Mandatory Description
txnDataJSON Y This JSON also has 3 fields: 1.txns: Txn information. 2. merchantIdentifier: Merchant identifier. 3.refunds: All txns auto-refunded if auto-refund is enabled by merchant.
checksumString Ychecksum calculated on the entire JSON value of txnData using secret key of the merchant.

Use of Webhooks

For Webhooks, You receive the data when event triggered/transaction complete. If you are using Webhooks, you don't need to keep polling, you will receive the webhook on completion of transaction.

Based on the Transaction Success time Zaakpay sends Webhooks, which are classified into two categories:-

  1. Real Time Webhook
    Zaakpay will send the callback for all the transactions that got successful or declined in real time

  2. Non Real Time Webhook
    Zaakpay will send the callback for all the transactions that got updated in non-real time or after bank recon

Sometimes, the communication between the bank and Zaakpay may not take place. This could be due to any issue at bank's end while the processing the transaction.
Zaakpay retry to get the response from Bank, when we didn't get any resposne, we marked that transaction as Failed at Zaakpay's end, but it changed to Success at a later time when bank send us the file after reconciliation.

❗️

Non Real Time Webhooks

When there are more than 10 transactions which have been updated in bank reconciliation, there will be multiple POST requests. Currently there can be maximum 10 transactions in one POST request/Call.

For Example, if there are total 26 transactions that have been updated on a day, Zaakpay will make 3 POST requests to merchant’s push notification url. First 2 requests will have 10 transactions each in JSON and the 3rd request will have 6 transactions.

Sample Request/data posted by Zaakpay

This is a sample request, Showing how Zaakpay POST data on the merchant's URL

curl --location --request POST '[WEBHOOK_URL]?realtime=true' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'txnData={"merchantIdentifier":"fb2016ffd3a64b2994a6289dc2b671a4","txns":[{"amount":"850","pgTransId":"ZP5ccbbe5d0b30b","orderId":"ZP43613736458877783333","paymentMode":"Debit Card","cardScheme":"Visa","product3Description":"NA","cardToken":"4012 XXXX XXXX 1112","responseCode":"100","bank":"HDFC","bankid":"NA","doRedirect":"false","product1Description":"NA","product4Description":"NA","responseDescription":"The transaction was completed successfully. ","cardId":"25157d8564f730461489ea3102c393fd3bf13cfed94966f44815714d57170f4c~273","cardhashid":"CH373","paymentMethod":"401200","product2Description":"NA","pgTransTime":"09\/24\/2021 16:49:40","txnDate":"2021-09-24 16:49:41.36","productDescription":"NA"}]}' \
--data-urlencode 'checksum=be47e490cd5638b7b0e263090205ef1ad705b0cbca9b14bd987193a496d0d6b9'

Real Time Webhook

Data POSTED by Zaakpay for Real Time Webhooks.

txnData={
   "merchantIdentifier":"fb2016ffd3a64b2994a6289dc2b671a4",
   "txns":[
      {
         "amount":"1000",
         "pgTransId":"ZP5ccbb5a8b4959",
         "orderId":"ZPLive1632479839916",
         "paymentMode":"Debit Card",
         "cardScheme":"Visa",
         "product3Description":"NA",
         "cardToken":"4012 XXXX XXXX 1112",
         "responseCode":"100",
         "bank":"HDFC",
         "bankid":"NA",
         "doRedirect":"false",
         "product1Description":"NA",
         "product4Description":"NA",
         "responseDescription":"The transaction was completed successfully. ",
         "cardId":"25157d8564f730461489ea3102c393fd3bf13cfed94966f44815714d57170f4c~273",
         "cardhashid":"CH373",
         "paymentMethod":"401200",
         "product2Description":"NA",
         "pgTransTime":"09\/24\/2021 16:11:06",
         "txnDate":"2021-09-24 16:11:07.272",
         "productDescription":"Zaakpay subscription fee"
      }
   ]
}&checksum=b114d127fbe793150ef7a0d10e3c084c975b48d20382bacb0080864f573dd6ea
txnData={
   "merchantIdentifier":"b19e8f103bce406cbd3476431b6b7973",
   "txns":[
      {
         "amount":"100",
         "pgTransId":"ZP5c60ee0e4d993",
         "orderId":"669-16251420",
         "paymentMode":"unknown",
         "cardScheme":"NA",
         "product3Description":"NA",
         "cardToken":"NA",
         "responseCode":"1021",
         "bank":"NA",
         "bankid":"NA",
         "doRedirect":"false",
         "product1Description":"NA",
         "product4Description":"NA",
         "responseDescription":"Minimum Transaction Limit is 9 Rupees ",
         "cardId":"NA",
         "cardhashid":"NA",
         "paymentMethod":"Not Found",
         "product2Description":"NA",
         "pgTransTime":"07\/01\/2021 17:51:28",
         "txnDate":"2021-07-01 17:51:28.623",
         "productDescription":"medical product"
      }
   ]
}&checksum=5ad76f8041fa898ba4c29caa2e98e6c5a05dbba2aade3bc551daa0cf9d73f208

Non Real Time Webhook

Data POSTED by Zaakpay for Non Real Time Webhooks.

txnData={
   "merchantIdentifier":"b19e8f103bce406cbd3476431b6b7973",
   "txns":[
      {
         "amount":1000,
         "orderid":"ZPLive1625124227854",
         "txnDate":"2021-07-01 12:53:55.0"
      }
   ]
}&checksum=1f2d42b7557164ec17bfda28b1efb943dc13e3a4d27aa9dd6d1d83a5fed231ef

👍

Want to Test Webhooks?

To test the real time webhook, Please get in touch with the Integration team. Drop mail along with your Webhooks URL.

Checksum Calculation

Checksum will be calculated on the entire JSON value of txnData using secret key of the merchant. For Instance, Please refer to below Checksum String and Generated Checksum.

{"merchantIdentifier":"fb2016ffd3a64b2994a6289dc2b671a4","txns":[{"amount":"850","pgTransId":"ZP5ccbbe5d0b30b","orderId":"ZP43613736458877783333","paymentMode":"Debit Card","cardScheme":"Visa","product3Description":"NA","cardToken":"4012 XXXX XXXX 1112","responseCode":"100","bank":"HDFC","bankid":"NA","doRedirect":"false","product1Description":"NA","product4Description":"NA","responseDescription":"The transaction was completed successfully. ","cardId":"25157d8564f730461489ea3102c393fd3bf13cfed94966f44815714d57170f4c~273","cardhashid":"CH373","paymentMethod":"401200","product2Description":"NA","pgTransTime":"09\/24\/2021 16:49:40","txnDate":"2021-09-24 16:49:41.36","productDescription":"NA"}]}
be47e490cd5638b7b0e263090205ef1ad705b0cbca9b14bd987193a496d0d6b9

Response

In Response to the above call, Merchant should return HTTP status code 2xx and "SUCCESS" to Zaakpay.

🚧

Didn't Receive 2XX Response?

If Zaakpay does not receive this response, Zaakpay will retry above request with same data again.


Did this page help you?