Skip to content

QRCodeService

Generate QR codes for passes.

Methods

MethodDescription
getAppleQRCode(passId)Get Apple Wallet QR code URL
getGoogleQRCode(passId)Get Google Wallet QR code URL

getAppleQRCode()

Get the QR code URL for Apple Wallet pass download.

typescript
const qrUrl = await client.qrCodes.getAppleQRCode('pass-uuid');
console.log('Apple QR:', qrUrl);
// https://api.wallethero.app/qr/apple/pass-uuid

getGoogleQRCode()

Get the QR code URL for Google Wallet pass.

typescript
const qrUrl = await client.qrCodes.getGoogleQRCode('pass-uuid');
console.log('Google QR:', qrUrl);
// https://api.wallethero.app/qr/google/pass-uuid

Usage Example

Display QR codes for a pass:

typescript
const pass = await client.passes.get('pass-uuid');

// QR codes are automatically generated
console.log('Apple QR:', pass.apple_qrcode_url);
console.log('Google QR:', pass.google_qrcode_url);

// Or get them via the service
const appleQR = await client.qrCodes.getAppleQRCode(pass.id);
const googleQR = await client.qrCodes.getGoogleQRCode(pass.id);

Embedding in HTML

html
<div class="pass-qr-codes">
  <div>
    <h3>Apple Wallet</h3>
    <img src="https://api.wallethero.app/qr/apple/{pass-id}" alt="Apple Wallet QR">
  </div>
  <div>
    <h3>Google Wallet</h3>
    <img src="https://api.wallethero.app/qr/google/{pass-id}" alt="Google Wallet QR">
  </div>
</div>

WalletHero Documentation