Are you looking for test card numbers?

Would you like to contact support?

No momento, esta página não está disponível em inglês
Payment-method icon

API only

Accept UPI payments in India using our APIs, and build your own payment form to have full control over your checkout journey.

Before you begin

The API-only integration works the same way for all payment methods. If you haven't done this integration yet, refer to our API-only integration guide.

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.
/payments request
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..",
}'

The /payments response contains:

  • action.type: await, this means you need to wait for the notification webhook to know the payment outcome.
/payments response
{
    "resultCode": "Pending",
    "action": {
        "paymentMethodType": "upi_collect",
        "type": "await"
    },
}

Show the waiting screen

  1. 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.
  2. 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.
  3. 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.