Skip to main content
The Razorpay iOS SDK embeds a native checkout experience in your iOS app. You initialize it with your API key, pass an options dictionary containing the order details, and handle success or error through a delegate protocol.

Installation

Install the SDK using your preferred dependency manager:
Add the pod to your Podfile, then run pod install:
Podfile

Integration steps

1

Create an order on your server

Before opening checkout, create an order from your backend using the Razorpay API and return the order_id to your app. See the web integration guide for a server-side example — the order creation API is the same across all platforms.
2

Initialize the SDK and open checkout

Import the Razorpay SDK, conform your view controller to RazorpayPaymentCompletionProtocol, and open checkout when the customer is ready to pay.
ViewController.swift
The amount is specified in the smallest currency unit (for example, paise for INR or cents for USD). Pass the order_id you received from your server.
3

Verify the payment signature on your server

After onPaymentSuccess is called, send the payment_id along with the order_id and razorpay_signature to your server for verification. Use the same signature verification logic described in the web integration guide.
Always verify the payment signature on your server before fulfilling an order. The onPaymentSuccess callback alone does not confirm that the payment is authentic.
Your Key ID is safe to include in your iOS app binary. Never include your Key Secret in client-side code — it must remain on your server only.