POST
/
plans
curl --request POST \
  --url https://sandbox-api.billingrails.com/v1/plans \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "status": "active",
  "name": "<string>",
  "code": "<string>",
  "description": "<string>",
  "trial_period_days": 123,
  "currency": "<string>",
  "fees": [
    {
      "meter_id": "<string>",
      "plan_id": "<string>",
      "name": "<string>",
      "code": "<string>",
      "description": "<string>",
      "invoice_name": "<string>",
      "model": "standard",
      "currency": "<string>",
      "interval": {
        "unit": "day",
        "frequency": 2
      },
      "billing_cycles": 2,
      "amount": 1,
      "package_size": 3,
      "unit_label": "<string>"
    }
  ]
}'
{
  "plan": {
    "object": "plan",
    "id": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "status": "active",
    "name": "<string>",
    "code": "<string>",
    "description": "<string>",
    "trial_period_days": 123,
    "currency": "<string>",
    "has_metered_fees": true,
    "fees": [
      {
        "object": "fee",
        "id": "fee_IhMUl3rrZ3",
        "created_at": "2025-02-14T17:33:40.843Z",
        "type": "plan",
        "meter_id": "meter_IhMUl3rrZ3",
        "plan_id": "plan_IhMUl3rrZ3",
        "name": "Basic Plan",
        "code": "basic_plan",
        "description": "Basic plan for users",
        "invoice_name": "Basic Plan",
        "model": "standard",
        "currency": "NGN",
        "bill_timing": "advance",
        "interval": {
          "unit": "month",
          "frequency": 1
        },
        "billing_cycles": 1,
        "amount": 1000,
        "package_size": 2,
        "unit_label": "user",
        "free_units": 0,
        "active_subscriptions": 5
      }
    ]
  }
}

Authorizations

Authorization
string
header
required

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

Body

application/json

Plan payload

The body is of type object.

Response

200 - application/json

Plan created

The response is of type object.