Google Wallet API client for wallet passes.
Uses the Google Wallet REST API to create, update, and manage pass objects and classes across all supported types (event tickets, boarding passes, loyalty cards, offers, and generic passes).
Summary
Functions
Builds a Google Wallet class object map from configuration.
Builds a Google Wallet pass object map from PassData and Visual.
Creates a pass object on Google's servers.
Creates or updates a pass class on Google's servers.
Ensures a class exists on Google's servers, creating it if necessary.
Gets a cached Google OAuth2 access token, refreshing if expired.
Updates an existing pass object on Google's servers.
Patches the state field of an existing Google Wallet object.
Functions
Builds a Google Wallet class object map from configuration.
Options
:id- Class ID suffix (required):issuer_name- Issuer name (required):event_name- Title/name for the class (required). Maps to type-specific field:eventNamefor event tickets,programNamefor loyalty,titlefor offers, etc.:pass_type- Pass type atom (optional, defaults to:event_ticket):start_date- Start date as ISO 8601 string (optional):end_date- End date as ISO 8601 string (optional):location_name- Venue name (optional):location_address- Venue address (optional):enable_smart_tap- Enable Smart Tap / NFC for this class (optional, boolean):redemption_issuers- List of issuer ID strings (~19 digits) authorized to redeem over Smart Tap (optional). Use issuer IDs, not the 8-digit Collector ID — the Collector ID belongs only on the reader/terminal, and a Collector ID here makes Google Wallet treat passes as non-redeemable (no NFC indicator, no tap). For self-redemption this is just your own issuer ID.:latitude- Venue latitude (optional):longitude- Venue longitude (optional):logo_uri- Logo image URI (optional):translations- Provided viaclass_config[:translations]map key as%{locale_tag => %{source_string => translated_string}}. PopulatestranslatedValueson class-level localizable fields (eventName,venue.name,venue.address) and adds plain+localized sibling pairs (localizedIssuerName,localizedProgramName,localizedTitle). See the Localization guide.
Builds a Google Wallet pass object map from PassData and Visual.
The object type is determined by pass_data.pass_type.
Options
:class_id— Class ID suffix to use for this object (defaults to the pass type's standard suffix).:translations—%{locale_tag => %{source_string => translated_string}}. PopulatestranslatedValueson the object's localizable fields (textModulesData[].localizedHeader/localizedBody, imagecontentDescription). See the Localization guide.
Creates a pass object on Google's servers.
If the object already exists (409), updates it instead.
The object type is determined by pass_data.pass_type.
Returns {:ok, object_id} on success.
Creates or updates a pass class on Google's servers.
Attempts to update first; falls back to insert on 404.
Pass type defaults to :event_ticket when not specified.
Ensures a class exists on Google's servers, creating it if necessary.
The first call within a VM lifetime calls create_or_update_class/2.
Subsequent calls for the same class_id are no-ops, tracked via the
TokenCache ETS table with key {:class_ensured, class_id}.
Returns :ok on success, {:error, reason} on failure.
Gets a cached Google OAuth2 access token, refreshing if expired.
Emits [:wallet_passes, :google, :token_exchange, :start|:stop] events
with metadata %{cached: boolean()}.
Updates an existing pass object on Google's servers.
The object type is determined by pass_data.pass_type.
Returns {:ok, object_id} on success.
@spec update_object_state(WalletPasses.PassType.t(), String.t(), String.t()) :: {:ok, term()} | {:error, term()}
Patches the state field of an existing Google Wallet object.
Lighter-weight than update_object/4 — it neither rebuilds the full pass payload
nor requires PassData. Only the "state" field is sent.
pass_type selects the object resource type (eventTicketObject, flightObject,
loyaltyObject, offerObject, genericObject); see WalletPasses.PassType.
state must be one of "ACTIVE", "INACTIVE", "EXPIRED", "COMPLETED".
Emits [:wallet_passes, :google, :update_object_state, :start|:stop|:exception]
telemetry events.