razorpaypayment gatewayd2c payments & shipping

Razorpay Setup for Your Online Store: Test Mode to Live Payments

A practical Razorpay integration guide for Indian online stores, covering test mode, KYC and activation, webhooks, settlement, fees and failed payments.

||16 min read
Razorpay Setup for Your Online Store: Test Mode to Live Payments

Setting up direct online payment collection is a crucial step for Indian D2C brands transitioning from social commerce to a dedicated ecommerce website. Completing a clean razorpay integration allows small business owners, artisanal makers, and independent sellers to process digital payments across UPI, cards, and net banking automatically. This guide breaks down the full workflow of connecting Razorpay to your online store, from test mode to live payments: KYC requirements, webhooks, settlement, transaction fees and checkout drop-offs. If you are still choosing a platform, start with how to start an online store in India.

What Is Razorpay Integration and How Does It Work for Online Stores?

Understanding how payment gateways bridge your website cart and your company bank account ensures smooth order tracking and accounting.

Razorpay integration is the process of connecting an online store's checkout cart to Razorpay India's payment gateway software to process digital transactions securely. When integrated, the system passes cart totals, customer details, and order IDs to Razorpay's modal, allowing shoppers to pay via UPI, cards, net banking, or wallets while automatically updating the store's backend once the payment succeeds.

When a customer clicks the payment button on your product or cart page, your store server initiates an order creation request through the Razorpay API. This request generates a unique order reference. The user then interacts directly with the secure checkout window. Once the payment clears through the customer's bank or UPI app, Razorpay returns a signed payment response (and, if you subscribe, a webhook) to your store server, triggering immediate order confirmation and inventory deduction.

  1. Customer Cart initiates an order request to your Store Server.
  2. Store Server sends an order creation call to the Razorpay API.
  3. Razorpay API returns the details to render the Checkout Modal to the customer.
  4. Customer approves payment via UPI, card, net banking, or wallet through their bank.
  5. Razorpay sends an instant webhook notification back to your Store Server.
  6. Razorpay settles the funds to the seller's bank account on its settlement cycle.

Key Payment Methods Supported by Razorpay India

Offering diverse payment rails directly impacts your store's conversion rate across different shopper demographics. Razorpay functions as an all-in-one payment aggregator in India, removing the need to negotiate separate contracts with individual financial institutions.

  • Unified Payments Interface (UPI): Supports Google Pay, PhonePe, Paytm, BHIM, and other UPI apps, featuring intent-flow redirection for mobile shoppers and QR code displays for desktop users.
  • Credit and Debit Cards: Accepts Visa, Mastercard, RuPay, and American Express, with native support for two-factor authentication.
  • Net Banking: Connects with a wide list of Indian banks.
  • Digital Wallets: Supports popular wallets; check your Dashboard for the current list.

Understanding Webhooks and Payment Verification

Relying solely on frontend redirection to confirm orders leads to lost sales when customers close their browser tab too early. Webhooks solve this vulnerability by establishing a server-to-server communication line.

When a payment succeeds or fails, Razorpay sends an HTTP POST request with a JSON payload to your website server endpoint (ports 80 or 443 only, with separate URLs allowed for Test and Live mode). Your server listens for this payload, verifies the digital signature using your account's webhook secret, and marks the order as paid in your database. This background verification happens independently of the user's browser state, ensuring that even if a buyer loses internet connection immediately after entering their UPI PIN, your backend still records the purchase and notifies your shipping team.


Why Razorpay India Is Essential for Small D2C Makers and Sellers

Switching from manual bank transfers or heavy cash reliance to automated online payment processing stabilizes cash flow for growing digital brands.

For independent D2C businesses selling items like hand-poured soaps, organic agarbatti, cold-pressed oils, traditional sweets, or custom apparel, checkout ease determines whether a buyer completes an order. Customers hesitate when asked to copy account details for manual UPI transfers. Razorpay provides a recognizable checkout window that buyers already trust, which matters for a new store. For the bigger picture on selling direct, see D2C brand vs marketplace in India.

Reducing COD Risks and Return-To-Origin (RTO) Rates

Cash on Delivery (COD) presents a significant financial drain for small Indian ecommerce stores. Unverified COD orders frequently suffer from impulse cancellations, fake addresses, or customer refusal at the doorstep, resulting in Return-To-Origin (RTO) courier costs that destroy thin margins.

When you implement a secure payment gateway, you encourage shoppers to pay upfront. Prepaid orders are far less likely to come back as RTO. Securing funds before dispatching perishable or hand-crafted items protects your stock investment and eliminates non-recoverable reverse shipping expenses.

Empowering Niche Artisanal Brands Across Tier 1, 2, and 3 Cities

