create

POST /api/v1/accounts/:account_id/cards

Create a loyalty card

Creates a new loyalty stamp card template for the store. The card defines the visual design (colours, icon, strip) and program rules (stamps required, initial stamps).

Parameters

Name Type Required Description
account_id Must be a Integer Required

Parent store ID

card Must be a Hash Required

Card attributes

card[name] Must be a String Required

Card name (e.g. ‘Coffee Loyalty Card’)

card[card_color] Must be a String Optional

Hex colour for the card background (e.g. ‘#6B4226’)

card[text_color] Must be a String Optional

Hex colour for card text

card[stamp_icon] Must be a String Optional

Stamp icon identifier

card[stamp_color] Must be a String Optional

Hex colour for stamp icons

card[stamp_background_color] Must be a String Optional

Hex colour for stamp backgrounds

card[stamps_required] Must be a Integer Optional

Number of stamps needed to complete the card (1–21)

card[initial_stamps] Must be a Integer Optional

Number of stamps pre-filled on new customer cards (must be >= 0 and < stamps_required)

card[referrals_enabled] Must be one of: true, false, 1, 0. Optional

Let customers invite friends from the back of their pass (default false)

card[referrer_stamps] Must be a Integer Optional

Stamps the inviting customer gets when the friend’s first visit is stamped (>= 0 and < stamps_required, default 1)

card[referee_stamps] Must be a Integer Optional

Stamps the invited friend gets on their first stamped visit (>= 0 and < stamps_required, default 1)

card[qr_style] Must be one of: link, code. Optional

What the wallet pass QR holds. Defaults to ‘link’ for new cards

card[show_member_field] Must be one of: true, false, 1, 0. Optional

Whether wallet passes show the member name field

card[show_stamps_to_reward_field] Must be one of: true, false, 1, 0. Optional

Whether wallet passes show the stamps-to-reward field

card[auxiliary_fields] Must be an Array of nested elements Optional

Up to two extra front-of-pass fields. Blank values are ignored.

card[auxiliary_fields][label] Must be a String Optional

Optional label displayed above the value

card[auxiliary_fields][value] Must be a String Required

Value displayed on the pass

card[strip_type] Must be a String Optional

Strip image type

card[strip_color] Must be a String Optional

Hex colour for the strip (used when strip_type is ‘color’)

card[strip_opacity] Must be a Integer Optional

Opacity (0–100) of the strip background over the card colour. Defaults to 100, which renders the colour or image exactly as supplied

card[strip_preset] Must be a String Optional

Preset strip image identifier (used when strip_type is ‘preset’)

card[header_text] Must be a String Optional

Optional header text displayed on the card

card[apple_pass_style] Must be one of: store_card, poster. Optional

Apple Wallet layout. ‘poster’ is iOS 27’s full-bleed layout; older iPhones show the store card. Defaults to ‘store_card’

card[google_logo_style] Must be one of: round, wide. Optional

How the logo sits on Google Wallet. Defaults to ‘round’

card[featured_actions] Must be an Array of nested elements Optional

Up to two buttons, shown as Featured Actions under the iOS 27 poster and as links in Google Wallet. Send an empty array to remove them.

card[featured_actions][type] Must be one of: place, call, viewOffersRewards, membershipBenefits, order, shop, bookAppointment, addToBalance, bookStay, bookCar, bookFlight, viewSchedule, watchTrailer, listenToMusic. Required

Action type. ‘place’ opens a store location (needs location_id, and the location must be matched to Apple Maps); ‘call’ dials a number; every other type opens a link

card[featured_actions][url] Must be a String Optional

An https link, or a phone number for ‘call’

card[featured_actions][location_id] Must be a Integer Optional

A location of this store, for ‘place’

card[expires_at] Must be a String Optional

Card expiry timestamp (ISO 8601)

Error Codes

Code Description
401 Unauthorized – invalid or missing API token
404 Store not found or not accessible
422 Validation failed – check the `errors` object for details

Returns

Code: 201

The newly created card object

Name Type Required Description
id Must be a Integer Required

Unique card ID

name Must be a String Required

Card name (e.g. ‘Coffee Loyalty Card’)

card_color Must be a String Required

Hex colour for the card background (e.g. ‘#6B4226’)

text_color Must be a String Required

Hex colour for card text

stamp_icon Must be a String Required

Icon used for stamps (e.g. ‘coffee’, ‘heart’, ‘star’)

stamp_color Must be a String Required

Hex colour for stamp icons

stamp_background_color Must be a String Required

Hex colour for stamp backgrounds

stamps_required Must be a Integer Required

Number of stamps needed to complete the card (1–21)

initial_stamps Must be a Integer Required

Number of stamps pre-filled on new customer cards (0 to stamps_required - 1)

referrals_enabled Must be one of: true, false, 1, 0. Required

Whether customers can invite friends from the back of their pass. A referral pays out when the store first stamps the friend’s card for a visit (a scan, or the API/POS), never for signing up

referrer_stamps Must be a Integer Required

Stamps the inviting customer gets when the referral pays out

referee_stamps Must be a Integer Required

Stamps the invited friend gets when the referral pays out

qr_style Must be a String Required

What the wallet pass QR holds: ‘link’ (the customer’s invite link with the card code after the #, readable by the Leal scanner and by search) or ‘code’ (the bare card code). Cards created before referrals use ‘code’

show_member_field Must be one of: true, false, 1, 0. Required

Whether wallet passes show the member name field

show_stamps_to_reward_field Must be one of: true, false, 1, 0. Required

Whether wallet passes show the stamps-to-reward field

auxiliary_fields Must be an Array of nested elements Required

Up to two extra front-of-pass fields

auxiliary_fields[key] Must be a String Required

Generated wallet pass field key

auxiliary_fields[label] Must be a String Required

Optional field label

(nil allowed)
auxiliary_fields[value] Must be a String Required

Field value

strip_type Must be a String Required

Strip image type: ‘color’, ‘image’, or ‘preset’

strip_color Must be a String Required

Hex colour for the strip (when strip_type is ‘color’)

(nil allowed)
strip_opacity Must be a Integer Required

Opacity (0–100) of the strip background over the card colour, for a colour, an uploaded image or a preset alike. 100 renders the colour or image exactly as supplied; lower values let the card colour show through

strip_preset Must be a String Required

Preset strip image identifier (when strip_type is ‘preset’)

(nil allowed)
header_text Must be a String Required

Optional header text displayed on the card

(nil allowed)
apple_pass_style Must be a String Required

Apple Wallet layout: ‘store_card’ (the classic layout) or ‘poster’ (iOS 27 full-bleed artwork; iPhones on iOS 26 or earlier show the store card)

google_logo_style Must be a String Required

How the logo sits on Google Wallet: ‘round’ (the square icon in a circle, with the store name) or ‘wide’ (the logo in place of the circle and store name)

featured_actions Must be an Array of nested elements Required

Up to two buttons: Featured Actions under the iOS 27 poster, and links under the pass in Google Wallet

featured_actions[type] Must be a String Required

Action type, as Apple names it (e.g. ‘order’, ‘bookAppointment’, ‘call’, ‘place’)

featured_actions[url] Must be a String Required

The link, or a phone number for ‘call’. Absent for ‘place’

(nil allowed)
featured_actions[location_id] Must be a Integer Required

The store location ‘place’ opens

(nil allowed)
google_wallet Must be a Hash Required

How the card measures up to Google Wallet’s brand guidelines

google_wallet[text_color] Must be a String Required

The text colour Google Wallet uses on this card: it picks black or white itself and ignores text_color

google_wallet[hero_image] Must be a String Required

What fills the hero image behind the stamps: ‘hero_image’ (uploaded in Leal), ‘strip_image’, ‘preset’ or ‘color’

google_wallet[warnings] Must be an array of any type Required

Guidelines the card doesn’t meet: any of ‘color’, ‘title’, ‘issuer_name’, ‘field_labels’, ‘field_values’, ‘logo’, ‘hero’. Empty when it meets them all

expires_at Must be a String Required

ISO 8601 timestamp when the card expires, or null if it does not expire

(nil allowed)
archived_at Must be a String Required

ISO 8601 timestamp when the card was archived, or null if active

(nil allowed)
rewards_count Must be a Integer Required

Number of rewards defined for this card

customer_cards_count Must be a Integer Required

Number of customer card instances issued

created_at Must be a String Required

ISO 8601 creation timestamp

updated_at Must be a String Required

ISO 8601 last-update timestamp