create_plan: Create a plan

View source: R/plan.R

create_planR Documentation

Create a plan

Description

Creates plan at Stripe and returns the stripe_plan object representing the plan. See the stripe_plan documentation for more details on the plan object.

Usage

create_plan(
  id,
  amount,
  currency,
  interval,
  nickname,
  interval_count = NULL,
  metadata = list(),
  product = NULL,
  trial_period_days = NULL
)

Arguments

id

The id of plan to create

amount

The amount of the plan in cents. So a $4.99 plan is 499

currency

The currency for the amount

interval

One of day, week, month or year. The frequency with which a subscription should be billed.

interval_count

The number of intervals (specified in the interval property) between each subscription billing. For example, interval = month and interval_count = 3 bills every 3 months

metadata

A set of key/value pairs that you can attach to a plan object. It can be useful for storing additional information about the plan in a structured format. This will be unset if you specify NULL.

trial_period_days

Number of trial period days granted when subscribing a customer to this plan. NULL if the plan has no trial period

name

Display name of the plan

statement_descriptor

An arbitrary string to be displayed on your customer's credit card statement. This may be up to 22 characters

Examples

# Create Test Plan 1 with a monthly charge of $9.99
new_plan <- create_plan(id = "testPlan1", name = "Test Plan 1", amount = 999,
                        currency = "usd", interval = "month")


MrDAndersen/stRipe documentation built on March 17, 2024, 7:25 p.m.