Digital payments allow regional makers to reach customers nationwide without establishing local physical outlets. A boutique brand producing authentic regional snacks or handloom apparel can take orders from metro cities just as smoothly as local buyers.


How to Prepare Your Business for Razorpay Account Activation

Completing your business documentation and store compliance policies before applying prevents account suspension or onboarding delays.

Razorpay operates under strict Reserve Bank of India (RBI) payment aggregator regulations. Submitting an incomplete application or launching a website missing standard legal disclosures can cause your activation request to be rejected. Following a structured verification process allows you to move smoothly from registration to accepting live payments.

  1. KYC & Business Documentation: Prepare Business PAN, identity proof, bank details with cancelled cheque, and GSTIN or Udyam registration (if registered).
  2. Publish Store Policy Pages: Publish mandatory Terms & Conditions, Privacy Policy, Refund/Cancellation Policy, and Contact Us pages with physical address details.
  3. Submit Razorpay KYC and website details: Upload your documents and add the website where you will collect payments. Razorpay says it verifies the website within 3 working days; live API keys become available after that.

Required Website Policies for Gateway Approval

During the review process, Razorpay checks your web store to confirm that consumer protection disclosures are active. Your site should display visible navigation links to these policy pages:

  1. Terms & Conditions: Outlines the legal agreement between your business entity and store visitors, governing website usage and product sales.
  2. Privacy Policy: Specifies how user data, phone numbers, delivery addresses, and cookies are collected, stored, and protected.
  3. Refund and Cancellation Policy: Explicitly details timeline conditions for returns, exchange rules, cancellation windows, and how long money takes to return to a customer's original payment method.
  4. Contact Us Page: Must display a valid business operating address, customer support email address, and active telephone helpline number.

Generating Test API Keys vs Live API Keys

Razorpay provides two distinct environments within a single dashboard: Test Mode and Live Mode.

  1. Test Mode (Sandbox): Uses Test Key ID (e.g., rzp_test_XXXXXX) and a Test Key Secret to simulate checkouts without charging money.
  2. Live Mode (Production): Uses Live Key ID (e.g., rzp_live_AAAAAA) and a Live Key Secret to collect real funds after activation.

Test Mode allows you to construct and verify your cart integration without touching real money. You use simulated card credentials and fake UPI IDs provided in the developer documentation to test successful orders, stock deductions, and failed payment alerts.

Live Mode requires full Know Your Customer (KYC) approval. Once approved, you generate your Live Key ID and Live Key Secret within the API Keys tab of the Razorpay dashboard. Swapping these production credentials into your store backend enables real money collection. Razorpay also verifies your website first, and warns that launching with test keys shows buyers a success screen with no payment captured.


Step-by-Step Technical Setup for Razorpay Software Integration

Setting up your technical configuration accurately prevents payment drops, double charges, and unconfirmed orders.

Whether you run a custom web application or use popular CMS platforms, the integration workflow follows standard API patterns. You generate credentials in your payment portal and store them securely within your application environment variables or plugin settings.

  1. Install official Razorpay software module or SDK on your ecommerce site.
  2. Input your unique Live Key ID and Key Secret into backend settings.
  3. Define your webhook URL endpoint inside the Razorpay Dashboard.
  4. Select webhook events such as payment.authorized, payment.failed and order.paid.
  5. Execute end-to-end sandbox purchases to confirm inventory sync and automated notifications.

Configuring API Keys and Webhook URLs

Connecting your store software requires assigning your Key ID and Key Secret within your admin panel. Never expose your Key Secret in front-end client code or public JavaScript repositories.

  1. Log into your Razorpay Dashboard and navigate to Account & Settings > API Keys.
  2. Generate a Test Key first (Live Key after activation) and save the Key Secret immediately; Razorpay does not show it again.
  3. Open your e-commerce store background options or system file configuration (.env).
  4. Paste the Key ID and Key Secret into their respective configuration fields.
  5. Navigate to Account & Settings > Webhooks in the Razorpay portal.
  6. Click Add New Webhook and input your store's receiver URL (e.g., https://yourdomain.com/api/razorpay-webhook).
  7. Enter a secure Webhook Secret string and check the active events: payment.authorized, payment.failed, and order.paid.

Testing the Checkout Flow in Sandbox Mode

Before making your site public, perform exhaustive end-to-end testing in Sandbox mode to verify system behavior across different user actions.

Simulate a complete checkout using Razorpay's test UPI IDs and dummy card numbers. Check whether the order status changes automatically from "Pending" to "Processing" in your store backend. Verify that your system fires order confirmation emails to the customer and triggers low-stock alerts. Finally, test an intentional failure using a declined test card number to ensure your store displays an informative error message rather than a blank browser screen.


