Complete Workflow: Create Campaign and Send Wallet Cards
This example shows the complete flow from creating a campaign to sending wallet cards to recipients. All code examples are ready to use — just replace YOUR_API_KEY with your actual API key.
Step 1: Create a Campaign
First, create a campaign that defines your wallet card program:
/campaignscampaigns:writeCreate a new campaign for your wallet card program.
Step 2: Add a Recipient
Add a recipient to the campaign. This creates the recipient and wallet card, but does not send an invite:
/campaigns/{campaignId}/recipientscampaigns:writeAdd a single recipient to a campaign. Wallet cards are automatically created in the background.
Step 3: Invite Recipient
After adding a recipient, invite them to add the wallet card to their device. This updates their status to invited and optionally sends an email:
/campaigns/{campaignId}/recipients/{recipientId}/invitecampaigns:writeSend an invite to a recipient. This updates their status to invited and optionally sends an email.
Step 4: Complete Workflow Function
Here's a complete function that ties everything together:
Next Steps
- Learn about bulk operations for adding multiple recipients
- Set up webhooks to receive real-time status updates
- Explore push notifications to send updates to active cards
- Review best practices for production deployments