Create Plan
https://api.baremetrics.com/v1/{source_id}/plansCreate a plan for use when creating or updating subscriptions.
Trials
When creating a subscription with a plan that has a trial, only the first plan will trigger a trial.
For example, if you create a subscription on Plan A, which has a 7 day trial, and then on day 2 you switch them to Plan B, the trial will continue until day 7, at which point they will become a paying customer on Plan B.
Path parameters
source_idstring requiredPlease see Sources
Body
application/jsonoidstring requiredYour unique ID for the plan
namestring requiredYour internal name for this plan. This will be displayed in the Plan Breakout section
currencystring requiredThe ISO code of the currency of this plan. E.G: usd
amountinteger · int32 requiredHow much is this plan? (In cents)
intervalstring requiredday, month or year
interval_countinteger · int32 requiredtrial_durationinteger · int32The duration of this trial. This is to be used in conjunction with trial_duration_unit
Default
0trial_duration_unitstringThis is to be used in conjunction with trial_duration
Default
"day"
Responses
{
"plan": {
"oid": "plan_2",
"source_id": "123",
"source": "baremetrics",
"name": "Plan 2",
"interval": "year",
"interval_count": 1,
"trial_duration": null,
"trial_duration_unit": null,
"created": null,
"active": true,
"setup_fees": 0,
"amounts": [
{
"currency": "USD",
"symbol": "$",
"symbol_right": false,
"amount": 450000
}
]
}
}{
"error": "Error message here"
}