How to Accept UPI Payments on WordPress (WooCommerce + Custom Sites)
VyaparGateway Team
Payments Editorial
WordPress (especially WooCommerce) is the most popular e-commerce platform for Indian SMBs that want to own their store outright, without paying monthly platform fees. Adding UPI to a WordPress store is straightforward if you use a maintained plugin — and a controlled engineering project if you're working with a custom WordPress site. This guide covers both paths, with the specific gotchas that catch Indian merchants moving from cards to UPI on WordPress.
WooCommerce vs custom WordPress: which path is yours
WordPress UPI integration follows two different patterns depending on what your site is:
- WooCommerce store — install a UPI payment gateway plugin from the WordPress.org repo (or the gateway's site), configure it in WooCommerce → Settings → Payments. Done in under an hour.
- Custom WordPress (no WooCommerce) — use the gateway's PHP SDK or REST API to integrate UPI directly into your page templates and custom post types. A small development project, usually under a day.
The vast majority of Indian WordPress e-commerce sites use WooCommerce, so we'll focus there first, then cover the custom WordPress path.
Path A: WooCommerce setup with VyaparGateway plugin
From your WordPress admin:
- Navigate to Plugins → Add New, search 'VyaparGateway for WooCommerce', click Install and Activate.
- Go to WooCommerce → Settings → Payments. You'll see 'VyaparGateway UPI' in the list of payment methods.
- Click Manage. Paste your API key and webhook signing secret from your VyaparGateway dashboard.
- Set 'Title' (what customers see at checkout, e.g. 'Pay with UPI') and 'Description' (the helper text).
- Choose intent expiry (default 15 minutes), enable test mode for initial validation, save.
- Enable the method by toggling its switch in the main payment methods list.
Path A continued: test before going live
Place a test order in your own store using a low-value product and your own UPI app:
- Add product to cart, proceed to checkout.
- Select 'Pay with UPI', click Place Order.
- Scan the rendered QR with your UPI app, complete the payment.
- Verify the order status in WooCommerce → Orders transitions to 'Processing' (paid) within ~10 seconds.
- Check that the UTR appears in the order notes.
- Verify the credit reaches your bank account.
If all six work, switch test mode off and you're live for real customers.
Path B: Custom WordPress without WooCommerce
If you're running a custom WordPress site (e.g. a membership site, course platform, or service business) without WooCommerce, you'll integrate VyaparGateway directly via PHP:
- Install the VyaparGateway PHP SDK via Composer: composer require vyapargateway/php-sdk.
- Create a custom shortcode or template function that calls the SDK's createIntent() method when the user clicks Pay.
- Render the returned QR (or intent URL for mobile) in the page.
- Create a custom WordPress REST API endpoint at /wp-json/vyapargateway/v1/webhook that validates the signature and updates your custom post type / user meta to mark the order paid.
- Use WordPress hooks (do_action) after webhook success to trigger your own fulfilment logic (send course access email, grant membership, etc).
"Custom WordPress integration is a real but bounded project — usually 4–8 hours of developer time. The structure is the same as any UPI integration: create intent, render QR, verify webhook, fulfil."
Common Woo + UPI gotchas
Issues that show up in production:
- Webhook URL not reachable — if your WordPress site is behind a basic-auth password (e.g. staging environment), the gateway can't reach your webhook endpoint. Either whitelist the gateway's IPs or remove basic-auth.
- Plugin conflicts — security plugins like Wordfence sometimes block webhook POSTs as 'suspicious'. Add the gateway's webhook URL to the Wordfence whitelist.
- Order state machine confusion — WooCommerce has 'Pending', 'Processing', 'Completed' states with subtle differences. Make sure the plugin transitions to the right state for your fulfilment workflow.
- Caching plugins — aggressive page caching on the checkout page can cause stale dynamic QRs. Exclude checkout URLs from page caching.
- Multi-currency setups — if your Woo store supports multiple currencies, ensure INR is the active currency for UPI orders (UPI is INR-only).
Refunds and partial refunds in WooCommerce
From the WooCommerce order detail page, click Refund, enter the amount, click Refund via VyaparGateway. The plugin calls the gateway's refund API, which credits the customer's original UPI source. Refunds are typically settled within seconds; the order is automatically updated with the refund details.
Performance considerations
Checkout pages with payment integrations sometimes feel sluggish on WordPress. To keep things snappy:
- Use a managed WordPress host (Kinsta, WP Engine, Cloudways) — shared hosting causes intermittent webhook timeouts.
- Enable object caching (Redis or Memcached) for WooCommerce's transient data.
- Defer non-essential JavaScript on the checkout page.
- Use the gateway's intent-URL flow (deep-link to the customer's UPI app) instead of QR rendering on mobile — faster perceived performance.
With these in place, UPI checkout on WordPress feels as fast as any modern hosted platform, with the benefit that you fully own your store and customer data. VyaparGateway helps you issue dynamic UPI QR codes, verify payments, and notify your stack via webhooks—without charging a per-transaction platform fee on top of your plan.
Frequently asked questions
- Is there a UPI plugin for WooCommerce?
- Yes. VyaparGateway offers a WooCommerce plugin that adds UPI as a payment method, handles dynamic QR generation, processes webhooks, and updates order status automatically. Other gateways (Razorpay, Cashfree, Instamojo) also offer WooCommerce plugins with similar functionality. Install via WordPress Plugins → Add New.
- Can I accept UPI on WordPress without WooCommerce?
- Yes, but you'll need to integrate via the gateway's PHP SDK or REST API directly. Custom WordPress sites (membership platforms, course sites, service businesses without a shopping cart) can use VyaparGateway's PHP SDK to create payment intents, render QRs, and handle webhooks via custom REST API endpoints. Plan for 4–8 hours of developer time.
- How do I handle refunds for UPI orders in WooCommerce?
- From the WooCommerce order detail page, click Refund and enter the amount. The VyaparGateway plugin automatically calls the gateway's refund API, which credits the customer's original UPI source. Refunds are usually settled within seconds. Partial refunds work the same way — just specify the partial amount.
- Why isn't my webhook firing in WordPress?
- Most commonly: (1) your WordPress site is behind basic-auth or a staging password, blocking the webhook POST — whitelist the gateway's IPs or remove the auth; (2) a security plugin like Wordfence is blocking it — add the webhook URL to the whitelist; (3) aggressive caching is serving an old version of the webhook endpoint — exclude the URL from caching; (4) the webhook URL configured in your VyaparGateway dashboard is wrong — double-check it matches your site.
Free tools for Indian merchants
No sign-up, no ads, no data selling
Use our free, browser-only tools whenever you need them. We don't store the values you enter or track you across the web.
📱 UPI QR Code Generator
Create UPI / URL / WhatsApp / WiFi QRs. Export as SVG or PNG.
🧮 GST Calculator (CGST + SGST + IGST)
Add or remove GST across 5%, 12%, 18%, 28% slabs.