🎉 Celebrate with 10% OFF on All Products! Use Code: GFEX10 Or Buy Any 2+ Items for 30% OFF with Code: GFEX30!
Guides & Tutorials November 8, 2026

How to Take PhonePe Payments with Gravity Forms (UPI, Cards, Net Banking)

GravityExtra
How to Take PhonePe Payments with Gravity Forms (UPI, Cards, Net Banking)

PhonePe is one of the most used ways to pay in India, and PhonePe PG, its payment gateway, lets businesses take UPI, card and net banking payments on a page hosted by PhonePe. If your class bookings, orders, registrations, fees or donations already run on Gravity Forms, you do not need a full shop to take those payments: the Gravity Forms PhonePe Premium Add-on connects your forms to your own PhonePe PG merchant account. The customer fills in the form, pays on the PhonePe page and comes back to your confirmation, and the entry is marked as paid only after the order has been read back from PhonePe. This guide shows how to set it up step by step, how to test it in the PhonePe UAT sandbox, and what happens behind the scenes.

Why take PhonePe payments through Gravity Forms?

A form is often the most natural way to sell something that is not a product on a shelf: a seat in a class, a consultation fee, an event pass, a school or coaching fee, a deposit for a custom order. Gravity Forms already handles the fields, the conditional logic and the total. What it needs is a safe way to collect the money in rupees. With PhonePe PG your customers pay the way most of them already pay every day, by UPI from their phone, or by card or net banking if they prefer, on a page hosted by PhonePe. With the add-on you keep everything else in Gravity Forms: the entry, the notes, the notifications and the refunds.

  • Customers pay on the PhonePe page, so UPI PINs, card numbers and bank logins are never typed into your website.
  • The amount is the total Gravity Forms calculated on your server, in rupees, to the paisa.
  • Entries show the real payment status, read from PhonePe, not what the browser says.
  • Refunds are one click away on the entry screen.

Forms that work well with PhonePe

  • Classes and workshops: seats, materials and options with quantities.
  • Consultations and services: a fixed fee or a calculated amount for a booking.
  • Coaching, schools and training: admissions, course fees, exam and event registrations.
  • Clubs, trusts and associations: memberships, event passes and donations (choose Donations in the feed).
  • Made-to-order products: options that change the price, paid before work starts.

What you need

  • Gravity Forms 2.9 or newer, with the currency set to Indian Rupee.
  • A PhonePe PG merchant account with Standard Checkout credentials: the UAT (test) Client ID, Client Version and Client Secret from the PhonePe Business Dashboard, and later the production ones once PhonePe has activated your account.
  • The Gravity Forms PhonePe Premium Add-on and a license: one site $49 a year, five sites $69 a year, unlimited sites $199 a year.
  • A site that PhonePe can reach for webhooks (any public website).

Step 1: Install the add-on and connect your account

Upload and activate the add-on, then open Forms → Settings → PhonePe and activate your license. Leave the mode on Test. In the PhonePe Business Dashboard open Developer Settings and copy the UAT Client ID, Client Version and Client Secret into the Test fields. When you save, the add-on asks PhonePe for an access token with them; the connection line turns green and the secret is stored encrypted and shown masked from then on.

PhonePe settings: Test or Live mode, the Client ID, Client Version and masked Client Secret of each mode, the webhook username and password, the rupee currency line, the connection line and the webhook address
Settings: choose Test or Live, paste the credentials of each mode and the webhook username and password. Secrets are checked with PhonePe and stored encrypted.

Next, set up the webhook. Copy the webhook address from the settings page, add a webhook with it in the PhonePe dashboard, choose a username and a password and select the order and refund events. Enter the same username and password in the add-on and save. PhonePe will send a hash of them with every webhook, and the add-on refuses any webhook without it.

Step 2: Build the form

Build the form as you would for any payment: product fields with prices and quantities, options, a total, and the customer’s name, email and mobile number. The mobile number is optional, but when you map it the PhonePe login is filled in for the customer, which saves a step on the phone. Change the submit button text to something like Continue to payment so customers know what comes next.

A pottery class booking form with quantities, the customer name, email and mobile number, and the total in rupees, with the Continue to payment button
The form: Gravity Forms works out the total in rupees; the customer pays it on the PhonePe page.

Step 3: Add a PhonePe feed

In the form settings open PhonePe and add a feed. Pick Products and Services (or Donations), the form total as the amount, and map the mobile number and email. The payment message is sent with the order; merge tags such as the form title and the entry number work. Tick the option to send form notifications only after the customer has paid, so your team does not start work on unpaid bookings.

The PhonePe feed: products and services with the form total, the mobile number and email mapping, the payment message with merge tags and notifications after payment
The feed: map the mobile number and email and write the payment message.

Step 4: Test in the UAT sandbox

Open the form on your site, fill it in and continue to payment. On the PhonePe page, pay with one of the test cards or UPI test flows from the PhonePe UAT documentation. You come back to your confirmation, and the entry shows Paid with a Test badge. Try the other paths too: a failed test payment should give Failed, and a pending one should show the waiting page and then update by itself. Then refund part of the paid test payment from the entry screen and watch it move from in progress to completed.

