Back

Complete Workflow

End-to-end example: Create campaign and send wallet cards

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:

POST
/campaigns
Required scope: campaigns:write

Create 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:

POST
/campaigns/{campaignId}/recipients
Required scope: campaigns:write

Add 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:

POST
/campaigns/{campaignId}/recipients/{recipientId}/invite
Required scope: campaigns:write

Send 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