Headless Apple Pay
Headless Apple Pay is a lightweight, embeddable UI module that allows partners to offer Apple Pay as a payment method directly within their own application without loading any widget.
Watch: How Headless Apple Pay Works
A short walkthrough of Headless Apple Pay and how it embeds the Apple Pay flow directly inside your own app.
Our Solution
Headless Apple Pay exposes just the Apple Pay button as a standalone, embeddable component. Partners control where it sits, how it looks, and what happens after payment. Transak handles all the payment infrastructure in the background.
Here are some of the key benefits of the Headless Apple Pay solution:
How does it work?
Current Limitations
Before you start
Complete the prerequisites
Get access to the Whitelabel API and set up the mandatory terms. See Quickstart.
Also ask Transak to whitelist your API key and enable Headless Apple Pay for it, and share your backend’s public IP addresses. See Need help in Integration.
Complete the Whitelabel API setup
Run Lookup, Authentication and Check KYC status. See How the integration fits together. Continue with the steps below only when Get KYC Requirement returns APPROVED.
When you call Get Quote, set paymentMethod to apple_pay.
US, EEA and UK users: show the disclaimers for the termsIds in the Get Quote response directly above the Apple Pay component, before the user places the order. See How to Display Disclaimers in Your API Integration.
How to integrate?
Get User Limits
Call Get User Limits with paymentCategory = apple_pay and fiatCurrency to fetch the user’s monthly, daily, and yearly limits.
On success → proceed to Get Active Orders.
Get Active Orders
Call Get Active Orders to check for any existing pending orders. Transak doesn’t support placing multiple orders simultaneously.
Cancel Order
Call Cancel Order with orderId and cancelReason to cancel the pending order.
This is only required when an active order is present. After cancellation, proceed to Create a transaction session.
Create a transaction session (using Backend only)
Call the Transaction Session API from your backend using the quoteId and the user’s wallet address. You can optionally pass a config object to customise the look and feel of the Apple Pay component.
A successful response returns a sessionId.
Load the Apple Pay Component via Transak UI SDK
Use the Transak UI SDK to render the Apple Pay component. Pass the sessionId received in previous Step.
JS
React
React Native
Flutter
Call applePay.unmount() to remove the component from the page after onSuccess fires, or when the user leaves the checkout screen.
Recommended implementation
The code snippet below wraps TransakApplePay in a view that supports dark/light mode, displays a loading spinner until the component is ready, and fades in a blur overlay when the Apple Pay sheet opens.
The package needs Flutter 3.29 or later. Give the widget a fixed height, and remove it from the widget tree after onSuccess fires, or when the user leaves the checkout screen.
onClick callback
The onClick callback fires each time the user taps the Apple Pay button, including when they tap again after closing the Apple Pay sheet. It has no payload.
onError callback
The onError callback returns one of the following error codes. Use it to handle each failure case.
Here’s how the Apple Pay module appears :
.png)
Place the order (using Backend only)
Once the SDK fires onSuccess with a requestId, call the Create Order API from your backend using the requestId to complete the payment and create the order.
A successful response returns the full order details.
Track the requestId (using Backend only)
Call the Transaction Request Status API to check whether the request has been processed. Poll this endpoint after calling the Create Order API until the status reaches a terminal state.
Once you receive an orderId, use the Get Order by ID API to fetch full order details.