Getting Started with Payment Gateway

Build a secure payment solution on your website or mobile app with Razorpay and receive payments from your customers using various payment methods on your Checkout form. You can track payments at every step of its life cycle and effectively manage them.

All core payment operations such as payment creation, authorization, capture and refunds can be performed via our APIs. You can perform some of these operations via the Dashboard.

Overview of the Payment Flow#

  1. Customer selects an item on your website or app.
  2. An Order is created at your end.
  3. Customer enters the payment details and clicks Pay in the Checkout form.
  4. The payment is authorized by the customer's bank and the money is deducted from the customer's account.
  5. You receive the authorized amount in your account as per the settlement schedule of the bank.

Before accepting payments from your customers, familiarize yourselves with the different states in the payment processing flow.

Understand the Payment Flow#

Order Creation#

The customer selects an item on your website or app. An order is created and is sent to your server.

For every order created in your site, let's say, order_ID a corresponding razorpay_order_ID is created in Razorpay's servers.

To know how Orders are created in Razorpay, refer the Orders documentation.

Collection of Payment Details#

In the client-side implementation of your application, the customer selects the appropriate payment method, clicks Pay and completes the payment. The payment details thus obtained from the customer are sent to your server.

By integrating with Razorpay, the payment details entered in the Checkout will be first sent to the Razorpay servers. The payment details submitted are secured and stored by Razorpay as tokens. The generated tokens are exchanged with your servers for further use.

You can use Razorpay's default Checkout form to accept the entered payment details. Learn more about Checkout

Authentication and Authorization of the Payment#

The payment details collected from the customer are sent to your bank. Internally, Razorpay sends an authentication request to the customer's bank. After appropriate authentication, Razorpay is authorized to deduct the amount from the customer's bank account. Once authorized, the transaction amount is retained with Razorpay and is not settled to your account immediately.

Late Authorization#

There could be situations when an authorized payment, yet to be debited from the customer's account, is interrupted by external factors such as network issues, technical errors at customer's bank's end, manual intervention and so on.

For detailed information about Late Authorization, refer the documentation.

Capture of the Payments#

Once the payment is authorized by the customer's bank, you must verify if the authorized amount deducted from the customer's account is the same as the amount entered by the customer in the Checkout form. The authorized amount will be transferred to your account only after this validation step.

Razorpay enables you to capture the payment in two ways:

Auto Capture#

Auto Capture is the authorization followed by an 'immediate' capture of the payments. This allows you to automatically capture payments from customers before the authorization period ends, which saves time when processing orders.

To set up automatic capture of payments, you must implement Orders API in your integration. To learn about auto capturing payments, refer Orders documentation

Standard Capture#

Standard capture is an authorization followed by a 'delayed' capture of the payment, until a later time. In this scenario, if a customer has made the payment, the amount will be deducted from their bank account by your bank. However, it would not be transferred to you until you initiate the ‘capture’ process manually.

Settlement of the Payments#

After a successful capture of the funds, the amount is settled to your account within T+3 days where 'T' is the day on which payment is captured. However, the settlement time could vary depending on the settlement schedule defined by the bank.

Refund of the Payments#

After the funds are settled to your account, the customers could request for a transfer of the payment made by them earlier. In such cases, a refund is initiated by Razorpay and the funds are transferred back to the customer's account.

Any authorization not followed by a capture within 5 days is automatically deemed void and a refund is initiated. The reversal of funds from your account to the customer's account will be charged by Razorpay.

Payment States#

In a standard payment flow, a payment goes through the following states:

created
Payment is created when the customer fills up and submits the payment information and it is sent to the Razorpay API. No processing has been done on the payment at this stage.
authorized
An authorization is performed when customer's payment details are successfully authenticated by the bank. The money is deducted from the customer’s account, but will not be transferred to your account until the funds are captured.
captured
The authorized payment is verified as complete by Razorpay. After capture, the amount is transferred to your account as per the settlement schedule. The captured amount must be same as authorized amount. Any authorization not followed by a capture within 5 days is automatically voided and the amount is refunded to the customer.
refunded
A successfully captured payment should be refunded by you and the amount is transferred back to the customer's bank account.
failed
Any unsuccessful transaction is marked as failed and you might have to retry the operation till you succeed.

Integrate with Payment Gateway#

Based on your requirement, you can integrate your website or mobile apps with Razorpay's range of solutions: