POST
/
subscriptions

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request payload for creating a new subscription

This struct represents the data required to create a new subscription in the system. It includes details about the product, quantity, customer information, and billing details.

billing
object
required
customer
object
required
product_id
string
required

Unique identifier of the product to subscribe to

quantity
integer
required

Number of units to subscribe for. Must be at least 1.

Required range: x > 0
metadata
object

If true, generates a payment link. Defaults to false if not specified.

return_url
string | null

Optional URL to redirect after successful subscription creation

trial_period_days
integer | null

Optional trial period in days If specified, this value overrides the trial period set in the product's price Must be between 0 and 10000 days

Response

200 - application/json
customer
object
required
metadata
object
required
recurring_pre_tax_amount
integer
required

Tax will be added to the amount and charged to the customer on each billing cycle

Required range: x > 0
subscription_id
string
required

Unique identifier for the subscription

client_secret
string | null

Client secret used to load Dodo checkout SDK NOTE : Dodo checkout SDK will be coming soon

URL to checkout page