Create a loyalty card
create_cardSaves a loyalty card design and its rewards to a Leal store, ready for customers to add to Apple Wallet or Google Wallet. Takes the same design fields as preview_card_designs. Logos and strip photos are fetched from their URLs; if the store has no logo yet, the card's logo becomes the store logo. Needs a Leal account: the person is asked to sign in or create one.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Internal name for the card, e.g. "Coffee card". Shown in Leal, not on the pass. | |
| rewards | Yes | Rewards customers can redeem, e.g. [{name: "Free coffee", stamps_required: 10}]. The free plan allows one reward per card. | |
| logo_url | No | Public https URL of the wide logo shown top-left of the Apple pass (PNG, JPEG, WebP, GIF or SVG; transparent PNG works best). Ideally a version that reads on card_color. | |
| store_id | No | Store id from list_stores. Optional when the login has one store. | |
| card_color | No | Pass background colour, hex (#RRGGBB). | |
| stamp_icon | No | Icon shown in each collected stamp. | |
| strip_type | No | Background of the stamp strip: a flat colour, one of Leal's preset photos, or an image from strip_image_url. | |
| text_color | No | Colour of all text on the pass, hex. Must read clearly on card_color (4.5:1 contrast or better). | |
| header_text | No | Text at the top of the pass. Defaults to the store name. Wallet apps truncate long headers, so keep it short. | |
| stamp_color | No | Colour of the icon inside a collected stamp, hex. Must read clearly on stamp_background_color. | |
| strip_color | No | Strip colour, hex. Also shows behind preset and image strips when strip_opacity is below 100. | |
| strip_preset | No | Preset strip photo, used when strip_type is preset. | |
| strip_opacity | No | Opacity of the strip colour or image over the card colour. 100 shows it exactly; 60–85 tints a photo with the card colour so stamps stand out. | |
| initial_stamps | No | Stamps a new customer starts with (a head start). Must be less than stamps_required. | |
| square_logo_url | No | Public https URL of a square logo or icon, used as the round logo on Google Wallet. | |
| stamps_required | No | Stamps needed to fill the card. 6, 8 or 10 are common. | |
| strip_image_url | No | Public https URL of a wide photo for the strip (strip_type image), e.g. a hero image from the brand's website. Cropped to 375×144. | |
| auxiliary_fields | No | Up to two extra front-of-pass fields, e.g. {label: "Perk", value: "10% off pastries"}. | |
| show_member_field | No | Show the customer's name on the front of the pass. Default true. | |
| stamp_background_color | No | Fill colour of a collected stamp circle, hex. Empty stamp slots use a translucent version of it, so it should stand out from the strip. | |
| show_stamps_to_reward_field | No | Show how many stamps until the next reward. Default true. |