Loading...
A free event is one call and confirms immediately. A paid event is two, because the payment itself has to happen in the buyer's browser.
A pending registration is filed on our side with the attendee's answers intact, and you get back everything Razorpay Checkout needs.
POST https://events.vihaya.app/api/v1/events/{eventId}/register
{ "name": "Asha Menon", "email": "[email protected]", "phone": "+919000000000" }
→ 200
{
"orderId": "order_TZud2hMOtfhq9f",
"registrationId": "pNd1m0TRqN8Hx5a1QopI",
"amount": 25000, // paise
"currency": "INR",
"key": "rzp_live_..." // public key — safe in a browser
}Your front end opens Razorpay Checkout with that key and order id. On success Razorpay hands you a payment id — post it back and the ticket is issued.
POST https://events.vihaya.app/api/v1/events/{eventId}/register
{
"registrationId": "pNd1m0TRqN8Hx5a1QopI",
"orderId": "order_TZud2hMOtfhq9f",
"paymentId": "pay_XXXXXXXXXXXX"
}
→ confirmed. Ticket + QR issued.paymentId alone is never proof of payment. We verify it against Razorpay and bind it to both the order and the registration before anything is confirmed — a forged id is refused and the registration stays pending.Omit the payment fields entirely. One call, confirmed immediately, ticket issued. There is no second step and no Razorpay involvement.