Introduction
Automatically sync your paying customers to MailerLite subscriber lists when payment events occur. Add customers to specific groups, trigger automation workflows, and keep your email marketing lists up-to-date with real payment data. MailerLite is a powerful email marketing platform for newsletters, campaigns, and automations. This integration helps you automatically manage subscribers based on payment activity - perfect for onboarding sequences, customer segmentation, and targeted marketing campaigns.This integration requires your MailerLite API Key for authentication. You can generate one from your MailerLite Integrations page.
Getting Started
1
Open the Webhook Section
In your Dodo Payments dashboard, navigate to Webhooks + Add Endpoint and expand the integrations dropdown.

2
Select MailerLite
Choose the MailerLite integration card.
3
Enter API Key
Provide your MailerLite API Key in the configuration.
4
Configure Transformation
Edit the transformation code to format subscriber data for MailerLite’s API.
5
Test & Create
Test with sample payloads and click Create to activate the subscriber sync.
6
Done!
Payment events will now automatically sync customers to your MailerLite lists.
Transformation Code Examples
Add Customer on Successful Payment
add_customer.js
Add Subscriber to Multiple Groups Based on Product
product_segmentation.js
Add New Subscriber on Subscription Activation
subscription_subscriber.js
Update Subscriber on Subscription Cancellation
subscription_cancelled.js
Add Customer with Custom Fields
custom_fields.js
Trigger Automation via Event
trigger_automation.js
Tips
- Create custom fields in MailerLite before using them in your transformations
- Use groups to segment customers by product, plan tier, or purchase behavior
- Set up automation workflows in MailerLite that trigger on field updates
- Use the upsert behavior (POST to /subscribers) to avoid duplicate subscriber errors
- Store payment metadata in custom fields for better customer insights
- Test with a small group before enabling for all payments
Custom Fields Setup
Before using custom fields, you need to create them in MailerLite:- Go to your MailerLite dashboard
- Navigate to Subscribers Fields
- Click Create field and add fields like:
total_spent(Number)customer_since(Date)subscription_plan(Text)payment_method(Text)last_payment_amount(Number)
Troubleshooting
Subscribers not being added
Subscribers not being added
- Verify API Key is correct and active
- Check that the email address is valid (RFC 2821 compliant)
- Ensure group IDs are correct and exist in your account
- Note: Unsubscribed, bounced, or junk subscribers cannot be reactivated via API
Custom fields not updating
Custom fields not updating
- Verify custom fields exist in MailerLite before using them
- Check that field names match exactly (case-sensitive)
- Ensure field values match the expected type (text, number, date)
Rate limit errors
Rate limit errors
- MailerLite API has a rate limit of 120 requests per minute
- Use batch endpoints if processing many subscribers
- Implement backoff strategies for high-volume scenarios
Group assignment not working
Group assignment not working
- Verify group IDs are numeric strings
- Check that groups exist in your MailerLite account
- Note: Using PUT with groups will remove subscriber from unlisted groups
API Reference
MailerLite Subscribers API accepts the following key parameters:| Parameter | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Valid email address (RFC 2821) |
fields | object | No | Object with field name/value pairs |
fields.name | string | No | Subscriber’s first name |
fields.last_name | string | No | Subscriber’s last name |
fields.company | string | No | Company name |
fields.country | string | No | Country |
fields.city | string | No | City |
fields.phone | string | No | Phone number |
groups | array | No | Array of group IDs to add subscriber to |
status | string | No | One of: active, unsubscribed, unconfirmed, bounced, junk |
subscribed_at | string | No | Date in format yyyy-MM-dd HH:mm:ss |
ip_address | string | No | Subscriber’s IP address |