There are two broad types of payment flows -

  1. Where customer is redirected to a third party page (bank OTP page, app login page, etc.)

  2. Where customer needs to approve the payment through an asynchronous process (example - by approving a payment request on their phone).

While the former requires a redirection to the third party page, the latter does not. In case the customer is redirected from your website to a third party page, you would also want them to return back to your application. The `return_url` provided in the create order API call is used for this.

Return URL

Once the customer has completed the payment on the banks OTP page, we will redirect them back to your `return_url`. This will be a link based redirection, so if you have provided a return_url of the format - `{order_id}&order_token={order_token} ` - the customer will be redirected to the url - ``

Once you receive a request on this URL, you must first confirm if the order_token and the order_id belong to the same order. You must then check the status of the order in your system. If the system is already paid, you do not need to fulfil the order again. However, if the order is still in an ACTIVE state, you need to fetch the order status from Cashfree. You must fetch the order status from your backend using the `/orders/:orderID` API call as below.