The Paystack integration allows you to automatically sync customer data and trigger marketing campaigns based on payment events like successful purchases, failed payments, and subscription changes.
What You Can Do
- Automatically import customers who make payments
- Track customer lifetime value (LTV)
- Trigger welcome emails after first purchase
- Send follow-ups for failed payments
- Create segments based on purchase history
- Automate subscription renewal reminders
Setup Instructions
Step 1: Get Your Paystack API Keys
- Log into your Paystack Dashboard
- Go to Settings → API Keys & Webhooks
- Copy your Secret Key (starts with
sk_live_orsk_test_)
Keep Your Secret Key Safe
Never share your secret key or commit it to version control. Use test keys (
sk_test_) during development.Step 2: Connect in MarketSage
- Go to Settings → Integrations in MarketSage
- Find Paystack and click Connect
- Paste your Secret Key
- Click Verify & Connect
Connected!
Once connected, MarketSage will automatically start syncing your customer data. Initial sync may take a few minutes depending on your data volume.
Step 3: Configure Webhooks
To receive real-time payment events, add the MarketSage webhook URL to Paystack:
- In Paystack Dashboard, go to Settings → API Keys & Webhooks
- Under Webhook URL, enter:
https://api.marketsage.africa/webhooks/paystack/YOUR_ORG_IDFind Your Org ID
Your Organization ID is displayed in MarketSage under Settings → Integrations → Paystack after connecting.
Synced Data
The following data is automatically synced from Paystack:
| Paystack Field | MarketSage Field |
|---|---|
| customer.email | |
| customer.first_name | First Name |
| customer.last_name | Last Name |
| customer.phone | Phone |
| metadata | Custom Fields |
| total_transactions | Purchase Count |
| total_transaction_value | Lifetime Value |
Webhook Events
MarketSage listens for these Paystack events:
| Event | Use Case |
|---|---|
| charge.success | Send order confirmation, update LTV |
| charge.failed | Send payment retry email |
| subscription.create | Welcome to subscription |
| subscription.disable | Win-back campaign |
| invoice.payment_failed | Dunning email sequence |
Example Automations
First Purchase Welcome
Trigger when a customer makes their first payment:
{
"trigger": "paystack.charge.success",
"conditions": {
"purchase_count": { "equals": 1 }
},
"action": "send_email",
"template": "first-purchase-welcome"
}Troubleshooting
Customers Not Syncing
- Verify your API key is correct and has read permissions
- Check that the key is for the correct environment (live vs test)
- Try disconnecting and reconnecting the integration
Webhooks Not Received
- Verify the webhook URL is correct in Paystack dashboard
- Check that your Organization ID matches
- View webhook logs in Paystack to see delivery status