An entry paid through PhonePe: the PhonePe box with the status, amount, PhonePe order, order reference, payment mode and transaction, the Refresh status button and the refund form, and the entry notes
The entry: status, PhonePe order, reference, payment mode and transaction, read back from PhonePe, with refunds one click away.

What happens behind the scenes

When the form is submitted, the add-on creates the PhonePe order from your server with the total in paise, a unique order reference (used by PhonePe as the merchant order id), the reference again in the order details, and a signed return link. PhonePe answers with the order and its payment page, and the add-on checks it before sending the customer anywhere: the order must be open and the payment page must be on phonepe.com, or the customer is told nothing was charged.

After the payment, three things can update the entry: the customer coming back, the PhonePe webhook, and a status check that runs every five minutes. None of them decides on its own. Each one makes the add-on read the order from PhonePe, and the entry is marked Paid only when PhonePe says the order is complete for the right amount, with the entry’s order reference and PhonePe order id. A webhook must carry the hash of your webhook username and password, and a repeated webhook is dropped, so a payment can never be completed twice. Behind all of this, the add-on uses the current PhonePe PG API: it gets an access token with your credentials, keeps it encrypted until shortly before it expires and renews it by itself.

A worked example

A pottery studio in Bengaluru sells three-hour wheel-throwing classes at 1,250.00 rupees and glaze-and-firing add-ons at 499.00 rupees through a Gravity Forms booking form. Ananya books two seats and one add-on. Gravity Forms shows a total of 2,999.00 rupees; the add-on creates a PhonePe order of 2,99,900 paise with the message “Pottery class booking #412” and her mobile number filled in. She pays by UPI on the PhonePe page and lands back on the studio’s confirmation: “Thank you! Your class is booked and paid.” Behind the scenes, the entry was marked Paid only after PhonePe confirmed the order complete for 2,99,900 paise. The held “Booking received” email went to the studio at that moment, not before. A week later Ananya can only come alone, so the studio refunds one seat, 1,250.00 rupees, from the entry screen; the refund shows as in progress, and when PhonePe completes it the entry records the refund and stays Paid for the rest.

How it differs

  • Nothing is trusted from the browser or the webhook body: every result is read back from PhonePe and checked against the entry before it changes.
  • Webhooks must carry the hash of your webhook username and password; forged or repeated webhooks change nothing.
  • Credentials are checked with PhonePe when you save, and every entry keeps the mode (UAT sandbox or production) it was created in.
  • Refunds are checked against PhonePe first, protected by a one-time form, reserved while PhonePe processes them and followed until they complete.
  • Per-visitor limits and an hourly cap stop a flood of form posts from creating orders without end.

Tips for smooth payments

  • Map the customer’s mobile number: the PhonePe login is filled in and the customer pays faster.
  • Keep the payment message short and clear (60 characters at most), for example the form title and the entry number.
  • Hold form notifications until payment so your team only sees paid bookings.
  • Use the Payment Completed notification event to send the customer a receipt from your site.
  • Set up the webhook in both the UAT and the production dashboards, so entries update within seconds.

Step 5: Go live

Finish the PhonePe PG onboarding so PhonePe activates your account for production. Copy the production Client ID, Client Version and Client Secret into the Live fields, set up the production webhook with the same address, username and password, switch the mode to Live and save. Make one small real payment, check the entry, and refund it from the entry screen. Entries created in Test mode keep reading from the UAT sandbox, so nothing mixes.

Questions

Do payment details reach my website?

No. The customer pays on the PhonePe page. Your site only receives the PhonePe order id, the status, the payment mode and the PhonePe transaction id.

Can I take payments in other currencies?

PhonePe PG payments are in Indian rupees, so the Gravity Forms currency must be INR. Forms in another currency are refused before anything is sent to PhonePe.

What if the webhook never arrives?

The return page reads the order when the customer comes back, and the status check reads every waiting order every five minutes. You can also click Refresh status on the entry.

Can I refund part of a payment?

Yes. Type the amount on the entry screen; the add-on checks it fits what is left after earlier and pending refunds. The entry becomes Refunded when the whole amount has been refunded.

Are subscriptions supported?

This add-on handles one-off payments: products, services and donations.

Get started

Read the setup guide for every setting, or get the Gravity Forms PhonePe Premium Add-on and take your first PhonePe payment through Gravity Forms today. Plans: one site $49 a year, five sites $69 a year, unlimited sites $199 a year.

0
0
Your Cart
Your cart is emptyReturn to Shop
🔥 FREQUENTLY BOUGHT TOGETHER
Complete Combo & Save 40%!
ITEM IN YOUR CART
Gravity Forms Klaviyo Add-on
$39.00/yr
+
🎁 RECOMMENDED ADD-ON SAVE 40% OFF
Original Price: $39.00/yr
Bundle Special Price: $23.40/yr