SDKs & Libraries
Mobile Checkout SDKs
Environment URLs
- Test Mode:
https://test.dodopayments.com - Live Mode:
https://live.dodopayments.com
Learn more about Test Mode vs Live Mode.
Authentication
API requests require an API key, except a few public endpoints such as Activate License, Validate License, and Deactivate License. Generate one in your dashboard and include it in theAuthorization header of every request.
1
Generate an API Key
Go to Developer → API Keys in your dashboard and select Create New Key. Create the key in the mode you want to call: a test mode key works only with
https://test.dodopayments.com, and a live mode key works only with https://live.dodopayments.com. Enter a Key Name, then set None, Read, or Write access for each resource, such as Payments, Refunds, Subscriptions, Products, Customers, Webhooks, or Moderation. Write includes Read, and Payouts and Balances are read-only. Use Select all to set every resource at once.A request the key has no access for returns 403 with the INSUFFICIENT_PERMISSION error code. To change a key’s access later, use Edit Permissions on the key.Keys created before per-resource access keep their original reach: a key with write access can read and write every API resource, and a read-only key can read every API resource.
2
Store Your Key Securely
Copy the key immediately. You won’t see it again. Store it in an environment variable such as
DODO_PAYMENTS_API_KEY.3
Authenticate Requests
Include your API key in the
Authorization header of every request:Response Format
Successful requests return200 or 201 with a JSON body, or 204 with no body. Errors return a 4xx or 5xx status with a JSON body that contains a code and a message.
Rate Limits
The API enforces two limits at once: a per-second burst limit and a per-minute sustained limit. Limits apply to your business as a whole, across all of its API keys, and depend on your business’s rate limit tier.Default Tier
Higher Tiers
Businesses with increased API needs can upgrade to higher rate limits:Unauthenticated Requests
Requests without a valid API key are rate limited by IP address:Invoice Downloads
The invoice PDF endpoints, such as Get Invoice,GET /invoices/refunds/{refund_id}, and GET /invoices/payouts/{payout_id}, have their own limits:
When either limit is exceeded, the endpoint returns
429 Too Many Requests. To fetch many invoices, space out your requests.
Rate Limit Headers
Responses include headers that show your current usage:X-RateLimit-Limit— Maximum requests allowed in the current window.X-RateLimit-Remaining— Requests remaining before you hit the limit.X-RateLimit-Reset— Seconds until the current window resets.
429 Too Many Requests. Implement exponential backoff in your retry logic.