About Razorpay
Payment gateway and financial services platform for businesses in India
Say what should happen in Razorpay, in plain words. Whenever builds it and runs it on a schedule, webhook or app event.
Connection requirements, provider permissions and optional AI usage apply. Read the runtime limits.
No credit card needed.
Payment gateway and financial services platform for businesses in India
Through its API, with the provider’s credentials and permissions.
Connect Claude, Cursor or Codex to the Whenever MCP server. Your coding agent builds and deploys the Razorpay workflow. It then runs on Whenever, with the chat closed.
Set up the Whenever MCP serverBusinesses on Razorpay automate around money events: a payment captured, a payment failed, a refund processed, a settlement landing in the bank. Each is a documented webhook event, such as payment.captured, payment.failed, refund.processed and settlement.processed, and Razorpay signs every delivery with an X-Razorpay-Signature header computed as an HMAC-SHA256 of the body with your webhook secret. Verify it against the raw body; if you rotate the secret, retries of older events are still signed with the old one.
The data model links several objects. An Order is created first with an amount and receipt, a Payment is attempted against it, and a captured payment can later have one or more Refunds. Amounts are always in the smallest currency unit, so 50000 means ₹500.00, a frequent source of reports that look a hundred times too large. Settlements group many payments, minus fees and taxes, into a bank transfer; the settlement recon endpoint lists the payments, refunds, transfers and adjustments settled for a given day or month.
API calls use basic authentication with a key id and key secret generated in the Dashboard, and there are separate keys for Test Mode and Live Mode. Webhooks are configured per mode too, so a webhook set up while testing does not fire for live payments. Razorpay documents that duplicate webhooks can arrive and gives each event a unique x-razorpay-event-id header, so store that id and ignore repeats.
Payment-captured events are a natural trigger for fulfilment and bookkeeping; when you use Orders, a captured payment also marks the order paid and sends order.paid. Note that settlement.processed means the transfer was started, and funds can take a few hours to reach the bank. For reconciliation, a scheduled read of settlements with their recon details lines up bank deposits with individual payments. Refund creation is possible through the API, but issuing money back is a decision worth leaving to a person unless rules are explicit.
Starter briefs to set up with your accounts, not finished workflows.
Uses the order.paid webhook with signature checking and an id-based duplicate guard.
Matches each settlement to its payments so the bank deposit can be explained line by line.
Alerts a person about failed attempts rather than retrying charges automatically.
Compute an HMAC-SHA256 of the raw request body using the webhook secret you set in the Dashboard and compare it with the X-Razorpay-Signature header. Use the raw body, not a re-serialised copy.
The API expresses amounts in the smallest currency subunit, such as paise for INR. Divide by 100 for rupees before showing or totalling.
Once a payment is captured, its order is marked paid, so both events fire. Use order.paid if your records are keyed on Orders and payment.captured if they are keyed on payments; Razorpay’s payments webhook page compares the two payloads.
Webhooks are set up per mode; Razorpay suggests testing in Test Mode with a staging URL first. Configure the webhook again in Live Mode and use the live keys.
Yes. Razorpay’s docs say to identify duplicates with the x-razorpay-event-id header, which is unique per event. Store it and skip repeats.
One workflow free. No card. Weekly AI-building limits.