On this page
Display the Button
To display a Track with Apple Wallet Button, use the following code to load the button script into your webpage from the content delivery network:
<script crossorigin src="https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js" ></script>
The JavaScript Track with Apple Wallet Button provides an easy way for users to add an Order package to Wallet from the Web. You can specify the button style, type, and localization using attributes. Use CSS to set other properties, such as the size and corner radius.
Note
The new Track in Wallet button component will render on iOS 17 and above, and macOS 14 and above.
The button must define an onclick
handler to trigger the order package download.
The handler should redirect the browser to the unique order package URL.
Note
Ensure that your server sends application/vnd.apple.finance.order
Content-Type
header when serving the order package files. This allows the browser to detect the order and display the native
UI to import it into Wallet.
See Build a distributable order package section for tips on generating the Order package.
Using the official Track with Apple Wallet Button element ensures your site will display the latest style, render correctly across devices, and follow Apple Guidelines. For design guidance, see Human Interface Guidelines > Apple Pay > Buttons and Marks.
Note
To protect user privacy, we recommend you ensure the generated package URL is not guessable, and ideally, that it is protected using the same authenticated user session.
- It should not be possible to guess the next order package URL automatically.
- It should not be possible to download order packages anonymously (ie, without a valid login session).
- It should not be possible for a user to download an order package that belongs to a different user, even if they find out the order package URL.
Try it: Display Settings
Use the following tools to try the different display settings on the widget shown below:
To try this demo, open this page in Safari.
(See Requirements.)
Style
Compact
Locale
Button Box Sizing
<style> apple-wallet-button { --apple-wallet-button-border-radius: 5px; --apple-wallet-button-height: 40px; --apple-wallet-button-width: 180px; --apple-wallet-button-padding: 0px 0px; --apple-wallet-button-box-sizing: content-box; } </style> <apple-wallet-button buttonstyle=" " compact="true" locale="en-US" onclick="window.location.href='https://applepaydemo.apple.com/static/order/123456789.order';" />