Create and add a wallet card with flexible layout design
Objective
Learn how to create a wallet card with a custom layout by using the Flexible Layout Design template type in the Samsung Wallet Partner portal, and then preview and add the card to Samsung Wallet by using Wallet Studio.
Partnership request
You must be an official Samsung Wallet partner to create, manage, and monitor wallet cards. After Samsung approves your partnership, you can complete this Code Lab. For more information, see the Onboarding Guide.
Overview
Samsung Wallet lets users store digital content such as boarding passes, tickets, coupons, gift cards, and IDs on their Galaxy devices. Partners create and manage these wallet cards in the Samsung Wallet Partner portal.
Flexible Layout Design is a template type in the Samsung Wallet Partner portal for customizing the layout of each card area and the position of each piece of card data, without any layout code. Flexible Layout Design supports the following card types:
- Loyalty (Membership)
- Coupon
- Event ticket
- Generic card
- Boarding pass
For more information, see Samsung Wallet.
Set up your environment
You will need the following:
Start your onboarding process
To become a Samsung Wallet partner, complete the following steps:
- Sign in to the Samsung Wallet Partner portal with your Samsung account.
- Submit your partner information and business details for review.
- Generate a key pair and a certificate signing request (CSR), and then upload the CSR to the portal. Store the private key securely and don't share it.
- Wait for Samsung to approve your partnership. Approval can take a few business days.
Create a wallet card
A wallet card in the partner portal is a card design that you set up once and issue to many users. Each user who adds the card gets the same design, filled in with their own data.
In this Code Lab, you create a gift card by using the Generic card type. Samsung Wallet also offers a Gift card type, but it uses a predefined layout. The Generic card type is designed for cards that don't fit the other types, and it lets you customize the items on the card by connecting them with card data. It supports Flexible Layout Design, so you can arrange the card's areas yourself, and custom attributes through extendedFields, which you set up later in this Code Lab.
To create the card, follow these steps:
-
Sign in to the Samsung Wallet Partner portal.
-
Hold the pointer over the Wallet Cards menu, and then click Create Wallet Card.
-
In the Wallet Card Name field, enter a name that is easy to identify, such as Sample Clothing Brand Gift Card.
-
Next to Wallet Card Template, click Select.
-
Select a Wallet Card Template type. The template type decides how much control you have over the card:
- Default Layout Design: a fixed layout and design for the card type. It's quick to set up, but you have little control over the card's appearance.
- Flexible Layout Design: you decide the layout of each area and which data appears where, without writing any layout code. The card matches your brand and shows the information that your customers need.
For this Code Lab, select Flexible Layout Design, and then click Next.
-
Set the card type and design:
a. In Wallet Card Type, select Generic card.
b. In the sub type, select Generic > Others.
c. Select a design type that supports flexible layout. These design types are named in the format generic-SUB_TYPE-default, where SUB_TYPE is the sub type that you selected.
d. Click Done.
-
Turn off Enable Location service and leave the other fields blank, as they are not needed for this Code Lab.
-
In Main (Headquarters) Location, select any location, and then click Save.
Your wallet card is created in Draft status, which means that you can still edit the card but can't issue it yet. The portal also generates a Wallet Card ID, which identifies the card when you integrate Add to Samsung Wallet into your service.
NoteYou can't change the layout type after the card is activated.
Customize the card template
The Template Editor is a partner portal tool for designing the layout of a wallet card. It shows a live preview of your changes as you work.
A flexible layout card has three areas, and each area offers presets, which are predefined arrangements of containers for images and text. The following table describes the areas:
| Area
|
Location
|
Content
|
| Card Header Area
|
Top
|
Issuer information, such as the logo and provider name
|
| Card Primary Area
|
Middle
|
Key card information, such as the title, dates, and main image
|
| Card Auxiliary Area
|
Bottom
|
Supporting details, displayed as label and value pairs
|
To set the structure of the card, select a preset for each area:
-
Go to Template Editor.
-
Click CardArt to show the current preset layout.
-
Click Change to open the preset options.
-
Select the following presets:
- Header area: Logo with a square image and text
- Primary area: Max set of vertical or square image type
- Auxiliary area: Two pairs of extra information in auxiliary
- Click Done. The preview shows the new layout with empty containers.
NoteChanging a preset resets any layouts that you have already saved. Select your presets before you assign attributes.
Assign attributes to the layout
To fill a container, you select it and set its entry key in the Properties panel. An entry key is the name of an attribute in the card data. Samsung Wallet looks up the value of that key and displays the value in the container. For example, a container with the entry key title shows the title of the card, such as "50% OFF!".
You can set an entry key in two ways:
- Select from the list of attributes that the card type supports.
- Use Or direct input to enter your own key name for a custom attribute.
Header area
To assign the header containers, follow these steps:
- Select the left container, and then set the entry key to
logoImage. This container displays your brand logo.
- Select the right container, and then set the entry key to
providerName. This container displays the name of the issuing business.
Primary area
Set the entry keys for the three containers as described in the following table:
| Container
|
Entry key
|
Additional setting
|
What it shows
|
| Top left
|
title
|
|
Name or description of the gift card
|
| Bottom left
|
endDate
|
Datetime format: yyyy.MM.dd
|
Expiry date
|
| Right
|
mainImg
|
|
Gift card image
|
Samsung Wallet stores dates as epoch timestamps in milliseconds. The Datetime format setting converts a timestamp into a readable date, such as "2026.12.31".
A container can also have a label, which is a fixed text that explains the value. For example, the label "Valid until" tells users that "2026.12.31" is an expiry date.
Auxiliary area
The auxiliary area displays supporting details as label and value pairs. In the context of a gift card, examples include who sent the gift card or whether it can be transferred.
However, the Generic Card specification doesn't include attributes such as giftedBy or giftTerms. To display data that the card type doesn't define, you add custom attributes through extendedFields. The extendedFields value is a JSON string that contains a list of customizable data fields, and the card uses these fields to render dynamic content. Each field has the following properties:
entryKey: the key that you enter in the input field.
label: the name displayed in your application.
value: the data for the label.
You can assign an extendedFields entry to a container in any area of the card. In this Code Lab, the auxiliary area is the best place for them, because it's designed for label and value pairs.
The key name that you enter with Or direct input must match an entryKey. For example, the following data displays "Gifted By: Jane Smith" in the giftedBy container:
"extendedFields": "[{\"entryKey\":\"giftedBy\",\"label\":\"Gifted By\",\"value\":\"Jane Smith\"}]"
To assign the auxiliary containers, follow these steps:
- Select the left container. In Entry key, select Or direct input, enter
giftedBy, and then click Done.
-
Select the right container, and then enter giftTerms in the same way.
-
Click Save, and then click Apply. The layout takes effect for the wallet card.
Customize and add the wallet card from Wallet Studio
Wallet Studio is a partner portal tool for testing wallet cards with sample data. It lets you preview a card and add it to your own device.
To customize and add the card to your device, follow these steps:
- From the Template Editor, scroll up and click Launch. The card status changes from Draft to Verifying.
NoteA card in draft status can't be issued. Launching submits the card to Samsung for review and changes its status to Verifying. In this status, you can add the card to your own device through Testing Mode, which is on by default. After Samsung approves the card, its status changes to Active and the card becomes available to all users.
-
To open Wallet Studio, hold the pointer over the Wallet Cards menu, and then click Wallet Studio.
-
Go to My Card Container, and then select Add to Samsung Wallet.
- Enter your private key, and then select the wallet card that you created.
-
Scroll down to see a preview of the card.
-
Edit the card values and upload the card images in the form. The images must meet the following requirements:
mainImg: 2:3 aspect ratio for a vertical image, or 1:1 for a square image, up to 512 KB
logoImage: 1:1 aspect ratio, up to 256 KB
NoteSet the endDate to a date that is later than the current date. If the card has already expired, you can't add it to Samsung Wallet. The endDate value is a timestamp in milliseconds (epoch time in UTC).
- To customize attributes that aren't in the form, such as the background color (
bgColor), switch from Form to JSON. The card data looks similar to the following:
{
"card": {
"type": "generic",
"subType": "others",
"data": [
{
"refId": "sample-clothing-brand-gc-001",
"createdAt": 1795593491922,
"updatedAt": 1795593491922,
"language": "en",
"attributes": {
"title": "50% OFF!",
"providerName": "Sample Brand",
"startDate": 1766667600000,
"startDate.utcOffset": "UTC+09:00",
"startDate.relativeNotiTime": "30",
"endDate": 1798732740000,
"endDate.utcOffset": "UTC+09:00",
"endDate.relativeNotiTime": "30",
"serial1.value": "SAMPLE-CLOTHING-BRAND-01",
"serial1.serialType": "BARCODE",
"serial1.ptFormat": "BARCODESERIAL",
"serial1.ptSubFormat": "CODE_128",
"noticeDesc": "{\"count\":2,\"info\":[{\"title\":\"How to Use This Gift Card\",\"content\":[\"Visit anySample Clothing Brand store or shop online at sampleclothingbrand.com.\",\"Present this digital card at checkout to redeem your balance.\"]},{\"title\":\"Terms and Conditions\",\"content\":[\"Valid until December 31, 2026. Norefunds or exchanges for cash.\",\"Card is non-transferable and cannot be combined with other offers ordiscounts.\"]}]}",
"bgColor": "#799567",
"fontColor": "light",
"mainImg": "https://us-cdn-gpp.mcsvc.samsung.com/mcp25/resource/2026/11/25/faf1d3d6-3d54-487e-ac16-ef6f188d02e0.png",
"logoImage": "https://us-cdn-gpp.mcsvc.samsung.com/mcp25/resource/2026/11/25/3e24322f-a281-453e-8c8e-bca833107644.png",
"appLinkLogo": "https://us-cdn-gpp.mcsvc.samsung.com/mcp25/resource/2026/11/25/3e24322f-a281-453e-8c8e-bca833107644.png",
"appLinkName": "Sample Clothing Brand",
"appLinkData": "https://www.example.com",
"locations": "[{\"name\":\"Sample Clothing Brand\",\"address\":\"123 Main St. Suite 456 Anytown, USA\",\"lat\":12.345678,\"lng\":87.654321}]",
"extendedFields": "[{\"entryKey\":\"giftTerms\",\"label\":\"Gift Terms\",\"value\":\"Non-transferable\"},{\"entryKey\":\"giftedBy\",\"label\":\"Gifted By\",\"value\":\"Jane Smith\"}]"
}
}
]
}
}
The following table describes the fields in the sample card data:
| Field
|
Purpose
|
type and subType
|
The card type and subtype. This Code Lab uses generic and others.
|
refId
|
A unique ID for the card data.
|
createdAt and updatedAt
|
The creation and update times, as epoch timestamps in milliseconds (UTC). In the sample, 1795593491922 is November 25, 2026, 7:58:11 AM UTC.
|
language
|
The language of the card content, such as en.
|
title
|
The main title shown on the card.
|
providerName
|
The name of the business that issues the card.
|
startDate and endDate
|
The start and expiry dates, as epoch timestamps in milliseconds (UTC).
|
startDate.utcOffset and endDate.utcOffset
|
The UTC offset that the device uses to display the dates, such as UTC+09:00.
|
startDate.relativeNotiTime and endDate.relativeNotiTime
|
How many minutes before the date a notification is sent, such as 30.
|
serial1.value
|
The serial or barcode value shown on the card, such as SAMPLE-CLOTHING-BRAND-01.
|
serial1.serialType, serial1.ptFormat, and serial1.ptSubFormat
|
The barcode settings: the serial type (BARCODE), the presentation format (BARCODESERIAL), and the barcode standard (CODE_128).
|
noticeDesc
|
The notice content, such as how to use the card and its terms. The value is a JSON string.
|
bgColor
|
The background color of the card, such as #799567.
|
fontColor
|
The font color on the card. Use light or dark.
|
mainImg and logoImage
|
The URLs of the main image and the logo image.
|
locations
|
The card's location information, such as a store name, address, and coordinates. The value is a JSON string.
|
extendedFields
|
A list of customizable data fields that render dynamic content on the card. The value is a JSON string.
|
appLinkLogo, appLinkName, and appLinkData
|
The logo, name, and data for the partner app link.
|
The sample extendedFields data contains two fields:
| entryKey
|
label
|
value
|
giftedBy
|
Gifted by
|
Jane Smith
|
giftTerms
|
Gift Terms
|
Non-transferable
|
NoteYou can use this JSON as the starting point for the card data structure in your live service. Replace the sample values with dynamic values for each customer.
- Click Validate Data to check the card data for errors.
-
If no errors are found, click Add to Samsung Wallet. A QR code appears on the screen.
-
Scan the QR code with the camera app on your Galaxy device, and then tap Done to confirm adding the card.
- Open Samsung Wallet app on your device to see your gift card with the layout that you designed.
NoteIn a live service, customers tap an Add to Samsung Wallet button on your website, app, email, or MMS. Your server turns the card data into a card data token (Cdata), and the button sends the token with your Wallet Card ID to Samsung Wallet. The token expires after 30 seconds, so generate it when the customer clicks the button. For more information, see Implementing Add to Samsung Wallet Button.
You're done!
Congratulations! You have successfully completed the goal of this Code Lab. Now, you can create a wallet card with a flexible layout design and add it to Samsung Wallet.
To learn more, explore Samsung Wallet.