Skip to content
Baremetrics

Create Plan

POST https://api.baremetrics.com/v1/{source_id}/plans

Create 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_id string required

    Please see Sources

Body

application/json
  • oid string required

    Your unique ID for the plan

  • name string required

    Your internal name for this plan. This will be displayed in the Plan Breakout section

  • currency string required

    The ISO code of the currency of this plan. E.G: usd

  • amount integer · int32 required

    How much is this plan? (In cents)

  • interval string required

    day, month or year

  • interval_count integer · int32 required
  • trial_duration integer · int32

    The duration of this trial. This is to be used in conjunction with trial_duration_unit

    Default 0

  • trial_duration_unit string

    This is to be used in conjunction with trial_duration

    Default "day"

Responses

200OK
{
  "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
      }
    ]
  }
}
400Bad Request
{
  "error": "Error message here"
}