Skip to main content

Apple Pay

You can start accepting Apple Pay payments on the Web using Hosted Payment Page or Payment Request Component. No additional configuration is required to use Apple Pay in Hosted Payment Page.

Our Payment Request Component gives you a single integration for Apple Pay and Google Pay. Customers see a Google Pay or an Apple Pay button, depending on what their device and browser combination supports.

If you prefer to integrate directly against the Apple Pay API, follow our Apple Pay direct API integration guide.

Apple Pay direct API integration

Before you start, you need to:

Include monei.js on your checkout page by adding the script tag to the head of your HTML file.

<script src=""></script>

Create Apple Pay Session

const session = new window.ApplePaySession(3, request);
session.onvalidatemerchant = async (event: any) => {
try {
const merchantSession = await monei.api.createApplePaySession({
accountId: 'MONEI_ACCOUNT_ID',
displayName: 'Test Merchant',
domainName: '',
validationUrl: event.validationURL
} catch (error) {

Exchange Apple Pay token for MONEI Payment Token that can be used to confirm payment as described in step 3.

session.onpaymentauthorized = async (event) => {
// Encode Apple Pay token as a base64 string
const paymentToken = JSON.stringify(event.payment.token);
const token = window.btoa(paymentToken);
try {
const result = await monei.api.createToken({
paymentId: '{{payment_id}}',
paymentMethod: {
applePay: {token}
status: window.ApplePaySession.STATUS_SUCCESS
return moneiTokenHandler(result.token);
} catch (error) {
status: window.ApplePaySession.STATUS_FAILURE

Before you go live