Skip to content

Latest commit

 

History

History
135 lines (90 loc) · 2.82 KB

File metadata and controls

135 lines (90 loc) · 2.82 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}

Synchronous Client

from os import getenv
from sideko_stripe import Stripe

client = Stripe(token=getenv("API_TOKEN"))
res = client.plan.delete(plan="string")

Asynchronous Client

from os import getenv
from sideko_stripe import AsyncStripe

client = AsyncStripe(token=getenv("API_TOKEN"))
res = await client.plan.delete(plan="string")

list

List all plans

Returns a list of your plans.

API Endpoint: GET /v1/plans

Synchronous Client

from os import getenv
from sideko_stripe import Stripe

client = Stripe(token=getenv("API_TOKEN"))
res = client.plan.list()

Asynchronous Client

from os import getenv
from sideko_stripe import AsyncStripe

client = AsyncStripe(token=getenv("API_TOKEN"))
res = await client.plan.list()

get

Retrieve a plan

Retrieves the plan with the given ID.

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

Synchronous Client

from os import getenv
from sideko_stripe import Stripe

client = Stripe(token=getenv("API_TOKEN"))
res = client.plan.get(plan="string")

Asynchronous Client

from os import getenv
from sideko_stripe import AsyncStripe

client = AsyncStripe(token=getenv("API_TOKEN"))
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

Synchronous Client

from os import getenv
from sideko_stripe import Stripe

client = Stripe(token=getenv("API_TOKEN"))
res = client.plan.create(currency="string", interval="day")

Asynchronous Client

from os import getenv
from sideko_stripe import AsyncStripe

client = AsyncStripe(token=getenv("API_TOKEN"))
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}

Synchronous Client

from os import getenv
from sideko_stripe import Stripe

client = Stripe(token=getenv("API_TOKEN"))
res = client.plan.update(plan="string")

Asynchronous Client

from os import getenv
from sideko_stripe import AsyncStripe

client = AsyncStripe(token=getenv("API_TOKEN"))
res = await client.plan.update(plan="string")