Skip to main content

Checkout API Route

server route का उपयोग करके Dodo Payments checkout को अपने Nuxt app में integrate करें।

Customer Portal API Route

Nuxt server route के माध्यम से customers को subscriptions और details manage करने की सुविधा दें।

Webhooks API Route

Nuxt में Dodo Payments webhook events को securely receive और process करें।

अवलोकन

स्थापना

Installation

1

Install the Nuxt module

अपने project root में निम्न command चलाएँ:
2

Register the module in nuxt.config.ts

अपने modules array में @dodopayments/nuxt जोड़ें और इसे configure करें:
nuxt.config.ts
अपनी .env file या secrets को version control में कभी commit न करें।

API Route Handler के उदाहरण

Nuxt में सभी Dodo Payments integrations को server/routes/api/ directory में server routes के माध्यम से handle किया जाता है।
अपने Nuxt app में Dodo Payments checkout integrate करने के लिए इस handler का उपयोग करें। यह static (GET), dynamic (POST) और session (POST) payment flows को support करता है।
यदि productId missing या invalid है, तो handler 400 response लौटाता है।

Checkout Route Handler

Dodo Payments payments को अपनी website में integrate करने के लिए तीन प्रकार के payment flows support करता है; यह adaptor सभी प्रकार के payment flows को support करता है।
  • Static Payment Links: quick, no-code payment collection के लिए तुरंत share किए जा सकने वाले URLs।
  • Dynamic Payment Links: API या SDKs का उपयोग करके custom details के साथ programmatically payment links generate करें।
  • Checkout Sessions: pre-configured product carts और customer details के साथ secure, customizable checkout experiences बनाएँ।

Supported Query Parameters

string
आवश्यक
Product identifier (उदा., ?productId=pdt_nZuwz45WAs64n3l07zpQR)।
integer
Product की quantity।
string
Customer का पूरा नाम।
string
Customer का first name।
string
Customer का last name।
string
Customer का email address।
string
Customer का country।
string
Customer की address line।
string
Customer का city।
string
Customer का state/province।
string
Customer का zip/postal code।
boolean
Full name field disable करें।
boolean
First name field disable करें।
boolean
Last name field disable करें।
boolean
Email field disable करें।
boolean
Country field disable करें।
boolean
Address line field disable करें।
boolean
City field disable करें।
boolean
State field disable करें।
boolean
Zip code field disable करें।
string
Payment currency निर्दिष्ट करें (उदा., USD)।
boolean
Currency selector दिखाएँ।
integer
Payment amount निर्दिष्ट करें (उदा., $10.00 के लिए 1000)।
boolean
Discount fields दिखाएँ।
string
metadata_ से शुरू होने वाला कोई भी query parameter metadata के रूप में pass किया जाएगा।
यदि productId missing है, तो handler 400 response लौटाता है। Invalid query parameters के परिणामस्वरूप भी 400 response मिलता है।

Response Format

Static checkout checkout URL के साथ JSON response लौटाता है:

Response Format

Dynamic checkout checkout URL के साथ JSON response लौटाता है:
Checkout sessions अधिक secure, hosted checkout experience प्रदान करते हैं, जो full customization control के साथ one-time purchases और subscriptions दोनों के लिए complete payment flow handle करता है।अधिक details और supported fields की पूरी सूची के लिए Checkout Sessions Integration Guide देखें।

Response Format

Checkout sessions checkout URL के साथ JSON response लौटाते हैं:

Customer Portal Route Handler

Customer Portal Route Handler आपको अपने Nuxt application में Dodo Payments customer portal को सहजता से integrate करने की सुविधा देता है।

Query Parameters

string
आवश्यक
Portal session के लिए customer ID (उदा., ?customer_id=cus_123)।
boolean
यदि इसे true पर set किया गया है, तो customer को portal link के साथ email भेजता है।
यदि customer_id missing है, तो 400 लौटाता है।

Webhook Route Handler

  • Method: केवल POST requests supported हैं। अन्य methods 405 लौटाते हैं।
  • Signature Verification: webhookKey का उपयोग करके webhook signature verify करता है। Verification fail होने पर 401 लौटाता है।
  • Payload Validation: Zod से validate किया जाता है। Invalid payloads के लिए 400 लौटाता है।
  • Error Handling:
    • 401: Invalid signature
    • 400: Invalid payload
    • 500: Verification के दौरान internal error
  • Event Routing: Payload type के आधार पर उपयुक्त event handler को call करता है।

Supported Webhook Event Handlers


LLM के लिए Prompt

अंतिम संशोधन 31 जुलाई 2026