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.

Gift card with a flexible layout displayed in Samsung Wallet, showing the logo, title, expiry date, sender, and gift terms

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:

  1. Sign in to the Samsung Wallet Partner portal with your Samsung account.
  2. Submit your partner information and business details for review.
  3. 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.
  4. 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:

  1. Sign in to the Samsung Wallet Partner portal.

  2. Hold the pointer over the Wallet Cards menu, and then click Create Wallet Card.

Samsung Wallet Partner portal with the Wallet Cards menu open and Create Wallet Card selected

  1. In the Wallet Card Name field, enter a name that is easy to identify, such as Sample Clothing Brand Gift Card.

  2. Next to Wallet Card Template, click Select.

  3. 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.

Select Wallet Card Template dialog comparing the Default Layout Design type and the Flexible Layout Design type

  1. 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.

Generic Card wallet card type with the Generic > Others sub type and the generic-others-default design type selected

  1. Turn off Enable Location service and leave the other fields blank, as they are not needed for this Code Lab.

  2. 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.

Draft wallet card details page for the Sample Clothing Brand Gift Card in the Samsung Wallet Partner portal

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:

  1. Go to Template Editor.

  2. Click CardArt to show the current preset layout.

  3. Click Change to open the preset options.

Template Editor showing the CardArt page, an empty card preview, and the Change button for card presets

  1. 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

Select Preset Card Art Type dialog with the Two pairs of extra information in auxiliary preset selected

  1. Click Done. The preview shows the new layout with empty containers.

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:

  1. Select the left container, and then set the entry key to logoImage. This container displays your brand logo.

Template Editor Properties panel setting the logoImage Entry key for the card header logo container

  1. 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.

Template Editor Properties panel setting the endDate Entry key with the yyyy.MM.dd datetime format

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:

  1. Select the left container. In Entry key, select Or direct input, enter giftedBy, and then click Done.

Entering the custom giftedBy Entry key with Or direct input for an auxiliary area container

  1. Select the right container, and then enter giftTerms in the same way.

  2. 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:

  1. From the Template Editor, scroll up and click Launch. The card status changes from Draft to Verifying.

Wallet card in Verifying status after clicking Launch in the Samsung Wallet Partner portal

  1. To open Wallet Studio, hold the pointer over the Wallet Cards menu, and then click Wallet Studio.

  2. Go to My Card Container, and then select Add to Samsung Wallet.

Wallet Studio My Card Container tab with Add to Samsung Wallet selected

  1. Enter your private key, and then select the wallet card that you created.

Wallet Studio Card Picker with the gift card selected and the partner private key entered

  1. Scroll down to see a preview of the card.

  2. 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

Wallet Studio form for editing gift card values next to a live preview of the flexible layout card

  1. 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

  1. Click Validate Data to check the card data for errors.

Wallet Studio JSON view of the generic card data with the Validate Data button

  1. If no errors are found, click Add to Samsung Wallet. A QR code appears on the screen.

  2. Scan the QR code with the camera app on your Galaxy device, and then tap Done to confirm adding the card.

Card added confirmation screen in Samsung Wallet on a Galaxy device

  1. Open Samsung Wallet app on your device to see your gift card with the layout that you designed.

Gift card with a flexible layout displayed in Samsung Wallet, showing the logo, title, expiry date, sender, and gift terms

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.