Dodo Payments
Integrate GoPayLocal with Dodo Payments for automatic PPP discounts.
Dodo Payments is GoPayLocal’s recommended payment provider. As a Merchant of Record (MoR), Dodo handles tax compliance, allowing you to focus on your product.
-
Get your Dodo API key
Log in to the Dodo Payments dashboard and go to API Keys. Copy your API key.
For testing, use the test mode key (available in the Dodo dashboard under test mode toggle).
-
Connect in GoPayLocal
Go to your GoPayLocal dashboard > Settings > Integrations > Dodo Payments and click Connect. Enter your API key in the dialog and optionally provide an account ID.
Click Test after connecting to verify your credentials are valid.
-
Import products (optional)
After connecting, you can import your existing Dodo products into GoPayLocal. Go to the integration settings and use Sync Products to pull your product catalog. Prices are automatically converted from Dodo’s minor units (cents) to standard currency amounts.
-
Create a campaign
Create or edit a campaign and select Dodo Payments as the payment provider. When you activate the campaign, GoPayLocal automatically creates discount codes in your Dodo account based on your pricing mode:
- Group mode: Uses your parity group percentages
- PPP Factor mode: Calculates discounts from PPP multipliers
- Custom mode: Uses your per-country overrides
-
Verify discount codes
Check your Dodo Payments dashboard > Discounts to see the auto-created codes.
How Discounts Work
Section titled “How Discounts Work”GoPayLocal creates percentage-based discounts in Dodo Payments via their API:
{ "code": "PPP-INDIA-30", "type": "percentage", "amount": 30, "product_id": "prod_xxx"}When a visitor copies the code and applies it at Dodo’s checkout, the discount is validated and applied.
Auto-Apply
Section titled “Auto-Apply”Dodo Payments supports auto-applying discounts via the discount_code parameter in checkout sessions:
// When creating a Dodo checkout session on your serverconst session = await dodo.checkoutSessions.create({ product_id: 'prod_xxx', discount_code: 'PPP-INDIA-30', // Auto-applied success_url: 'https://yoursite.com/success', cancel_url: 'https://yoursite.com/cancel',});To use auto-apply, enable it in your campaign settings and configure your checkout flow to pass the coupon code from the GoPayLocal API response.
Test Mode
Section titled “Test Mode”Dodo Payments provides a full test mode environment:
- Use test API keys
- Create test products and discounts
- Process test payments without real charges
- Webhooks fire in test mode
Set environment: 'test_mode' in the GoPayLocal integration settings.
Webhooks
Section titled “Webhooks”GoPayLocal automatically receives webhooks from Dodo Payments at https://api.gopaylocal.com/v1/webhooks/dodo. The following events are processed:
| Event | What GoPayLocal does |
|---|---|
payment.succeeded | Tracks discount code redemptions and updates analytics (impressions, revenue saved) |
subscription.created | Creates subscription record, links to your organization |
subscription.updated | Updates plan, status, and billing period |
subscription.canceled | Marks subscription as canceled |
subscription.expired | Marks subscription as expired |
payment.failed | Marks subscription as past due |
All webhooks are verified using HMAC-SHA256 signatures and deduplicated to prevent double-processing.
Limitations
Section titled “Limitations”- Discount codes are scoped to specific products (not store-wide)
- Maximum 100 active discount codes per product
- Test mode and live mode use separate API keys