A sandbox, selected by your key
A whole sandbox account, selected by the key you call with. Build and run your whole integration — registration, payment, check-in, webhooks — without charging anyone, emailing anyone, or putting an event in front of the public.
vihaya_live_sk_Real events, real payments, real ticket emails.
vihaya_test_sk_Test events only. No gateway call, no email, no fee, no public page.
Why the mode is in the key, not a header. A header would let one credential act on real or fake data depending on a value your code controls — one forgotten header away from a test suite confirming real registrations, emailing real attendees and moving real money. Because the prefix carries it, a key is permanently one or the other, it is visible in every log and code review, and a test key pasted into production config fails loudly instead of quietly doing damage.
The rules
- A test key can only act on TEST EVENTS. Create one by calling
POST /events with the test key — it is stamped automatically. - A live key can never touch a test event, and a test key can never touch a live one. Both directions return 403 with an explanation.
GET /events returns only the events belonging to your key's mode, so test fixtures never appear in a live listing.- A test event can NEVER be published. It has no public page, appears in no search or listing, and cannot sell a real ticket.
- Test events are fee-exempt, so they can never contribute to a payout, a revenue total or an organiser balance.
End to end in four calls
# 1. Mint a test key (dashboard, or POST /v1/keys with { "mode": "test" })
export VIHAYA_TEST_KEY=vihaya_test_sk_...
# 2. Everything below is fake. Nothing is charged, nobody is emailed.
curl -X POST https://events.vihaya.app/api/v1/events \
-H "x-api-key: $VIHAYA_TEST_KEY" \
-H "content-type: application/json" \
-d '{ "title": "Fixture", "description": "Scratch event",
"startDate": "2027-01-01", "price": 250 }'
# -> 201, isTestEvent: true, status: "draft" (always)
# 3. Register somebody. A PAID test event returns a REAL Razorpay order.
curl -X POST .../events/{id}/register \
-H "x-api-key: $VIHAYA_TEST_KEY" \
-d '{ "name": "Asha", "email": "asha@example.com" }'
# -> { orderId, registrationId, amount, currency, key: "rzp_test_..." }
# Open Razorpay Checkout with that key, pay with a TEST card, then POST
# again with { registrationId, orderId, paymentId } to confirm — the same
# two calls as production.
# 4. Admit them at your own door.
curl -X POST .../events/{id}/check-in \
-H "x-api-key: $VIHAYA_TEST_KEY" \
-d '{ "registrationId": "..." }'
# -> { success: true, changed: true, data: { checkedIn: true, ... } }
Test mode is the real flow, on a test account. Test mode runs the REAL two-call flow against Vihaya's Razorpay TEST account. You get a real order, open real Razorpay Checkout with the `key` we return, pay with Razorpay's test cards or test UPI, and confirm with the payment id exactly as in production. The only difference is which Razorpay account it runs on — `rzp_test_` credentials cannot move real money. Your integration is therefore genuinely exercised rather than simulated, and the code path is identical to live.
Emails and webhooks
Nothing is emailed. Ticket delivery is off on every test event, and a broadcast always previews however you set `dryRun` — the addresses in your test data may well be real ones, and "it was only a test" is not something you can say to whoever received the mail. The preview still returns the true recipient count and sample, so the endpoint is fully testable.
Webhooks DO fire in test mode — that is the point. `registration.confirmed` is delivered and signed exactly as in production, so you can drive your receiver end to end without a real booking.
What it is not
- It is not a separate database you can seed in bulk — create test events through the API like any other.
- It runs on Vihaya's Razorpay test account, not yours. You are testing the integration, not your own gateway settlement.
- Test events still appear in your own dashboard, badged as test. They are drafts, so nobody else can see them.