Skip to main content
POST
/
api
/
v1
/
subscriptions
/
plans
Create a subscription plan
curl --request POST \
  --url http://localhost:7701/api/v1/subscriptions/plans \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "name": "Basic Monthly",
  "amount": 2990,
  "interval": "monthly",
  "description": "Access to all basic features.",
  "currency": "BRL",
  "interval_count": 1,
  "trial_period_days": 7,
  "billing_day": 5
}
'
{
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "Basic Monthly",
    "description": "<string>",
    "amount": 2990,
    "currency": "BRL",
    "interval": "monthly",
    "interval_count": 1,
    "trial_period_days": 7,
    "billing_day": 5,
    "is_active": true,
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z"
  }
}

Authorizations

X-API-Key
string
header
required

Company API key. Send in the X-API-Key header.

Body

application/json
name
string
required

Display name for the plan (max 255 chars).

Example:

"Basic Monthly"

amount
integer
required

Plan price in cents (e.g. 2990 = R$29,90).

Example:

2990

interval
enum<string>
required

Billing frequency.

Available options:
weekly,
monthly,
yearly
Example:

"monthly"

description
string | null

Optional description (max 1000 chars).

Example:

"Access to all basic features."

currency
string | null

3-letter ISO currency code. Defaults to BRL.

Example:

"BRL"

interval_count
integer | null

Number of intervals between charges (e.g. 3 + monthly = every 3 months). Min 1, max 365.

Example:

1

trial_period_days
integer | null

Free trial days before first charge (1–365).

Example:

7

billing_day
integer | null

Day of the month to charge (1–28). Defaults to the subscription creation day.

Example:

5

Response

Plan created

data
object