webUPI.sendPayment()

Request that the user sends a payment for a UPI URI. The application needs to provide a UPI URI.

Method


async function sendPayment(upiUri: string): SendPaymentResponse;

Parameters

upiUri: string // the UPI URI you'd like the user to pay.


interface SendPaymentArgs {
  upiUri: string; // the UPI URI you'd like the user to pay.
  callback_url?: string // Once a user approves or denies a payment, the UPI provider can notify the web app using the provided callback URL.
}

Response


interface SendPaymentResponse {
  transactionId: string;
}

Callback Response

{
  "transactionId": "string",
  "status": "approved/declined"
}

Example


const upiUri = "upi://pay?pa=payeeVPA&pn=Payee Name&mc=0000&tid=TransactionId&tr=TransactionRefId&tn=Transaction Note&am=Transaction Amount&cu=INR";
const result = await window.webUPI.sendPayment(upiUri);

Also Read UPI Linking Specs to create custom upiUri 👇

Last updated