Overview
The controlRazorpay action (Control Razorpay in the action picker) opens the Razorpay SDK's payment screen in a mobile app for a pre-created Razorpay order. It handles the payment UI and writes the result — payment credentials on success, or an error on failure — to appsAndIntegrations.razorpay, where the action's follow-up actions can read it.
The action is available only in mobile apps. It is not offered in web apps, and in a web preview it opens no checkout and shows the warning "Razorpay checkout is supported only in the native runner."
Note: Server-side order creation is required. Razorpay requires that an Order ID be created on your server using the Razorpay Orders API before the checkout is opened. The controlRazorpay action does not create the order — call your order-creation API with a Trigger Data Source action first, then pass the returned order_id to this action.
Prerequisites
Complete these steps before using the action:
Build the payment flow in a mobile app. The action is hidden in web apps.
Go to Settings → Apps & Integrations → Razorpay, turn on Enable Razorpay and enter your Key ID. Until the integration is enabled, the action does not appear in the action picker. If the Key ID is blank, the action finishes as a success without opening checkout, so the On Success callbacks still run with empty payment fields.
Create the order on your server with the Razorpay Orders API, and expose it to the app through a data source.


Parameters
Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
Operation | string | Optional | Checkout | The only operation. Opens the Razorpay checkout. |
Order ID ( | string | Required | — | The Razorpay order ID returned by your server-side order creation API. Typically bound to a data source response. |
Amount ( | number | Required | — | Payment amount in the smallest currency unit (paise for INR, cents for USD). For example, to charge ₹500 enter |
Currency ( | string | Required (pre-set) | INR | The payment currency. Choose INR or USD. It starts as INR, so change it only for USD orders. Must match the currency of the Razorpay order. |
The merchant key comes from the Key ID in the app's Razorpay settings, and the checkout screen is titled with your app's name. You can't change either per action.
Results
After checkout, the action writes the result to appsAndIntegrations.razorpay:
Field | Description |
|---|---|
| The Razorpay payment ID, set on success. |
| The Razorpay order ID, set on success. |
| The payment signature, set on success. Use it for server-side verification. |
| Set instead of the IDs when checkout fails or is dismissed: |
On success, the action's On Success callbacks run. On failure, the error is stored and the action's On Failure callbacks run.
Payment Flow Architecture
The recommended end-to-end flow:
Create order server-side: Fire a Trigger Data Source action that calls your backend endpoint (POST /orders). Your server calls the Razorpay Orders API and returns the order ID.
Open Razorpay checkout: In the On Success callbacks of the order creation step, fire the
controlRazorpayaction with the returned order ID.Verify payment server-side (On Success): Pass
paymentId,orderIdandsignaturefromappsAndIntegrations.razorpayto another data source that calls your backend's verification endpoint. Before you treat the payment as done, check that appsAndIntegrations.razorpay.paymentId is set, because the action also finishes as a success when checkout didn't open. Only fulfil the order after server-side verification passes.Handle failure (On Failure): Show an error snackbar with
{{ appsAndIntegrations.razorpay.error.description }}. Optionally offer a retry button that re-opens checkout with the same order ID (Razorpay orders support multiple payment attempts).
Examples
Open Razorpay checkout after order creation
{ "actionType": "controlRazorpay", "payload": { "operation": "checkout", "order_id": "{{ ds_createOrder['data']['id'] }}", "amount": 50000, "currency": "INR" } }
Add an On Success callback that triggers your verification data source with {{ appsAndIntegrations.razorpay.paymentId }}, {{ appsAndIntegrations.razorpay.orderId }} and {{ appsAndIntegrations.razorpay.signature }}, and an On Failure callback that shows a "Payment failed" snackbar.
Testing
Test in a build of the mobile app on a device. The web preview opens no checkout and shows a warning.
Use a Razorpay test-mode Key ID while you test. The settings panel has no test/live switch: the key you enter decides the mode. Swap in your live Key ID before you go live.