Wallet API
Developer reference for the Wallet app. The Wallet has no dedicated exports: the phone talks to the server through Bridge callbacks, the server pushes two client events, and cards are built on demand from the framework and the tables below.Three ways to get a card into a player’s wallet from your own resource, in order of preference:
- A condition card in
Config.Wallet.Cards— give an item, a license or a job grade and the card appears on the next open. - A membership row in
roadshop_wallet_cards, followed byroadphone:wallet:cardsChangedfor the holder — see Issuing cards from another resource. - Code inside the
roadphoneresource (server/serverAPI/*.lua, addons) can call the global builders directly.
Callbacks
Registered inserver/wallet.lua. The phone calls them through the NUI proxies listed further down; the server never trusts a player id or identifier from the client — every distance is measured server-side and every identity is re-read from the framework.
Every failure answers
{ ok = false, reason = … }:
Client events
Both are networked client events (
RegisterNetEvent), so another server resource may trigger roadphone:wallet:cardsChanged itself after touching roadshop_wallet_cards:
NUI callbacks
Registered inclient/wallet.lua, for reference when you read the phone UI or write a custom app that reuses the flow.
Card schema
Every card — ingetCards and in roadphone:wallet:incoming — has this shape:
meta per type:
Field
kind values: date, datetime (unix seconds), dob (YYYY-MM-DD), sex (m / f), height (centimetres); without kind the value is shown as text.
Global functions (inside the roadphone resource)
These are plain globals of server/wallet.lua. They are not exports — use them from server/serverAPI/*.lua, addons or other scripts that run inside the resource.
BuildWalletCards
number
required
The player’s server ID.
table
Array of card objects; empty when the player has no identifier.
BuildWalletCard
number
required
The player’s server ID.
string
required
A card id such as
'license:drive' or 'ticket:42'.table | nil
The card, or
nil when the player does not hold it.WalletNotifyCardsChanged
roadphone:wallet:cardsChanged to an online player. Safe to call for a source that is offline — nothing happens.
WalletDistance
number | nil
Distance between the two peds, or
nil when either player is offline or they are in different routing buckets. The same check the show, check-in and issue paths use.Issuing cards from another resource
Membership cards are rows inroadshop_wallet_cards. A resource that runs its own memberships (a club script, a company system) inserts the row and tells the holder’s phone:
Events app callbacks
The Events app supplies the tickets and membership cards the Wallet shows. Registered inserver/events.lua; every one answers { ok = false, reason = … } on failure.
roadphone:events:changed (Server → Client) tells the phone to reload the Events app.
Rate limits
Related Resources
Wallet
Configuration, card types, player flow and troubleshooting
Server Callbacks
The complete callback surface of RoadPhone Pro