Introduction

The Server-to-Server (S2S) UPI Intent integration eliminates redirection hops by initiating transactions from your backend. Deliver a seamless checkout experience while maintaining control and confidence for your customers.

Intent Invocation

Intent invocation is simply the act of packaging your UPI payment details (amount, payee VPA, reference, etc.) into a deep-link URI and then launching the user’s UPI app directly from your front end. With a specific intent, you target a known app (e.g. Google Pay), while a generic intent lets Android show an app picker (on iOS it falls back to the default handler), all without bouncing users through extra web redirects.

Prerequisites

Before you begin, ensure you have:

  • Merchant Key & Salt: Your EximPe merchant key and salt for hash generation.
  • Callback URL: A publicly accessible URL configured in your EximPe dashboard for server-to-server callbacks.
  • cURL or HTTP Client: Capability to make HTTPS POST and GET requests from your server.
  • UPI Knowledge: Familiarity with UPI intent URL parameters and encoding.

The following steps allow you to integrate the server-to-server UPI intent:

  1. Initiate payment

  2. Invoke UPI Intent on customer’s device

  3. Check UPI transaction status

  4. EximPe sends Server-to-Server callback response

    Process flow

Step 1: Initiate payment

Sample UPI Collection Request Body

{
  "amount": "1000.00",
  "collection_mode": "s2s",
  "upi_flow_type": "intent",
  "currency": "INR",
  "reference_id": "S2SI_U8MEIT",
  "mop_type": "UPI",
  "buyer": {
    "name": "John Doe",
    "email": "[email protected]",
    "phone": "+919876543210",
    "address": {
      "line_1": "123 Main Street",
      "line_2": "Apt 4B",
      "city": "City",
      "state": "State",
      "postal_code": "123456"
    },
    "ip_address": "192.168.1.100",
    "user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
  },
  "product": {
    "name": "Sample Product",
    "description": "This is a sample product description",
    "hs_code": "98051000",
    "hs_code_description": "Portable automatic data processing machines",
    "type_of_goods": "goods"
  },
  "invoice": {
    "number": "INV_V9TZZ3",
    "date": "2025-07-08"
  }
}

For the S2S UPI Intent request, you must include these additional parameters beyond the standard checkout fields:

  • collection_mode: must be set to "s2s"
  • upi_flow_type: must be set to "intent"
  • buyer.ip_address: the customer’s device IP address
  • buyer.user_agent: the customer’s browser or app user-agent string

S2S UPI Intent Response

{
  "success": true,
  "message": "S2S UPI Request created successfully",
  "data": {
    "intent_uri": "pa=kk.payutest@hdfcbank&pn=&tr=403993715534292371&tid=PPPL403993715534292371080725205418&am=1000.00&cu=INR&tn=UPIIntent",
    "order_id": "OD2000992103"
  }
}

For S2S UPI Intent mode, the response includes:

  • order_id: Unique order identifier
  • intent_uri: UPI intent link that can be used to open UPI apps directly

Explanation of URL Arguments

ArgumentExample ValueRequiredDescription
pamerchant@bankYesPayee VPA (Virtual Payment Address) — the merchant’s UPI ID that will receive the payment
pnMerchant NameYesPayee Name — the display name of the merchant
am100.00NoAmount — the payment amount (decimal, up to two places)
cuINRYesCurrency — must be INR for Indian rupees
trTXN12345YesTransaction Reference ID — unique identifier for this transaction (for reconciliation)
tidTXNID98765NoTransaction ID — a unique transaction ID (sometimes required by specific apps, e.g., Google Pay)
tnOrder PaymentNoTransaction Note — a short note or description for the payment

Step 2: Invoke UPI Intent on Customer’s Device

Mobile Web

Invoke a UPI payment on the customer’s mobile device by constructing a UPI intent URL using the intent-uri from the S2S UPI Intent Response

Generic UPI Intent Example

upi://pay?pa=merchant@bank&pn=Merchant%20Name&am=100.00&cu=INR&tr=TXN12345&tn=Order%20Payment

This URL opens the system UPI app picker, allowing the user to choose any installed UPI app to complete the payment.

Specific App Intent Example (Google Pay)

gpay://upi/pay?pa=merchant@bank&pn=Merchant%20Name&tr=TXN12345&tid=TXNID98765&am=100.00&cu=INR&tn=Order%20Payment

This URL attempts to open the Google Pay app directly (using the gpay:// scheme) with the payment details pre-filled. If Google Pay is not installed or the scheme is not supported in the browser, the intent may fail. Always keep the generic intent as fallback.

UPI AppURL Scheme Prefix
Google Paygpay://upi/pay
PhonePephonepe://pay
BHIMupi://pay (generic)
Paytmpaytmmp://pay
Amazon Payamazonpay://upi/pay
WhatsAppwhatsapp://pay
Fi Moneyfi://upi/pay
Jupiterjupiter://upi/pay
Sliceslice://upi/pay

Step 3: Check UPI Transaction Status

Invoke the **Order details API **to retrieve the status of the UPI transaction:

curl -X GET https://api.eximpe.com/pg/orders/{order_id} \
  -H "X-Client-ID: YOUR_CLIENT_ID" \
  -H "X-Client-Secret: YOUR_CLIENT_SECRET"

For detailed parameters and response formats, see the Get Order API

Step 4: EximPe sends S2S callback response

EximPe can also send a server-to-server callback response whenever the transaction status gets updated.

For more information, see the Payment Successful response

On Android, Chrome supports an intent-based deep link method that simplifies app invocation and provides built-in fallback mechanisms.

How It Works

  • Intent URL format:

    intent://<path-and-params>#Intent;scheme=<android_scheme>;package=<package_name>;S.browser_fallback_url=<fallback_url>;end;
    
  • scheme: Corresponds to the app’s URL scheme (e.g., gpay, phonepe).

  • package: Android package name for the target app.

  • S.browser_fallback_url: Optional. A URL (typically Play Store link) to redirect users if the app is not installed.

Example (Google Pay)

intent://upi/pay?pa=merchant@bank&pn=Merchant%20Name&am=100.00&cu=INR&tr=TXN12345&tn=Order%20Payment#Intent;scheme=gpay;package=com.google.android.apps.nbu.paisa.user;S.browser_fallback_url=https://play.google.com/store/apps/details?id=com.google.android.apps.nbu.paisa.user;end;
  • Flow:
    1. Chrome attempts to open Google Pay via gpay://.
    2. If installed, the payment screen launches.
    3. If not installed, the user is redirected to the Play Store.
UPI AppAndroid SchemeAndroid Package Name
Google Paygpaycom.google.android.apps.nbu.paisa.user
PhonePephonepecom.phonepe.app
BHIMupiin.org.npci.upiapp
Paytmpaytmmpnet.one97.paytm
Amazon Payamazonpayin.amazon.mShop.android.shopping
WhatsAppwhatsappcom.whatsapp
Fi Moneyficom.fi.money
Jupiterjupitermoney.jupiter.app
Sliceslicecom.sliceit.app

Benefits

  • Seamless UX: Direct app launch without intermediate redirects.
  • Robust Fallback: Ensures users without the app receive clear next steps (install link).
  • Unified Approach: Use a single URL for both deep linking and fallback.