Skip to main content
Available in🇮🇳 India
Apple Pay is a secure, contactless payment method that lets customers pay using their Apple devices with Face ID/Touch ID authentication. With the Custom Checkout headless SDK, you check Apple Pay eligibility and either let Razorpay render the Apple Pay button or render your own — all on your existing Custom Checkout integration, with no redirect. Know more about Apple Pay. This integration works with your existing card payment flow: check eligibility, render a button and initiate the payment with one additional app parameter.
  • Accept payments in over 120 currencies from international customers.
  • Reduce checkout time with one-touch biometric payments (Face ID/Touch ID).
  • Full control of where and how the Apple Pay button appears on your page.
  • Razorpay encapsulates device eligibility — no need to integrate the Apple Pay JS API or write capability-detection logic yourself.
  • No need to handle Apple certificates or domain verification beyond hosting one file — Razorpay manages the rest.

Prerequisites

Before you begin, ensure you have:
  • An existing Razorpay Custom Checkout integration.
  • Apple Pay enabled and International Payments enabled on your Razorpay account.
  • HTTPS on your website — Apple Pay requires a secure context.
  • Your API Key Id. Generate API Keys from the Dashboard. Use Live Mode keys to accept real payments.
  • Apple Pay domain verification completed for your domain (host the domain association file; Razorpay registers it with Apple).

Integration Steps

Follow the steps given below.

1.1 Create an Order on Your Server

An order should be created for every payment.
  • Create an order using the Orders API. This is a server-side call.
  • Pass the returned order_id to your frontend. This ties the order to the payment and secures the request from tampering.
Watch Out!Payments made without an order_id cannot be captured and will be automatically refunded. Create an order before initiating payment.
Request
The response includes an id (for example, order_XXXXXXXXXX). Pass this to your frontend for SDK initialisation. For the full list of order request and response parameters, see the Create an Order API.

1.2 Load the Custom Checkout Script

Include the Custom Checkout script, preferably in the <head> of your page:
HTML
Handy TipsLoad the script from https://checkout.razorpay.com/v1/razorpay.js rather than serving a copy. This keeps updates and fixes automatic. Existing Custom Checkout merchants already load this script.

1.3 Initialise the SDK

Initialise Razorpay with your key and the order_id created in step 1.1. Provide a handler to receive the successful payment response (you can also use event listeners — see step 1.6).
JavaScript

1.4 Check Apple Pay Eligibility

Use canMakePayment() to check whether the customer’s device can pay with Apple Pay. Razorpay’s SDK encapsulates the device capability check, so you do not integrate the Apple Pay JS API or evaluate paymentCredentialsAvailable yourself.
JavaScript
The call resolves with available: true when the customer can pay with Apple Pay and false otherwise. Only render an Apple Pay button when available is true.
Note on EligibilitycanMakePayment() returns true for customers who can complete an Apple Pay payment on their current device and browser. For international customers, this includes devices where Apple Pay is set up and devices where the customer can add a card during the flow. For domestic (India) customers, it returns true only where a usable Apple Pay credential is already present. You do not need to handle these cases yourself — render the button whenever available is true.

1.5 Render the Button and Initiate Payment

Choose one of the following based on whether you want Razorpay to render the Apple Pay button or you render your own.
Use mount() to have Razorpay render an Apple Pay button into a container element you provide. The SDK starts the Apple Pay session on click and handles the payment — you do not call createPayment().
JavaScript

1.6 Handle the Payment Response

Listen for payment lifecycle events, consistent with Custom Checkout. (You may also use the handler function from step 1.3.)
JavaScript
A successful payment returns:
Response
Store these fields on your server and verify the payment signature (step 1.7). A failed payment returns an error object:
Response
For the full list of error responses — canMakePayment() reasons, payment errors, client errors and a handling guide — see Error Responses.

1.7 Verify the Payment Signature

Verify the signature on your server before fulfilling the order.
  1. Use the order_id from your server (not the razorpay_order_id returned by Checkout), the razorpay_payment_id from the response and your key_secret.
  2. Construct an HMAC SHA256 hex digest:
JavaScript
  1. If the generated signature matches razorpay_signature, the payment is authentic.
Sample verification (Node.js and other languages) is available in the signature verification guide.

1.8 Verify Payment Status

Handy TipsOn the Razorpay Dashboard, ensure the payment status is captured. See capture settings to capture payments automatically.
You can track payment status in three ways: from the Dashboard (Transactions → Payments), by subscribing to webhook events or by polling the APIs.

Full Integration Example

JavaScript

Frequently Asked Questions

No. canMakePayment() encapsulates the device capability check. You do not integrate the Apple Pay JS API or evaluate paymentCredentialsAvailable / paymentCredentialStatusUnknown yourself.
Render it only when canMakePayment() resolves with available: true.
Yes. On a retryable error (for example, network_timeout), retry with the same order_id — no duplicate payment is created until the previous attempt resolves.
No. Always create orders server-side using your secret key. Only the order_id is passed to the frontend.