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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>",
"rewards": "<rewards>"
},
"name": "create_card"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Internal name for the card, e.g. "Coffee card". Shown in Leal, not on the pass. | |
| intent | No | Optional. One short sentence on what the person asked you to do, e.g. "Set up a stamp card for Ground Up Café". Leal shows it in the person's activity log under Settings → AI agents, so they can see what was done for them. Leave out customer details. | |
| 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. | |
| qr_style | No | What the pass QR holds. link (default for new cards): a phone camera opens the store's sign-up page with this customer as referrer, and the store scanner still reads it. code: the bare card code only. Passes showing the old QR keep scanning. | |
| store_id | No | Store id from list_stores. Optional when the login has one store. | |
| card_color | No | Pass background colour, hex (#RRGGBB). Fills the whole screen in Google Wallet, so avoid neon, fully saturated colours such as #00ff00. | |
| 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 Apple pass, hex. Must read clearly on card_color (4.5:1 contrast or better). Google Wallet ignores it and picks black or white itself. | |
| 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. | |
| referee_stamps | No | Stamps the invited friend gets on their first stamped visit. Less than stamps_required. Default 1. | |
| referrer_stamps | No | Stamps the inviting customer gets when their friend's first visit is stamped. Less than stamps_required. Default 1. | |
| 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 on Apple Wallet; Google Wallet shows the middle of it in its nearly square hero unless google_hero_image_url is given. | |
| auxiliary_fields | No | Up to two extra front-of-pass fields, e.g. {label: "Perk", value: "10% off pastries"}. | |
| google_logo_style | No | How the logo sits on Google Wallet. round (default): square_logo_url in a circle with the store name. wide: logo_url in place of the circle and store name, best for wordmarks. | |
| referrals_enabled | No | Let customers invite friends from the back of their pass. Both get stamps once the store first stamps the friend's card on a visit, never just for signing up. Default false. | |
| show_member_field | No | Show the customer's name on the front of the pass. Default true. | |
| google_hero_image_url | No | Public https URL of a nearly square photo (1032×812, about 5:4) for Google Wallet's hero image, with no text in it. The stamps are drawn on top. Optional: without it the hero uses the strip background. | |
| 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. |