Apple Pay for iOS
Last updated: August 5, 2026
Accept Apple Pay payments in your iOS app with Flow for mobile, our pre-built, customizable payment user interface that you can embed directly into your mobile application. Flow enables you to accept payments using Checkout.com's global network of payment methods with a single integration.
- The customer opens the checkout screen.
- You perform a server-side request to create a payment session.
- You use the payment session data on the client side to create and render Flow for mobile.
- Flow for mobile displays the Apple Pay payment method to the customer, if it's available on their device.
- When the customer taps Pay, Flow for mobile requests authorization through Apple Pay and performs the payment request.
- You receive a webhook notifying you of the payment status.
Make sure you have a test account with Checkout.com.
Create a public key and a secret key from the Dashboard, with the following key scopes:
- Public key –
payment-sessions:payandvault-tokenization - Secret key –
payment-sessions
To receive webhooks for the payment events, configure your webhook server.
Integrate with Flow for mobile before continuing.
Note
Apple Pay has additional requirements you must adhere to.
To implement Apple Pay in your iOS app, you must:
- Create an Apple Merchant ID and a payment processing certificate.
- Link your certificate to your merchant ID.
- Add your Apple merchant ID to your iOS app.
Follow these steps:
- In your Apple Developer account, select Merchant IDs to register for an Apple merchant ID.
Use the suggested format:
merchant.com.companyName.appName. - Depending on the environment where you want to update the certificate, run the following command to receive a certificate signing request from Checkout.com:
Information
Your base URL's {prefix} value is unique to your account and environment. To learn how to retrieve your base URLs for the sandbox and production environments, see API endpoints.
1curl --location --request POST 'https://{prefix}.api.checkout.com/applepay/signing-requests' \2--header 'Authorization: Bearer pk_xxx' \3| jq -r '.content' > ~/Desktop/cko.csr
The certificate downloads to your ~/Desktop path.
- In your Apple Developer account, go to your merchant ID, and then go to Apple Pay Payment Processing Certificate > Create Certificate.
- Upload the
cko.csrcertificate you created earlier, and select Continue. - Download the Apple Pay processing certificate you created.
- On your terminal, go to the path where you downloaded Apple's processing certificate, and run the following command to upload it to Checkout.com's servers:
Information
Your base URL's {prefix} value is unique to your account and environment. To learn how to retrieve your base URLs for the sandbox and production environments, see API endpoints.
1curl --location --request POST 'https://{prefix}.api.checkout.com/applepay/certificates' \2--header 'Authorization: Bearer pk_xxx' \3--header 'Content-Type: application/json' \4--data-raw '{5"content": "'"$(openssl x509 -inform der -in apple_pay.cer | base64)"'"6}'
Information
Ensure that the key you send in the Authorization header matches the environment you send the request to. For example, use your sandbox key for the request you send to the sandbox environment.
- Go to your Apple Developer portal, and ensure that the certificate that you created is active.
You can manually activate it if not activated by default. - In Xcode, go to Targets > Signing & Capabilities, and add an Apple Pay capability.
- Select the merchant ID you created earlier to use it with your app.
For more information, see Apple Developer:
When the customer is ready to pay, send a server-side request to securely create a PaymentSession object. The PaymentSession contains the information required to handle all steps of the payment flow.
Note
Do not embed your secret key in your client-side code.
Call the Create a Payment Session endpoint.
Apple Pay is processed as a card payment. The currency and billing.address.currency must be supported by Apple Pay.
Information
Your base URL's {prefix} value is unique to your account and environment. To learn how to retrieve your base URLs for the sandbox and production environments, see API endpoints.
post
https://{prefix}.api.checkout.com/payment-sessions
1{2"amount": 1000,3"currency": "GBP",4"reference": "ORD-123A",5"billing": {6"address": {7"country": "GB"8}9},10"customer": {11"name": "Jia Tsang",12"email": "jia.tsang@example.com"13},14"success_url": "https://example.com/payments/success",15"failure_url": "https://example.com/payments/failure"16}
1{2"id": "ps_2Un6I6lRpIAiIEwQIyxWVnV9CqQ",3"payment_session_secret": "pss_e21237b4-214a-4e35-a35d-f33wkwo158f6"4}
The payment session response also determines which payment methods can be displayed to the customer. The response is determined by the customer's device, the customer's region, and the payment methods activated for your account.
The client initializes an instance of CheckoutComponents with configuration information and the payment session data:
1let configuration = try await CheckoutComponents.Configuration(2paymentSession: paymentSession,3publicKey: publicKey,4environment: environment,5callbacks: .init(6onSuccess: { paymentMethod, paymentID in7// Handle success8},9onError: { error in10// Handle error11}12)13)1415let checkoutComponentsSDK = CheckoutComponents(configuration: configuration)
Pass the applePay option, with your Apple merchant ID, when you create a flow component that displays all available payment methods for the payment session:
1let flow = try checkoutComponentsSDK.create(2.flow(options: [3.applePay(merchantIdentifier: "YOUR_MERCHANT_ID_HERE")4])5)
Check if the component is available, and render it:
1if component.isAvailable {2return component.render()3} else {4return nil5}
Alternatively, if you only want to render Apple Pay, create a standalone Apple Pay component:
1let applePayComponent = try checkoutComponentsSDK.create(2.applePay(merchantIdentifier: "YOUR_MERCHANT_ID_HERE")3)
Note
Before you render a standalone component, check that isAvailable returns true. Flow performs this check automatically for the payment methods it renders.
You can listen to the existing onSuccess callback or onError callback to handle the payment response for Apple Pay, alongside card and other payment method outcomes:
1let callbacks = CheckoutComponents.Callbacks(2onSuccess: { component, paymentID in3// Payment completed — navigate to confirmation screen4},5onError: { error in6// Payment declined, failed, or cancelled — show error UI7}8)
If the customer dismisses the Apple Pay screen, Flow for mobile calls onError with a paymentCancelled error.
We send you a webhook notifying you of changes to the payment's status. Wait for the webhook callback before you start your order fulfillment process.
For payments submitted with Flow, the PaymentSession ID appears in the webhook payload's data.metadata.cko_payment_session_id field.
Flow for mobile also provides other callbacks so you can customize the payment flow further. For example, you can dynamically adjust the payment amount or retrieve card metadata and card tokenization results. For more information, see Extend your Flow for mobile integration.
To test Apple Pay payments, you need:
- A device compatible with Apple Pay
- A sandbox Apple Pay wallet, which you have added a test card to – For more information, see Apple Developer – Sandbox testing
Use test cards to simulate different payment flows and ensure your integration is set up correctly and behaving as expected.
You can check the status of a payment from the Payments > Processing > All payments page in the Dashboard.