Introduce Loyalty Cards to Your Application with Samsung Wallet
introduction the samsung wallet application lets you store cards that can be used for various purposes. if you want to provide reward points to your members, use the newly introduced loyalty card type, also known as a membership card. in this article, we show how you can create a loyalty card in the wallet partners portal. we also provide guidelines to implement the card, so that you can integrate the loyalty card into your application. card setup before adding the card to samsung wallet, create your card in the wallet partners portal. log in to the wallet partners portal. select wallet cards from the sidebar and then navigate to create wallet card. follow the instructions in the general information section to complete the form. select "loyalty card" from the wallet card template menu. select your location from the main (headquarters) location menu. if you get a "country not supported" error during a later phase, contact samsung developer support. after completing the form, save the card. all created cards are listed in the manage wallet card view. you can view, edit, and delete the card information from this view. finally, launch the card. card specification once a card is created in the wallet partners portal, the card can be implemented in the partner application so that the user can purchase and use it. to do so, implement the "add to samsung wallet" button in your application. for this purpose, generate a card data token and create a final url. this url is integrated with the "add to samsung wallet" button to add the card to samsung wallet. for generating a card data token, you need to define the wallet card data. the loyalty card follows the specification below. name description title required. the main title of the loyalty card. in the sample card, this field has the value "card title". eventid optional. the event id. use this id to find and process an action to an event to all loyalty cards with the same id. groupingid optional. identifier to group related cards. subtitle1 optional. an auxiliary field for showing supporting information about your card. logoimage optional. logo image displayed in the card item. the image size must be a maximum of 256 kb. logoimage.darkurl optional. logo image displayed in the card item in dark mode. the image size must be a maximum of 256 kb. logoimage.lighturl optional. logo image displayed in the card item in light mode. the image size must be a maximum of 256 kb. providername required. provider name for the loyalty card. startdate optional. card validity start date. the date format is an epoch timestamp in milliseconds. enddate optional. card validity end date. the date format is an epoch timestamp in milliseconds. locations optional. list of locations where the card can be used. this information can be used to provide location-based service and samsung wallet can use this information to show maps, place names and addresses. you can find more about the location field and the json format in the documentation. noticedesc optional. the notices section can be used for any additional information for your card. you can use html tags without any css or script in this field. for the test card, this field contains the following list: <ul> <li>loyalty card notice. <a href="https://www.samsung.com/">learn more.</a></li> <li>loyalty card notice.</li></ul> csinfo optional. customer service information visible to the card user. this information is stored as key-value pairs with the following keys that correspond with the categories of information shown to the user: callemail website applinklogo required. application link logo url applinkname required. application link name applinkdata required. application link destination url bgimage optional. background image for the card bgcolor optional. background color for the card. if you use bgcolor together with bgimage, they are displayed in a predefined ratio. to only display a background image, omit the bgcolor value. the following image shows the difference between a scenario where both bgimage and bgcolor are used (left) to one where only bgimage is used (right). fontcolor optional. font color on the card art. barcode.value optional. barcode data and serial number. barcode.serialtype optional. barcode presentation type. for more details, see the presentation types (serialtype) table. barcode.ptformat optional. barcode presentation format. you can find all supported presentation formats in the presentation formats (ptformat) table. barcode.ptsubformat optional. barcode format. some commonly used barcode formats are listed in the barcode formats (ptsubformat) table. barcode.errorcorrectionlevel optional. qr code error correction level. four error correction levels are available: l/m/q/h. merchantid optional. merchant identifier. use this field if you have merchant id. merchantname optional. merchant name. amount optional. total amount of points or initial balance. it is recommended to use a one-letter currency symbol. use any of these formats: $1,000 or 1,000p. balance optional. available points or remaining balance. use the same format as the amount field. card json example the card data must be in the json format and needs to follow the specific structure. the example below shows a card data sample that we have used to implement the loyalty card used in this content. modify the card data as per your card information. find more about the card data format in the wallet cards documentation. { "card": { "type": "loyalty", "subtype": "others", "data": [ { "refid": "9400ae65-751b-4327-866c-37e8c228f1c4", "createdat": 1672574400000, "updatedat": 1672574400000, "language": "en", "attributes": { "title": "card title", "eventid": "event-001", "groupingid": "group-001", "orderid": "order-001", "subtitle1": "card subtitle", "logoimage": "https://kr-cdn-gpp.stg.mcsvc.samsung.com/devops/ops/partner-portal/test-tool/assets/img/ticket_movie.jpg", "logoimage.lighturl": "https://kr-cdn-gpp.stg.mcsvc.samsung.com/devops/ops/partner-portal/test-tool/assets/img/ticket_movie.jpg", "logoimage.darkurl": "https://kr-cdn-gpp.stg.mcsvc.samsung.com/devops/ops/partner-portal/test-tool/assets/img/ticket_movie.jpg", "providername": "provider name", "startdate": 1715533051242, "enddate": 1715833051242, "noticedesc": "<ul><li>loyalty card notice. <a href=\"https://www.samsung.com/\">learn more.</a></li><li>loyalty card notice.</li></ul>", "csinfo": "{\"website\":\"https://homepage.com/cs\",\"email\":\"cs@email.com\",\"call\":\"555 333 111\"}", "applinklogo": "https://play-lh.googleusercontent.com/znfa1roz7hpv9j-jiacbjmjudl2x-fnuwte0oyvbbcwvf5vpzoqqikbxgk7d-aptvag=w240-h480-rw", "applinkname": "loyalty card link", "applinkdata": "www.samsung.com", "bgimage": "https://djcpagh05u38x.cloudfront.net/wlt/us/stg/x1iwgocnroqa5dmwpykfkq/qupknpwntmqt7letkgufag.png", "bgcolor": "#ffffff", "fontcolor": "#ffffff", "locations": "[{\"lat\":48.861614505643196,\"lng\":2.380811870098114,\"address\":\"38 rue saint-maur, 75011 paris\",\"name\":\"atelier des lumieres\"}]", "amount": "$1,000", "balance": "$100", "barcode.value": "cs16138353212584806754fg1802", "barcode.serialtype": "qrcode", "barcode.ptsubformat": "qr_code", "barcode.ptformat": "qrcodeserial", "barcode.errorcorrectionlevel": "m", "merchantid": "123344433", "merchantname": "merchantname" } } ] } } test with the add to wallet test tool once the card data specification details and the json structure of the loyalty card are established, we can test the "add to samsung wallet" functionality. first, we use the add to wallet test tool as this tool provides minimal card data in json format by default. after that, you can modify the json data and test the cards as you want. follow the instructions below to use the add to wallet test tool. for more details, refer to the add to wallet test tool documentation. sign in to the add to wallet test tool. enter the private key in the enter partner private key field. select the loyalty card we have created and then enter the json in the data field. finally add the card to samsung wallet. create jwt token if testing with add to wallet test tool is successful, you can implement the "add to samsung wallet" functionality with your application or website and handle the card data token generation process on your server. finally, generate the url and integrate it with the "add to samsung wallet" button. for more details on the implementation, check out our implementing "add to wallet" in an android application article, which is a complete guide to implementing the "add to samsung wallet" button on an android application and handling the card data token generation process on the server side. conclusion once the implementation of both the application and server is completed, you can integrate the loyalty card with your production server and perform a full test on the loyalty card. after the test is done, an admin will check and set the card as active. while implementing your card, follow the steps shown in seamlessly integrate "add to wallet" for samsung wallet, as this article focuses on the common mistakes. if you have any questions or face difficulties implementing the card, you can contact samsung developer support. related resources integrate "add to samsung wallet" button into partner services implementing "add to wallet" in an android application seamlessly integrate "add to wallet" for samsung wallet