Search documentation of tiger_stripe

# Stripe.Services.SubscriptionScheduleService (tiger_stripe v0.1.1)

Copy Markdown View Source

SubscriptionSchedule

A subscription schedule allows you to create and manage the lifecycle of a subscription by predefining expected changes.

Related guide: Subscription schedules

## Summary

### Functions

cancel(client, schedule, params \\ %{}, opts \\ [])

Cancel a schedule

create(client, params \\ %{}, opts \\ [])

Create a schedule

list(client, params \\ %{}, opts \\ [])

List all schedules

release(client, schedule, params \\ %{}, opts \\ [])

Release a schedule

retrieve(client, schedule, params \\ %{}, opts \\ [])

Retrieve a schedule

update(client, schedule, params \\ %{}, opts \\ [])

Update a schedule

## Functions

# cancel(client, schedule, params \\ %{}, opts \\ [])

    @spec cancel(Stripe.Client.t(), String.t(), map(), keyword()) ::
      {:ok, term()} | {:error, Stripe.Error.t()}

Cancel a schedule

Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is `not_started` or `active`.

# create(client, params \\ %{}, opts \\ [])

    @spec create(Stripe.Client.t(), map(), keyword()) ::
      {:ok, term()} | {:error, Stripe.Error.t()}

Create a schedule

Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions.

# list(client, params \\ %{}, opts \\ [])

    @spec list(Stripe.Client.t(), map(), keyword()) ::
      {:ok, term()} | {:error, Stripe.Error.t()}

List all schedules

Retrieves the list of your subscription schedules.

# release(client, schedule, params \\ %{}, opts \\ [])

    @spec release(Stripe.Client.t(), String.t(), map(), keyword()) ::
      {:ok, term()} | {:error, Stripe.Error.t()}

Release a schedule

Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is `not_started` or `active`. If the subscription schedule is currently associated with a subscription, releasing it will remove its `subscription` property and set the subscription’s ID to the `released_subscription` property.

# retrieve(client, schedule, params \\ %{}, opts \\ [])

    @spec retrieve(Stripe.Client.t(), String.t(), map(), keyword()) ::
      {:ok, term()} | {:error, Stripe.Error.t()}

Retrieve a schedule

Retrieves the details of an existing subscription schedule. You only need to supply the unique subscription schedule identifier that was returned upon subscription schedule creation.

# update(client, schedule, params \\ %{}, opts \\ [])

    @spec update(Stripe.Client.t(), String.t(), map(), keyword()) ::
      {:ok, term()} | {:error, Stripe.Error.t()}

Update a schedule

Updates an existing subscription schedule.