Skip to content

Latest commit

 

History

History
80 lines (50 loc) · 2 KB

File metadata and controls

80 lines (50 loc) · 2 KB

delete

Delete a plan

Deleting plans means new subscribers can’t be added. Existing subscribers aren’t affected.

API Endpoint: DELETE /v1/plans/{plan}

Example Snippet

import Stripe from "@sideko-inc/stripe";

const client = new Stripe({ token: process.env["API_TOKEN"]!! });
const res = await client.plan.delete({ plan: "string" });

list

List all plans

Returns a list of your plans.

API Endpoint: GET /v1/plans

Example Snippet

import Stripe from "@sideko-inc/stripe";

const client = new Stripe({ token: process.env["API_TOKEN"]!! });
const res = await client.plan.list();

get

Retrieve a plan

Retrieves the plan with the given ID.

API Endpoint: GET /v1/plans/{plan}

Example Snippet

import Stripe from "@sideko-inc/stripe";

const client = new Stripe({ token: process.env["API_TOKEN"]!! });
const res = await client.plan.get({ plan: "string" });

create

Create a plan

You can now model subscriptions more flexibly using the Prices API. It replaces the Plans API and is backwards compatible to simplify your migration.

API Endpoint: POST /v1/plans

Example Snippet

import Stripe from "@sideko-inc/stripe";

const client = new Stripe({ token: process.env["API_TOKEN"]!! });
const res = await client.plan.create({ currency: "string", interval: "day" });

update

Update a plan

Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan’s ID, amount, currency, or billing cycle.

API Endpoint: POST /v1/plans/{plan}

Example Snippet

import Stripe from "@sideko-inc/stripe";

const client = new Stripe({ token: process.env["API_TOKEN"]!! });
const res = await client.plan.update({ plan: "string" });