Collect UPI payments from your customers using the Razorpay S2S UPI Collect Flow API.
UPI payments enable customers to make payments using a Virtual Payment Address (VPA) without entering bank information.
Customers enter their VPAs on your UI, open the respective UPI apps and complete the payment after 2-factor authentication (UPI PIN and MPIN) on their mobile devices. Customers are redirected to your website or app after successful payment.
In this flow, customers likely enter invalid VPAs or forget their VPAs, which could lead to higher drop-off rates.To overcome this problem, Razorpay enables you to validate and save the VPAs of a customer. Know more about
0: If a customer with the same details already exists, fetch details of the existing customer.
1 (default): If a customer with the same details already exists, it throws an error.
notes
optional
json object Set of key-value pairs that can be associated with an entity. This can be useful for storing additional information about the entity. A maximum of 15 key-value pairs, each of 256 characters (maximum), are supported.
integer The amount for which the order was created, in currency subunits. For example, for an amount of ₹295, enter 29500.
currency
mandatory
string ISO code for the currency in which you want to accept the payment. Only INR is supported.
receipt
optional
string Receipt number that corresponds to this order, set for your internal reference. Maximum length of 40 characters.
notes
optional
json object Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example, "note_key": "Beam me up Scotty”.
string URL where Razorpay will submit the final payment status.
ip
mandatory
string The client's browser IP address. For example, 117.217.74.98.
referer
mandatory
string Value of referer header passed by the client's browser. For example, https://example.com/
user_agent
mandatory
string Value of user_agent header passed by the client's browser. For example, Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36
upi
Details of the collect expiry.
flow
mandatory
string Specify the type of the UPI payment flow. Possible values are:
collect (default)
intent
vpa
mandatory
string The customer's VPA to which the collect request will be sent.
expiry_time
mandatory
integer The number of minutes after which the link will expire. The default value is 5. Maximum value is 5760.
Once the customer completes the payment, a POST request is made to the callback_url provided in the payment request. The data contained in this request will depend on whether the payment was a success or a failure.
integer The amount for which the order was created, in currency subunits. For example, for an amount of ₹295, enter 29500. Payment can only be made for this amount against the order.
currency
mandatory
string ISO code for the currency in which you want to accept the payment. Refer the
string Receipt number that corresponds to this order, set for your internal reference. Can have a maximum length of 40 characters.
notes
optional
json object Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example, "note_key": "Beam me up Scotty”.
Once the payment is successfully created, you will receive a response containing the next array. This array tells you the next steps that you should take to process the payment:
razorpay_payment_id
string Unique identifier for the payment returned by Checkout only for successful payments.
next
array A list of action objects available to you to continue the payment process. Present when the payment requires further processing.
action
string The action that you need to perform further. In this case, the value is poll
url
string Contains the URL that you must poll to fetch the status of the payment, either authorized or failed.
Once the customer completes the payment, a POST request is made to the callback_url provided in the payment request. The data contained in this request will depend on whether the payment was a success or a failure.