Razorpay Fees, GST and Settlement: Planning Your Margins

Accounting for standard payment gateway fees helps maintain healthy gross margins across every product category.

Payment gateway processing is not free. Every transaction processed through digital channels incurs a processing charge deducted by the gateway before settling the net balance into your current bank account. Incorporating these costs into your financial model prevents margin erosion on lower-priced products.

Price ComponentCost Breakdown
Item Retail Price₹1,000.00
Razorpay Standard plan fee (2%)- ₹20.00
GST on Gateway Fee (18% of ₹20)- ₹3.60
Total Deduction- ₹23.60
Net Settlement Received₹976.40

Understanding Standard Gateway Fees and GST

Razorpay's Standard plan, as listed on razorpay.com/pricing in November 2026:

  • Platform fee: 2% on domestic cards, net banking and wallets, with ₹0 setup and ₹0 annual maintenance.
  • Goods and Services Tax (GST): An 18% GST rate is levied specifically on the payment gateway processing fee itself, not on the total product value.

For example, on a ₹1,000 online sale, the base transaction fee is ₹20 (2%). The 18% GST applies to that ₹20 fee, adding ₹3.60. The total gateway deduction equals ₹23.60, leaving a net bank settlement of ₹976.40.

Razorpay's standard settlement for domestic payments is T+2 working days from capture, and can vary by business type and risk profile.

Margin Calculation Strategies for Low-Ticket D2C Goods

For brands selling low-priced goods like ₹200 artisanal soap bars or ₹300 incense packs, fixed overhead combined with percentage-based fees can impact profitability.

To preserve your margins without discouraging buyers:

  • Create Product Bundles: Group complementary items into curated sets valued above ₹800, diluting processing fees across higher unit prices.
  • Set Minimum Order Thresholds: Establish a baseline order value (e.g., minimum cart value of ₹500) for free shipping or checkout eligibility.
  • Incorporate Gateway Overhead into Base Pricing: Add the fee plus GST on it (about 2.36% on the Standard plan today) into your retail cost calculations.

Fixing Payment Failures and Improving Checkout Conversion Rates

Resolving technical bottlenecks during payment steps prevents shoppers from abandoning their carts right before purchasing.

A high cart abandonment rate often stems from payment processing friction rather than a lack of customer purchase intent. When a buyer encounters an error screen during payment authorization, they rarely try a second time unless prompted immediately. Monitoring user behavior and implementing fast recovery mechanics restores lost revenue.

Issue TriggerRoot CauseSystem Fix
UPI Server TimeoutBank server outage or app disconnectionFallback to dynamic UPI QR display on checkout screen
Mobile Verification LagScript delay during OTP autofillOptimize mobile scripts and improve Core Web Vitals
Bank Screen AbandonmentCustomer closes tab after bank delaysDesk follows up with shoppers who agreed to be contacted

Handling UPI Drops and Bank Server Failures

UPI accounts for the majority of digital retail payments in India, but it remains susceptible to bank server outages and network timeouts. When a customer's banking application fails to respond within seconds, the checkout window throws a generic failure error.

To mitigate UPI drop-offs, use Razorpay's standard checkout and show a clear notice when a bank or UPI app is down, so buyers select an alternative UPI application or credit card. Also, offering dynamic QR code generation directly on desktop checkout screens lets users scan and pay with their phone without manual phone-number entry errors.

Order Desk Follow-Up for Failed Payments

When a payment fails, your web application should capture the customer's email and phone number before redirecting them away from the checkout screen.

Your desk can then follow up by call, WhatsApp or email with shoppers who agreed to be contacted, and mark the order paid if they pay directly by UPI. See recovering failed payments.

Improving your overall storefront speed also stabilizes the checkout experience. You can read more about resolving site bottlenecks in our guide to improving site performance scores.


Auditing Ecommerce Product Pages for Payment and Schema Readiness

Ensuring your product listings pass technical markup checks helps search engines display pricing data while bringing ready-to-buy traffic to your checkout.

A complete payment setup requires a functional storefront that search engine crawlers can index properly. Linking structured catalog data to active checkout endpoints ensures your inventory displays correctly across Google Search and shopping surfaces.

  1. Schema Context: @context: "https://schema.org/"
  2. Item Type: @type: "Product"
  3. Product Name: Your Brand Cold-Pressed Sesame Oil
  4. Offer Currency: INR
  5. Price: 450.00
  6. Availability: https://schema.org/InStock

Single-Page Schema Auditing for Product Feeds

Search engines use Product and Offer schema markup (JSON-LD) to parse price, currency, availability, and merchant return policies directly from your product pages.

