Skip to main content
POST
/
api
/
billing
/
subscribe
Subscribe to Plan
curl --request POST \
  --url https://api.example.com/api/billing/subscribe \
  --header 'Content-Type: application/json' \
  --header 'X-Organization-Id: <x-organization-id>' \
  --data '
{
  "plan": "<string>"
}
'
{
  "checkout_url": "https://checkout.dodopayments.com/pay/cs_def456",
  "session_id": "cs_def456",
  "plan": "pro",
  "price": 79.0
}
Initiate a subscription upgrade or creation for your organization. This generates a checkout session for a recurring billing plan.

Request

X-Organization-Id
string
required
The unique identifier of the organization.
plan
string
required
The name of the target plan. Valid options include pro and enterprise. Note that upgrading to enterprise requires contacting the sales team.

Response

checkout_url
string
The URL to redirect the user to complete their subscription via Dodo Payments.
session_id
string
The unique identifier of the checkout session.
plan
string
The plan name requested.
price
number
The monthly price of the requested plan.
{
  "checkout_url": "https://checkout.dodopayments.com/pay/cs_def456",
  "session_id": "cs_def456",
  "plan": "pro",
  "price": 79.0
}