Handling Callbacks & Status Check API
There are 2 ways to know the transaction status, 1st by consuming Callbacks and 2nd by calling Status API for respective flows. Transaction Status Check should be only done when there is a delay/miss in a callback from PG or merchant system was unavailable to consume it.
Why would we say that? While our callbacks are delivered instantly, it also depends on multiple other stakeholders in the UPI Payments Ecosystem delivering final confirmation in a timely manner to PSP Servers. Hence, for business critical events such as communicating real-time payment status to your customers, it is recommended to use the Status API. Also to reduce number of complaints & chargebacks from customers/merchants.
Please note that we highly recommend consuming Callbacks in first place.
Handling Callbacks(Webhooks)
After the completion of every transaction, PSP will provide direct notification to your server regarding the status. You must configure a valid HTTPS endpoint that is reachable from our servers to consume these notifications. Our servers will push data using HTTP POST calls to your endpoint. When consuming callbacks, it's essential to provide a 200 Status Response with content-type as application/json mandatorily. Juspay considers a callback as "not notified" if it receives a non-200 response or UnsupportedContentType. In that case, there is exponential retry of callback for 4 times within next 30 sec at 0, 2, 6, 14, 30 seconds respectively.
Handling Delayed Status Updates
Occasionally it may be possible that the transaction status does not get updated immediately due to delays across payment processing systems(Network & Bank). In such cases, it is recommended to continuously use the Status API to poll and verify status.
Your business policy might have a predefined order timeouts (a specified duration post which payments will not be accepted against the order). This may range from few minutes to a few days depending on the type of product/ service offered by your business
Before declaring an order as timed-out, please use status API to check the final status of the transaction. In case the transaction has reached terminal status, please fulfill the order.
In case the transaction status has not reached a terminal status, assure your customers that the “Order fulfillment has failed, and any amount deducted will be automatically refunded.
In case you want to process refund for delayed success orders, you can setup Auto-Refund from your by using Refund API.
Status Check Strategy
PSP provides a server-to-server mechanism of verifying the Status.
Is there a recommended status polling logic?
Yes, In order to optimise the number of status API calls, post transaction completion you should call the API at below time intervals upto your order fulfilment window(a specified duration post which payments will not be accepted against the order). Polling should be stopped once terminal status is received for the transaction.
This is only a recommended logic and can be customised as per your business use case
|
Time post request initiation to PSP
|
Polling Logic
|
|---|---|
T+30 second
| Poll at 30th second
|
T+1 minutes
| Poll at 1st Minute
|
T+2 minutes
| Poll at 2nd Minute
|
T+4 minutes
| Poll at 4th Minute
|
T+8 minutes
| Poll at 8th Minute
|
T+16 minutes
| Poll at 16th Minute
|
T+47 minutes
| Poll at 47 Minute
|
T>1 hours and T<=24 hours
| Poll at 2nd hour, 6th hour, 12th hour and 24th hours
|

