Skip to main content
POST

Endpoint

Authentication

Requires a valid API key with billing:write scope.

Request Body

priceId
string
required
Dodo Payments product ID for the subscription plan (e.g., dodo_pay_...)
plan
string
required
Plan name: seed, sprout, harvest, grove, summit

Response

Returns a Dodo Payments checkout session URL.
url
string
Dodo Payments checkout page URL to redirect user to

Errors

400
error
Bad Request - Missing required fields (priceId or plan)
401
error
Unauthorized - Missing or invalid API key
500
error
Internal Server Error - Failed to create Dodo Payments checkout session

How It Works

Checkout Flow:
  1. API Call: Client sends priceId and plan name
  2. Customer Creation: If first subscription, creates Dodo Payments customer
  3. Session Creation: Dodo Payments checkout session created with:
    • Subscription mode
    • Card payment method
    • Success/cancel redirect URLs
    • User metadata
  4. Redirect: User redirected to Dodo Payments checkout page
  5. Payment: User enters payment details on Dodo Payments
  6. Webhook: Dodo Payments sends webhook to create subscription in database
  7. Redirect Back: User redirected to success URL
Redirect URLs:
  • Success: https://www.wiseyield.co/dashboard/billing?success=true
  • Cancel: https://www.wiseyield.co/pricing?canceled=true
Dodo Customer:
  • First checkout creates Dodo Payments customer
  • Customer ID stored in users.dodoCustomerId
  • Subsequent checkouts reuse same customer

Subscription Plans & Pricing

Seed Plan

  • Price: €22/month
  • Features:
    • 1 farm
    • 50 AI requests/month
    • Email support
    • Basic analytics
  • Price ID: Contact support for production price IDs

Sprout Plan

  • Price: €49/month
  • Features:
    • 3 farms
    • 200 AI requests/month
    • Team collaboration (5 members)
    • Farm budgeting
  • Price ID: Contact support for production price IDs

Harvest Plan

  • Price: €89/month (recommended)
  • Features:
    • 7 farms
    • 500 AI requests/month
    • Vision AI Full (50 scans/mo)
    • Market Intelligence (20 queries/mo)
  • Price ID: Contact support for production price IDs

Grove Plan

  • Price: €149/month
  • Features:
    • 15 farms
    • 1,000 AI requests/month
    • Financial AI Insights
    • P&L reports, invoices
  • Price ID: Contact support for production price IDs

Summit Plan

  • Price: €299+/month (enterprise)
  • Features:
    • Unlimited farms
    • Unlimited AI requests
    • Dedicated support
    • API access
    • SLA guarantee
  • Price ID: Contact support for production price IDs

Use Cases

Start Subscription Checkout

Upgrade Plan

Choose Plan with Price Selector

Handle Checkout Success

Best Practices

Store Product IDs: Keep Dodo Payments product IDs in environment variables for easy updates.
Show Confirmation: Display pricing and features before redirecting to checkout.
Handle Success: Check for ?success=true query param on return URL to show confirmation.
Loading State: Show loading indicator while creating checkout session.
Don’t Hardcode Prices: Use Dodo Payments product IDs from environment variables to support different pricing in development/production.
Test Mode: Dodo Payments checkout runs in test mode if using test API keys. Use test cards for development.
Webhook Required: Subscription won’t activate without webhook endpoint configured. Ensure /api/webhooks/dodo is set up.

Integration Examples

Pricing Page Component

Upgrade Button Component