When a shopper pays using UPI Collect, they enter their virtual payment address and complete the payment using the UPI app on their mobile device.
Make a payment
In your /payments request, specify:
paymentMethod.type
: upi_collect
paymentMethod.virtualPaymentAddress
: The UPI VPA that the shopper entered.
amount.currency
: INR
amount.value
: The value of the payment, in minor units.
curl https://checkout-test.adyen.com/v68/payments \
-H "x-API-key: YOUR_X-API-KEY" \
-H "content-type: application/json" \
-d '{
"amount": {
"currency": "INR",
"value": 12000
},
"countryCode": "IN",
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"reference": "YOUR_ORDER_NUMBER",
"paymentMethod": {
"type": "upi_collect",
"virtualPaymentAddress": "9999999999@upi"
},
"returnUrl": "https://your-company.com/checkout?shopperOrder=12xy..",
}'
https://docs.adyen.com/payment-methods/upi/api-only#-payments-request
The /payments response contains:
action.type
: await, this means you need to wait for the notification webhook to know the payment outcome.
{
"resultCode": "Pending",
"action": {
"paymentMethodType": "upi_collect",
"type": "await"
},
}
https://docs.adyen.com/payment-methods/upi/api-only#-payments-response
Show the waiting screen
- Show a waiting screen to the shopper. We recommend adding a countdown timer of 5 minutes to remind shoppers to complete the payment on their UPI app.
- Check your notification webhooks to see the payment result. We send you an AUTHORISATION notification after the shopper completes the payment in their UPI app.
- Once you receive the notification webhook, redirect the shopper to your website, and present the payment result.
Present the payment result
Wait for a notification webhook to know the outcome of the payment. The notification webhooks you can receive for UPI Collect are:
eventCode |
success field |
Description |
Action to take |
AUTHORISATION |
false |
The transaction failed. |
Cancel the order and inform the shopper that the payment failed. |
AUTHORISATION |
true |
The shopper successfully completed the payment. |
Inform the shopper that the payment has been successful and proceed with the order. |
Use the resultCode
that you received in the /payments response to inform your shopper of the payment status. The resultCode
values you can receive for payments made through UPI Collect are:
resultCode |
Description |
Action to take |
Error |
There was an error when the payment was being processed. For more information, check the
refusalReason
field. |
Inform the shopper that there was an error processing their payment. |
Pending |
The payment order was successfully received. |
Inform the shopper that you've received their order, and are waiting for the payment to clear. You will receive the final result of the payment in an AUTHORISATION notification. |
Refused |
The payment was refused. For more information, check the
refusalReason
field. |
Ask the shopper to try the payment again using a different payment method. |
Test and Go Live
Use these credentials to test UPI Collect:
Parameter |
Value |
VPA |
testvpa@icici |
Depending on your account setup, you may have access to the UPI simulator which you can use to test your UPI integration. Contact your Account Manager or our Support Team if you have questions about the simulator.
You can also use your personal account on a UPI app to test your integration by making live payments with a low value.
When a shopper pays with UPI QR, you present a QR code which they can scan using the UPI app on their mobile device. We recommend that you use screen size to determine whether the shopper is accessing your site on mobile, desktop, or tablet and present the QR Code for shoppers on desktop or tablet.
Make a payment
Make a /payments request with:
paymentMethod.type
: upi_qr
amount.currency
: INR
amount.value
: The value of the payment, in minor units.
curl https://checkout-test.adyen.com/v68/payments \
-H "x-API-key: YOUR_X-API-KEY" \
-H "content-type: application/json" \
-d '{
"amount": {
"currency": "INR",
"value": 3600
},
"countryCode": "IN",
"reference": "YOUR_ORDER_NUMBER",
"paymentMethod": {
"type": "upi_qr"
},
"browserInfo": {
"acceptHeader": "*/*",
"userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36"
},
"returnUrl": "https://test.adyen.com/",
"merchantAccount": "YOUR_MERCHANT_ACCOUNT"
}'
https://docs.adyen.com/payment-methods/upi/api-only#-payments-request
The /payments response contains:
action.qrCodeData
: Use this to render the QR code on your checkout page.
{
"resultCode": "Pending",
"action": {
"paymentMethodType": "upi_qr",
"qrCodeData": "iVBORw0KGgoAAAANSUhEUgAAAMgAAADIA….",
"type": "qrCode"
},
"details": [
{
"key": "payload",
"type": "text"
}
],
"redirect": {
"data": {
"qrCodeData": "iVBORw0KGgoAAAANS…."
},
}
}
https://docs.adyen.com/payment-methods/upi/api-only#-payments-response
Present the QR code
Follow these steps to render the QR code on your checkout page:
- Use the
qrCodeData
from the action
object to render the QR code on your checkout page. We recommend showing a countdown timer of 5 minutes to remind shoppers to complete the payment on their UPI app.
- After the shopper scans the QR code and completes the payment, we send a notification webhook informing you of the payment result.
- Present the payment result to your shopper.
Present the payment result
Wait for a notification webhook to know the outcome of the payment. The notification webhooks you can receive for UPI QR are:
eventCode |
success field |
Description |
Action to take |
AUTHORISATION |
false |
The transaction failed. |
Cancel the order and inform the shopper that the payment failed. |
AUTHORISATION |
true |
The shopper successfully completed the payment. |
Inform the shopper that the payment has been successful and proceed with the order. |
For UPI QR payments, you can receive the following resultCode
values:
resultCode |
Description |
Action to take |
Error |
There was an error when the payment was being processed. For more information, check the
refusalReason
field. |
Inform the shopper that there was an error processing their payment. |
Pending |
The payment order was successfully received. |
Inform the shopper that you've received their order, and are waiting for the payment to clear. You will receive the final result of the payment in an AUTHORISATION notification. |
Refused |
The payment was refused. For more information, check the
refusalReason
field. |
Ask the shopper to try the payment again using a different payment method. |
Test and Go Live
Depending on your account setup, you may have access to the UPI simulator which you can use to test your UPI integration. Contact your Account Manager or our Support Team if you have questions about the simulator.
You can also use your personal account on a UPI app to test your integration by making live payments with a low value.
When a shopper pays using UPI Intent, you need to redirect them to the UPI app on their mobile device. We recommend that you implement UPI Intent for mobile users only. Use screen size to determine whether the shopper is accessing your site on mobile, desktop, or tablet.
Make a payment
Make a /payments request with:
paymentMethod.type
: upi_intent
amount.currency
: INR
amount.value
: The value of the payment, in minor units.
curl https://checkout-test.adyen.com/v68/payments \
-H "x-API-key: YOUR_X-API-KEY" \
-H "content-type: application/json" \
-d '{
"amount": {
"currency": "INR",
"value": 15100
},
"countryCode": "IN",
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"reference": "YOUR_ORDER_NUMBER",
"paymentMethod": {
"type": "upi_intent"
},
"returnUrl": "https://your-company.com/checkout?shopperOrder=12xy.."
}'
https://docs.adyen.com/payment-methods/upi/api-only#-payments-request
{
"resultCode": "RedirectShopper",
"action": {
"paymentMethodType": "upi_intent",
"url": "upi://pay?pa=test@example.com&pn=Adyen Test&tr=6064362200000000000&tid=NC6HT9CRT65ZGN82&am=151.00&cu=INR&tn=UPI Transaction for NC6HT9CRT65ZGN82",
"method": "GET",
"type": "redirect"
}
}
https://docs.adyen.com/payment-methods/upi/api-only#-payments-response
Redirect the shopper
The /payments response contains:
action.url
: Use this to redirect the shopper to the UPI app on their mobile device.
App redirects work differently on Android and iOS. On Android, shoppers are given a choice of compatible apps to open the redirect link. iOS makes a default choice of which app to use.
To complete the payment, redirect the shopper to the action.url
returned in the /payments response.
Show the waiting screen
- Show a waiting screen to the shopper. We recommend adding a countdown timer of 5 minutes to remind shoppers to complete the payment on their UPI app.
- Check your webhook notifications to see the payment result. We send you an AUTHORISATION notification after the shopper completes the payment in their UPI app.
- Once you receive the notification webhook, redirect them to your website, and present the payment result.
Present the payment result
Wait for a notification webhook to know the outcome of the payment. The notification webhooks you can receive for UPI Intent are:
eventCode |
success field |
Description |
Action to take |
AUTHORISATION |
false |
The transaction failed. |
Cancel the order and inform the shopper that the payment failed. |
AUTHORISATION |
true |
The shopper successfully completed the payment. |
Inform the shopper that the payment has been successful and proceed with the order. |
For UPI Intent payments, you can receive the following resultCode
values:
resultCode |
Description |
Action to take |
Error |
There was an error when the payment was being processed. For more information, check the
refusalReason
field. |
Inform the shopper that there was an error processing their payment. |
RedirectShopper |
The shopper needs to be redirected to their UPI app to complete the payment. |
Redirect the shopper to complete the payment. |
Refused |
The payment was refused. For more information, check the
refusalReason
field. |
Ask the shopper to try the payment again using a different payment method. |
Test and Go Live
Depending on your account setup, you may have access to the UPI simulator which you can use to test your UPI integration. Contact your Account Manager or our Support Team if you have questions about the simulator.
You can also use your personal account on a UPI app to test your integration by making live payments with a low value.