API Integrations
Connect VoucherTrack to your email/SMS platform via API
VoucherTrack provides APIs to integrate with any email or SMS platform. Upload your recipient list, get unique voucher codes for each, and track opens, clicks, and redemptions.
Authentication
All API requests require your API key. Find it in your dashboard under Settings, or ask your admin.
GET /api/integrations/webhooks?api_key=YOUR_API_KEY
Recipient Upload Workflow
The typical workflow for email/SMS campaigns:
- Upload recipients — POST your contact list with email/mobile/name
- Get voucher codes — Each recipient gets a unique code and redemption URL
- Send via your platform — Use mail merge to insert codes into emails/SMS
- Track engagement — Export recipients to see opens, clicks, redemptions
POST /api/integrations/campaigns/{campaign_id}/recipients
Upload recipients and generate voucher codes in one request. Max 10,000 per request.
POST /api/integrations/campaigns/{campaign_id}/recipients?api_key=xxx
{
"recipients": [
{
"email": "john@example.com",
"forename": "John",
"surname": "Doe",
"mobile": "07700900000",
"postcode": "SW1A 1AA",
"external_id": "CRM-12345"
},
{
"email": "jane@example.com",
"forename": "Jane"
}
],
"discount_type": "fixed",
"discount_value": 10,
"code_prefix": "JAN26"
}
Response:
{
"success": true,
"total_created": 2,
"recipients": [
{
"recipient_id": "uuid...",
"voucher_id": "uuid...",
"voucher_code": "JAN26-X7K3M2",
"redemption_url": "https://v.easydm.co/redeem/JAN26-X7K3M2",
"qr_code_url": "data:image/png;base64,...",
"email": "john@example.com",
"external_id": "CRM-12345"
},
...
]
}
GET /api/integrations/campaigns/{campaign_id}/recipients/export
Export all recipients with their voucher codes, perfect for mail merge.
Returns CSV with columns: email, forename, voucher_code, redemption_url, redeemed, opened_at, clicked_at
Outbound Webhooks
Get real-time notifications when events happen (lead captured, voucher redeemed, etc.). Perfect for Zapier, Make, or custom integrations.
Available Events
| Event | Description |
|---|---|
| voucher.created | A new voucher code was generated |
| voucher.redeemed | A voucher was redeemed by staff |
| lead.captured | Someone claimed a voucher via landing page |
| referral.converted | A shared offer was claimed |
Creating a Webhook
POST /api/integrations/webhooks?api_key=xxx
{
"name": "Zapier - New Leads",
"url": "https://hooks.zapier.com/hooks/catch/123/abc",
"events": ["lead.captured", "voucher.redeemed"]
}
Webhook Payload
Each webhook delivery includes a signature for verification:
Headers:
X-VoucherTrack-Signature: sha256=abc123...
X-VoucherTrack-Event: lead.captured
Body:
{
"event": "lead.captured",
"timestamp": "2026-02-01T12:00:00Z",
"data": {
"lead_id": "uuid...",
"email": "customer@example.com",
"voucher_code": "MARIO-X7K3M2",
"campaign_name": "Summer Sale"
}
}
Email Tracking Webhooks (Inbound)
If your email platform supports webhooks, you can send open/click data back to VoucherTrack:
# When email is opened POST /api/integrations/tracking/email-opened?recipient_id=uuid # When link is clicked POST /api/integrations/tracking/email-clicked?recipient_id=uuid # If email bounces POST /api/integrations/tracking/email-bounced?recipient_id=uuid
The recipient_id is returned when you upload recipients.
Mail Merge Example (Mailchimp)
Your exclusive voucher code is: *|VOUCHER_CODE|*
Click here to view your voucher
Or show this QR code:
<img src="*|QR_CODE_URL|*">
Export your recipients as CSV, import to Mailchimp, and use merge tags to insert the voucher details.
Rate Limits
| Endpoint | Limit |
|---|---|
| Recipient upload | 10 requests/minute, 10,000 recipients/request |
| Export | 60 requests/minute |
| Webhooks CRUD | 100 requests/minute |