Accurate schema code ensures that rich snippets in search results reflect live pricing and stock status. If your JSON-LD output specifies incorrect price currencies or missing offer attributes, search networks may disapprove your product listings. To check one product page, use the free Digispot AI Chrome extension or the Schema Markup Visualizer.

Full-Store Technical Auditing for Checkout Path Errors

Broken internal links, misconfigured policy pages, or blocked JavaScript files can disrupt both web crawlers and actual store visitors during checkout.

Regular site audits help identify technical issues across your purchase funnel:

  • Check that key checkout pages are not accidentally blocked in your site directives. Learn how to construct clean directives in our robots.txt setup guide.
  • Verify that SSL certificates cover all checkout subdomains so users do not encounter "Connection Not Secure" browser warnings.
  • Test mobile page render speeds to ensure tracking scripts do not delay the Razorpay popup script.
  • Ensure that canonical tags correctly point to primary product pages so search engines index the authoritative version of your items.
  • To check every page of the store at once, the Digispot AI Desktop SEO Spider, which runs on Mac and Windows, crawls the whole site and flags missing Product schema, duplicate variant URLs and broken links.

Choosing a Payment Gateway for Indian Domestic Commerce

When evaluating payment partners for an Indian retail brand, consider these critical criteria:

  1. Onboarding and Activation Speed: Choose a gateway that supports fully digital paperless KYC to avoid weeks of manual verification delays.
  2. UPI Success Rates: Ask how the gateway handles bank and UPI downtime, and how it tells buyers to switch methods.
  3. Settlement Schedules: Razorpay's standard settlement is T+2 working days. Ensure your cash flow model accounts for weekend payout delays.
  4. Platform Compatibility: Ensure the gateway offers official pre-built modules for your chosen e-commerce framework to avoid custom software development costs.

Local Logistics and Pincode-Zone Rate Setup alongside Razorpay

Connecting your shipping rate logic with payment confirmation streamlines order processing across national logistics networks.

Accepting payments online is only half the fulfillment equation. Your store must calculate accurate shipping fees based on the buyer's delivery pincode before generating the final Razorpay payment total (see shipping charges for Indian D2C stores).

Structuring Regional Shipping Zones Across Indian Pincodes

Delivery carriers divide India's 19,000+ active pincodes into logistics tiers. To ensure your checkout cart charges accurate freight rates:

  • Local Zone: Same-city deliveries, usually the cheapest and fastest.
  • Regional Zone: Intrastate shipping within your home state, carrying moderate transit times and medium weight charges.
  • Metro-to-Metro Zone: Fast air transport linking Tier 1 commercial hubs across the country.
  • Rest of India (ROI) & Special Zones: Far-reaching pincodes, rural locations, or hilly terrains that incur carrier surcharges.

Aligning Shipping Costs with Instant Gateway Receipts

When a customer enters their 6-digit delivery pincode on your cart page, your store software should look up the corresponding zone rate and append the shipping fee to the subtotal before passing the final balance to Razorpay.

Passing an all-inclusive single amount to the payment gateway prevents customer confusion and pricing disputes.


Launch Your Payment-Ready D2C Store with Digispot AI

Setting up an e-commerce website with payment integration, regional shipping rates, and proper technical markup does not have to be complicated. Digispot AI builds complete online storefront solutions for Indian makers, D2C brands, and retail businesses.

Our team takes care of the technical setup:

  • Your own storefront on your domain, with guest checkout and a private order-tracking link.
  • Complete Razorpay integration on your own account, tested in test mode before live keys go in, with automatic refunds on cancel.
  • Pincode-based shipping rule setup (zones, weight slabs, free-shipping threshold) and optional COD.
  • A Payment-failed list with one-tap call, WhatsApp or email, and mark-paid by direct UPI.
  • On-page technical SEO and clean schema markup implementation.

Digispot AI delivers a payment-ready store in 1 to 2 days, and live payments start as soon as Razorpay activates your account. See our payment gateway integration service to get started.

More in the Selling Online in India guide

Start with the How to Start an Online Store in India: A Two-Day Launch Plan.

Audit any page in seconds

200+ SEO checks including Core Web Vitals, schema markup, meta tags, and AI readiness — trusted by 1,250+ SEO experts and marketers.

Questions & Answers

Frequently Asked Questions

Here are some of our most commonly asked questions. If you need more help, feel free to reach out to us.

Maya Krishnan

Written by

Maya Krishnan

SEO and AEO specialist, Digispot AI

Maya Krishnan is an SEO and AEO specialist at Digispot AI. She helps agencies and businesses across industries and countries grow organic traffic from Google and AI search, and knows the major SEO platforms well, from desktop crawlers to all-in-one suites. She checks and approves every article published under her name.

More from Maya Krishnan

Related Articles