SDKs & Libraries
TypeScript, Python, Go, PHP, Java, Kotlin, C#, Ruby और Rust के लिए आधिकारिक backend SDKs। ये libraries authentication, serialization और error handling संभालती हैं, ताकि आप अपने integration पर ध्यान केंद्रित कर सकें।
Mobile Checkout SDKs
Android, iOS, React Native और Flutter apps से Dodo का hosted checkout खोलें और एक ही call में typed result प्राप्त करें। इन SDKs में कोई API key नहीं होती।
Environment URLs
- Test Mode:
https://test.dodopayments.com - Live Mode:
https://live.dodopayments.com
Test Mode बनाम Live Mode के बारे में अधिक जानें।
Authentication
सभी API requests के लिए API key आवश्यक है। अपने dashboard में एक key generate करें और प्रत्येक request केAuthorization header में इसे शामिल करें।
1
Generate an API Key
अपने dashboard में Developer → API Keys पर जाएँ और Add API Key चुनें। जिस mode में call करना चाहते हैं, उसी mode में key बनाएँ: test mode key केवल
https://test.dodopayments.com के साथ काम करती है, और live mode key केवल https://live.dodopayments.com के साथ काम करती है। key को एक स्पष्ट नाम दें और अपना access level चुनें:- Enable write access चयनित (default): सभी API operations के लिए पूर्ण read और write permissions।
- Enable write access अचयनित: केवल read access। आप data (payments, subscriptions, customers, products) fetch कर सकते हैं, लेकिन resources create या modify नहीं कर सकते।
2
Store Your Key Securely
key को तुरंत copy करें। आप इसे दोबारा नहीं देख पाएँगे। इसे
DODO_PAYMENTS_API_KEY जैसे environment variable में store करें।3
Authenticate Requests
प्रत्येक request के
Authorization header में अपनी API key शामिल करें:Response Format
सफल requests JSON body के साथ200 या 201 लौटाती हैं, या बिना body के 204 लौटाती हैं। Errors JSON body के साथ 4xx या 5xx status लौटाती हैं, जिसमें एक code और एक message होता है।
Rate Limits
API एक साथ दो limits लागू करती है: प्रति सेकंड burst limit और प्रति मिनट sustained limit। Limits आपके पूरे business पर, उसकी सभी API keys के across लागू होती हैं और आपके business के rate limit tier पर निर्भर करती हैं।Default Tier
Higher Tiers
जिन businesses को API की अधिक आवश्यकता है, वे higher rate limits में upgrade कर सकते हैं:Unauthenticated Requests
मान्य API key के बिना requests IP address द्वारा rate limited होती हैं:Rate Limit Headers
Responses में ऐसे headers शामिल होते हैं जो आपका current usage दिखाते हैं:X-RateLimit-Limit— current window में अनुमत अधिकतम requests।X-RateLimit-Remaining— limit तक पहुँचने से पहले शेष requests।X-RateLimit-Reset— current window reset होने तक के seconds।
429 Too Many Requests लौटाती है। अपनी retry logic में exponential backoff लागू करें।
Error Handling
किसी error का अर्थ और उसे resolve करने का तरीका जानने के लिए error codes और transaction failures pages देखें।Error Codes
सभी error codes और उनके अर्थों की पूरी सूची।
Transaction Failures
सामान्य transaction issues और उन्हें संभालने का तरीका।
Webhooks
जब payments, subscriptions और अन्य events होते हैं, तब real-time notifications प्राप्त करें। अपने dashboard में webhooks सेट अप करें और अपने integration के लिए आवश्यक events संभालें।Webhook Guide
Webhooks सेट अप करें, events संभालें और signatures verify करें।
Integration Guides
अपना पहला integration बनाने के लिए इनमें से किसी एक guide से शुरुआत करें:One-time Payments
checkout sessions और payment links बनाएँ, और payments संभालें।
Subscriptions
recurring billing सेट अप करें, plans manage करें और lifecycle events संभालें।
Usage-Based Billing
usage को meter करें और consumption के आधार पर customers से charge करें।
Checkout Sessions
secure, hosted checkout experiences बनाएँ।