How to collect payments (Stripe, PayPal & Razorpay / UPI)
Accept one-time payments directly inside your forms using your own Stripe, PayPal or Razorpay account — including UPI in India — with zero platform fees.
Spiceform lets you add a secure Payment block to any form so respondents can pay you directly. Payments are powered by a Bring Your Own Key (BYOK) model — you connect your own Stripe, PayPal or Razorpay account, and 100% of the money goes straight to you. Spiceform never touches or holds your funds, and we charge zero platform fees on transactions.
The Payment block is available on the Hot plan and above. If you're on the free Mild plan, you'll need to upgrade before you can add payments to your forms. Visit the Pricing page to compare plans.
How it works
- •You provide your own API keys in Settings. Spiceform stores them encrypted (AES-256) and only uses them to process payments on your behalf.
- •In the form builder, you add a Payment block, choose Stripe, PayPal or Razorpay, set a price, and publish.
- •Respondents see a secure checkout (Stripe Elements, PayPal Buttons or Razorpay Checkout) right on the form. They never leave the page.
- •The form only completes once payment succeeds. The amount is always verified server-side to prevent tampering.
Setting up Stripe
- 1Log in to your Stripe Dashboard at dashboard.stripe.com.
- 2Go to Developers → API Keys. Copy your Publishable key (starts with pk_live_ or pk_test_).
- 3For the Secret key, we strongly recommend creating a Restricted Key instead of using your full secret. Go to Developers → API Keys → Create restricted key. Enable these permissions: PaymentIntents (Write), PaymentMethods (Read). Name it something like "Spiceform".
- 4Copy the restricted key (starts with rk_live_ or rk_test_).
- 5In Spiceform, go to Settings → Billing tab. Find the "Payment Integration" card for Stripe.
- 6Paste both keys and click "Save & Validate". Spiceform will test the keys with a lightweight API call. If they pass, you'll see a green "Active" badge.
Using a Restricted Key limits Spiceform's access to only what it needs (creating charges and reading payment methods). This is a security best practice — even if the key were compromised, it could not access your full Stripe account.
Make sure both keys are from the same mode. Mixing a live publishable key with a test secret key (or vice versa) will fail validation.
Setting up PayPal
- 1Go to developer.paypal.com and log in with your PayPal Business account.
- 2Navigate to Apps & Credentials (under the Dashboard menu).
- 3Click "Create App". Give it a name like "Spiceform Payments" and select Merchant as the type.
- 4Once created, copy the Client ID and Secret Key from the app details page.
- 5In Spiceform, go to Settings → Billing tab. Find the "Payment Integration — PayPal" card.
- 6Paste both credentials and click "Save & Validate". Spiceform auto-detects whether the keys are Live or Sandbox and shows the appropriate badge.
You can start with Sandbox credentials to test the full checkout flow with fake money, then switch to Live credentials when you're ready to accept real payments.
Setting up Razorpay (UPI, Indian cards, netbanking)
- 1Log in to the Razorpay Dashboard at dashboard.razorpay.com.
- 2Go to Account & Settings → API Keys and click "Generate Key". Copy the Key ID (starts with rzp_live_ or rzp_test_) and the Key Secret — Razorpay shows the secret only once.
- 3In Spiceform, go to Settings → Billing tab. Find the "Payment Integration — Razorpay" card.
- 4Paste both and click "Save & Validate". Spiceform checks them with Razorpay and shows a "Test mode" badge for test keys.
- 5In the builder, set the Payment block's Provider to Razorpay. The currency switches to INR for you.
Respondents pay by UPI (a scannable UPI QR on a computer, or their UPI app on a phone), Indian cards, netbanking or wallets — whichever methods your Razorpay account has enabled. UPI is only offered for INR payments.
To test, use your rzp_test_ keys and pay with the UPI ID success@razorpay. No real money moves. Swap in your rzp_live_ keys when you're ready.
No Razorpay account yet? Razorpay needs a KYC check before it can take live payments. Until then, you can put your own UPI QR image on a Statement screen and add a short-text question for the transaction (UTR) reference.
Adding a Payment block in the builder
- 1Open your form in the builder.
- 2Open the "Add" pane in the left rail, find "Payment" in the "Other" group, and drag it onto the canvas.
- 3With the Payment block selected, the Properties sidebar on the right will show Payment Settings.
- 4Choose a Provider — Stripe, PayPal or Razorpay. A warning banner will appear if the selected provider's keys haven't been configured yet.
- 5Select the Currency (USD, EUR, GBP, INR and 12 more supported).
- 6Choose the Price Mode: Fixed Amount — type the price as you would say it (200 for ₹200, 25.50 for $25.50). Variable Amount — select a Calculator variable. The payment amount is dynamically computed from your form logic at runtime.
- 7Optionally, customize the Button Label (e.g., "Pay Now"), Product Name, and Product Description. These appear on the checkout screen and Stripe receipts.
Fixed vs. variable pricing
- •Fixed Amount — Use this for products or services with a set price. Type the amount in whole units: 50 for $50.00, 200 for ₹200.
- •Variable Amount — Use this when the total depends on the respondent's answers. First, create a variable in the Logic tab (e.g., "price") and set up calculator rules that compute the total based on form answers. Then select that variable in the Payment block's settings. The amount is locked on the server at checkout time, so respondents cannot manipulate it.
The minimum payment amount is 50 cents (or equivalent). Amounts below this will be rejected at checkout.
What respondents see
- •Stripe — A full Stripe Elements checkout with support for credit/debit cards, Apple Pay, Google Pay, and other local payment methods. The checkout appears inline within the form.
- •PayPal — Official PayPal Buttons rendered directly in the form. Respondents log in to their PayPal account to complete the payment.
- •Razorpay — A Pay button that opens Razorpay Checkout over the form, with name and email filled in from earlier answers. Respondents pay by UPI, card, netbanking or wallet.
- •Every provider shows the exact amount, currency, and a security badge. If the payment fails, a clear error message is shown and respondents can retry.
After payment
- •The form only submits once payment is confirmed. If payment fails or is cancelled, the form stays on the payment step.
- •A successful payment is recorded in the Submissions table with full payment metadata (transaction ID, amount, currency, provider).
- •You can view payment status in real time from the Results tab. Failed payments are flagged so you can follow up.
- •You can view payment details in the Results tab alongside the rest of the submission data.
Security and trust
- •Your API keys are encrypted at rest using AES-256-GCM with per-user authentication, so even if the database were breached, keys cannot be decrypted without the server's encryption secret.
- •Payment amounts are always computed and verified on the server. The client-side form cannot override the price.
- •Spiceform never stores card numbers, UPI details or PayPal credentials. All sensitive payment data is handled entirely by Stripe, PayPal or Razorpay.
- •Each payment is verified server-side before the form submission is finalized, preventing spoofed submissions.
Frequently asked questions
- •Does Spiceform take a cut? — No. Spiceform charges zero platform fees. The provider's standard processing fees still apply (set by Stripe, PayPal or Razorpay, not us).
- •Can I use test/sandbox keys? — Yes. Use Stripe test keys (pk_test_ / sk_test_), PayPal Sandbox credentials or Razorpay rzp_test_ keys to test the full flow with fake data before going live.
- •Can I use more than one provider? — Yes. You can configure all three in Settings and choose per Payment block which one to use.
- •Can respondents pay by UPI? — Yes, with Razorpay and the currency set to INR.
- •What happens if a respondent closes the browser mid-payment? — The form auto-saves progress. If they return, they'll resume from the payment step. Any pending PaymentIntent, PayPal Order or Razorpay Order will be reused (idempotent).
- •Which currencies are supported? — USD, EUR, GBP, CAD, AUD, JPY, CHF, NZD, SEK, NOK, DKK, SGD, HKD, BRL, MXN, and INR.
Was this article helpful?