To integrate the Add to Wallet (ATW) functionality into your system, you need to embed the provided ATW script and configure it using tokenized card data. This allows users to securely add digital cards to Samsung Wallet.
Follow the steps below to implement the ATW button:
Create Tokenized Card Data (Cdata): Next, generate the Cdata (tokenized card data) and insert the corresponding Cdata token into the script. Cdata represents the actual content of the wallet card and comes in various formats depending on the card type. For more information, refer to the Generate_Cdata Sample Code.
Note: The Cdata token should expire in 30 seconds after creation, so the cdata token needs to be created right after the user actually clicks the 'Add to Wallet' button.
To implement the 'Add to Wallet' button, you may need some base data. You can find the base data and other necessary information on Partner portal's Wallet card page.
Samsung Wallet on the Web
This section explains how to implement the Add to Wallet button using JavaScript within a web environment or web view.
Web Button Reference with importing API JavaScript
If you implement the "Add to Wallet" button using this script, the button is shown only on the devices that support Samsung Wallet.
To automatically parse <samsung:wallet> HTML tags when the page is loaded, include the following standard JavaScript:
You can use these tags or JavaScript functions for the web button if you are rendering HTML and you have proper partner permissions. You can also use the script by referring to the various attributes.
samsung:wallet HTML Tag
The 'samsung:wallet' namespace tag defines the placement and various attributes of the "Add to Wallet" web button for Samsung Wallet.
(Required) Wallet card identifier. * Value granted from the Partners Portal.
cdata String
(Required) Encrypted card object (JSON). * This field needs to be encrypted. * See Security
pdata String
(Optional) Reference ID of the Wallet Card content. * Use instead of cdata when using Data Fetch Link. * Value granted from the Partners Portal.
partnercode String
(Required) Partner code. * Value granted from the Partners Portal.
buttonid String
(Required) DOM element ID for the "Add to Wallet" web button for Samsung Wallet.
certificateid String
(Optional) Certificate identifier based on CSR during onboarding. * Required when using Data Fetch Link with V3 path.
buttontype String
(Optional) "Add to Wallet" button type. ["btnSW" / "btnATSW" / "qrcode", default: btnSW] * See Image resources
inline String
(Optional) Flag to display the "Add to Wallet" image button in one-line format. Default: true (one-line).
locale String
(Optional) Locale of the "Add to Wallet" image button. * See Image resources
language String
(Optional) Language of the "Add to Wallet" image button. Default: navigator.language
rdclickurl String
(Required) URL for logging a button click event. * Value granted from the Partners Portal.
rdimpressionurl String
(Required) URL for logging a button impression event. * Value granted from the Partners Portal.
showforced String
(Optional) Flag to force the "Add to Wallet" button to be displayed. Default: false.
mediatheme String
(Optional) Load the button's resources from the media theme policy. There are 4 themes: default, inversion, lightonly, and darkonly. Default: default. * default: Load the button's theme according to the prefers-color-scheme policy. * inversion: Load the inverse of the default button's theme. * lightonly: Load the light theme of the default button. * darkonly: Load the dark theme of the default button.
style String (CSSStyleDeclaration)
(Optional) Load the button with a custom style.
target String
(Optional) Option to choose button's target name. * default: "WALLET"
type String
(Optional) Service type. ["atw" / "vww", default: "atw"] * "atw": Add to Wallet * "vww": Verifying with Wallet
model String
(Optional) Device model name for device compatibility checks. * If not provided, the device model is automatically detected.
onshowbutton Function
(Optional) Callback handler function for the button's on-show event.
onclickbutton Function
(Optional) Callback handler function for the button's on-click event. If you register the handler function, you must return a callback or promise value. * See Usage of onClickButton Handler
authtoken String
(Optional) Authentication token for creating a shortened URL. * Only applicable when buttontype is "qrcode".
qrcodeexpirydate String
(Optional) Expiry date for QR code generation. * Only applicable when buttontype is "qrcode". * If empty, defaults to 10 years of validity.
samsungWallet.addButton Function
The samsungWallet.addButton function is used to explicitly render the Add to Wallet button on your web page using the Samsung Wallet JavaScript API.
Data Transmit Link Example: samsungWallet.addButton
(Required) Wallet card identifier. * Value granted from the Partners Portal.
cdata String
(Optional) Encrypted card object (JSON). * This field needs to be encrypted. * See Security * Either cdata or pdata must be provided.
pdata String
(Optional) Reference ID of the Wallet Card content. * Use instead of cdata when using Data Fetch Link. * Either cdata or pdata must be provided.
partnerCode String
(Required) Partner code. * Value granted from the Partners Portal.
targetId String
(Required) DOM (Document Object Model) Element ID to place the "Add to Wallet" web button for Samsung Wallet.
buttonId String
(Required) DOM Element ID for the "Add to Wallet" web button for Samsung Wallet.
certificateId String
(Optional) Certificate identifier based on CSR during onboarding. * Required when using Data Fetch Link with V3 path.
buttonType String
(Optional) "Add to Wallet" button type. ["btnSW" / "btnATSW" / "qrcode", default: btnSW] * See Image resources
inline String
(Optional) Flag to display the "Add to Wallet" image button in one-line format. Default: true (one-line).
locale String
(Optional) Locale of the "Add to Wallet" image button. * See Image resources
language String
(Optional) Language of the "Add to Wallet" image button. Default: navigator.language
RDClickUrl String
(Required) URL for logging a button click event. * Value granted from the Partners Portal.
RDImpressionUrl String
(Required) URL for logging a button impression event. * Value granted from the Partners Portal.
showForced String
(Optional) Flag to force the "Add to Wallet" button to be displayed. Default: false.
mediaTheme String
(Optional) Load the button's resources from the media theme policy. There are 4 themes: default, inversion, lightonly, and darkonly. Default: default. * default: Load the button's theme according to the prefers-color-scheme policy. * inversion: Load the inverse of the default button's theme. * lightonly: Load the light theme of the default button. * darkonly: Load the dark theme of the default button.
style Object (CSSStyleDeclaration)
(Optional) Load the button with a custom style.
target String
(Optional) Option to choose button's target name. * default: "WALLET"
type String
(Optional) Service type. ["atw" / "vww", default: "atw"] * "atw": Add to Wallet * "vww": Verifying with Wallet
model String
(Optional) Device model name for device compatibility checks. * If not provided, the device model is automatically detected.
onShowButton Function
(Optional) Callback handler function for the button's on-show event.
onClickButton Function
(Optional) Callback handler function for the button's on-click event. If you register the handler function, you must return a callback or promise value. * See Usage of onClickButton Handler
authToken String
(Optional) Authentication token for creating a shortened URL. * Only applicable when buttonType is "qrcode".
qrCodeExpiryDate String
(Optional) Expiry date for QR code generation. * Only applicable when buttonType is "qrcode". * If empty, defaults to 10 years of validity.
samsungWallet.updateButton Function
The samsungWallet.updateButton function updates an existing "Add to Wallet" button's options.
The samsungWallet.removeButton function removes an existing "Add to Wallet" button from the DOM.
samsungWallet.removeButton("BUTTON_ID");
Usage of onClickButton Handler
The onClickButton callback handler function is invoked when the button is clicked. If you register the handler function, you must return a callback or promise value.
The callback function receives two arguments:
options — The current button options object. You can dynamically update properties such as cdata or pdata before the wallet action is triggered.
callbackClicked — A function that accepts a boolean flag. If called with true, the default click action (navigation to the wallet URL) is triggered.
If the handler function returns/resolves to true, the default click action is also triggered automatically.
Load the button's theme according to the prefers-color-scheme policy
inversion
Load the inverse of the default button's theme
lightonly
Load the light theme of the default button
darkonly
Load the dark theme of the default button
Samsung Wallet via MMS or Email
This section outlines how to configure and deliver Samsung Wallet cards through MMS or email, enabling users to add cards to Samsung Wallet directly from their messaging platform.
Note: These methods do not support dynamically controlling button visibility based on device compatibility.
Link to 'Add to Wallet' on MMS/Email
You can include an "Add to Wallet" web button in environments where the JavaScript API cannot be loaded, such as SMS or email.
(Required) Button's image resource URL. * See Image resources
RD_IMPRESSION_URL String
(Required) Impressions logging URL. * Value granted from the Partners Portal.
Manage Your Cookies
We use cookies to improve your experience on our website and to show you relevant
advertising. Manage you settings for our cookies below.
Essential Cookies
These cookies are essential as they enable you to move around the website. This
category cannot be disabled.
Company
Domain
Samsung Electronics
developer.samsung.com, .samsung.com
Analytical/Performance Cookies
These cookies collect information about how you use our website. for example which
pages you visit most often. All information these cookies collect is used to improve
how the website works.
Company
Domain
Samsung Electronics
.samsung.com
Functionality Cookies
These cookies allow our website to remember choices you make (such as your user name, language or the region your are in) and
tailor the website to provide enhanced features and content for you.
Company
Domain
Samsung Electronics
developer.samsung.com, google.account.samsung.com
Preferences Submitted
You have successfully updated your cookie preferences.