Skip to main content
POST

Endpoint

Authentication

Requires a valid API key with billing:write scope.

Request Body

No request body required.

Response

Returns a Dodo Payments billing portal URL.
url
string
Dodo Payments billing portal URL to redirect user to

Errors

401
error
Unauthorized - Missing or invalid API key
404
error
Not Found - User has no billing customer ID (never subscribed)
500
error
Internal Server Error - Failed to create Dodo Payments portal session

How It Works

Portal Flow:
  1. API Call: Client requests portal session
  2. Customer Lookup: System finds user’s Dodo Payments customer ID
  3. Session Creation: Dodo Payments portal session created with return URL
  4. Redirect: User redirected to Dodo Payments portal
  5. Self-Service: User manages subscription on Dodo Payments
  6. Return: User clicks “Return to…” and comes back to app
Return URL: https://www.wiseyield.co/dashboard/billing Customer Requirement: User must have subscribed at least once. If no subscription history exists, returns 404 error.

Customer Portal Features

Dodo Payments portal allows users to:

Subscription Management

  • Change subscription plan (upgrade/downgrade)
  • Cancel subscription
  • Resume canceled subscription
  • View upcoming invoice

Payment Methods

  • Update credit card
  • Add new payment method
  • Set default payment method
  • Remove old payment methods

Billing History

  • View all past invoices
  • Download invoice PDFs
  • See payment history

Contact Information

  • Update billing email
  • Update billing address
  • Update tax ID

Use Cases

Open Billing Portal

Manage Subscription Button

Check Before Opening Portal

Best Practices

Check Subscription First: Verify user has subscription before showing “Manage Billing” button.
Loading State: Show loading indicator while creating portal session.
Return URL Handling: Portal returns to /dashboard/billing. Ensure this page shows updated subscription data.
New Tab Option: Consider opening portal in new tab to prevent losing app state.
No Subscription = 404: Users who never subscribed will get 404 error. Handle this gracefully.
Portal URL Expires: Portal session URLs expire after a short time. Create new session each time.
Changes Apply Immediately: Subscription changes in portal take effect immediately via webhooks.

Integration Examples

Billing Settings Page

Portal Button with Confirmation

Portal in New Tab

Portal Return Handling