# Migration Guide: Transitioning from QR Code to Digital Wallet Ticketing This guide provides a detailed walkthrough for developers on how to transition from the existing QR code-based ticketing system to the new digital wallet-based ticketing system. ## Overview In this migration, we will: 1. Remove the QR code generation endpoint. 2. Add and utilize the new endpoint for generating digital wallet tickets compatible with Apple Wallet and Google Pay. ## Step-by-Step Migration ### 1. Remove QR Code Generation The QR code generation endpoint `/tickets/{ticketId}/qr` will be deprecated and removed from the API. Ensure that your application no longer makes calls to this endpoint and handles the removal gracefully. ### 2. Update API Client Ensure your API client is updated to no longer reference the deprecated QR code endpoint and instead use the new digital wallet endpoint. ### Example Update: #### Old API Call (QR Code) ```javascript // Old endpoint for QR code generation fetch('https://api.fake-museum-example.com/v1.1/tickets/{ticketId}/qr') .then(response => response.blob()) .then(blob => { // Handle QR code image blob }) .catch(error => console.error('Error:', error)); New API Call (Digital Wallet Ticket) javascript Copy code // New endpoint for digital wallet ticket generation fetch('https://api.fake-museum-example.com/v1.1/tickets/{ticketId}/pkpass') .then(response => response.json()) .then(data => { // Handle digital ticket data console.log('Digital Ticket:', data); }) .catch(error => console.error('Error:', error)); ``` ### 3. Integrate Digital Wallet Tickets The new endpoint /tickets/{ticketId}/pkpass provides a digital ticket compatible with Apple Wallet and Google Pay. Update your application to handle the response from this endpoint and guide users to add their tickets to their digital wallets. ### Example Integration: **Fetching and Adding Digital Ticket to Wallet:** ```javascript // Function to add ticket to Apple Wallet or Google Pay function addTicketToWallet(ticketId) { fetch(`https://api.fake-museum-example.com/v1.1/tickets/${ticketId}/pkpass`) .then(response => response.json()) .then(data => { const { eventName, ticketDate, ticketId } = data; // Logic to add to Apple Wallet or Google Pay // Example for Apple Wallet (iOS) if (window.AppleWallet) { window.AppleWallet.pass({ eventName, ticketDate, ticketId }); } // Example for Google Pay (Android) if (window.GooglePay) { window.GooglePay.pass({ eventName, ticketDate, ticketId }); } }) .catch(error => console.error('Error:', error)); } ``` ### 4. User Experience Update your user interface to inform users about the new digital wallet ticketing system. Provide clear instructions on how to add tickets to their digital wallets. **Example User Instructions:** ```html
To add your ticket to Apple Wallet or Google Pay, click the button below: