Package com.stripe.model
Class SubscriptionSchedule
java.lang.Object
com.stripe.model.StripeObject
com.stripe.net.ApiResource
com.stripe.model.SubscriptionSchedule
- All Implemented Interfaces:
HasId
,MetadataStore<SubscriptionSchedule>
,StripeActiveObject
,StripeObjectInterface
public class SubscriptionSchedule
extends ApiResource
implements HasId, MetadataStore<SubscriptionSchedule>
A subscription schedule allows you to create and manage the lifecycle of a subscription by
predefining expected changes.
Related guide: Subscription schedules
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
static class
A phase describes the plans, coupon, and trialing status of a subscription for a predefined time period.Nested classes/interfaces inherited from class com.stripe.net.ApiResource
ApiResource.RequestMethod
-
Field Summary
Fields inherited from class com.stripe.net.ApiResource
CHARSET, GSON, INTERNAL_GSON
Fields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncancel()
Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription).cancel
(RequestOptions options) Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription).Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription).cancel
(SubscriptionScheduleCancelParams params, RequestOptions options) Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription).Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription).cancel
(Map<String, Object> params, RequestOptions options) Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription).protected boolean
static SubscriptionSchedule
Creates a new subscription schedule object.static SubscriptionSchedule
create
(SubscriptionScheduleCreateParams params, RequestOptions options) Creates a new subscription schedule object.static SubscriptionSchedule
Creates a new subscription schedule object.static SubscriptionSchedule
create
(Map<String, Object> params, RequestOptions options) Creates a new subscription schedule object.boolean
Get ID of expandableapplication
object.Get expandedapplication
.Time at which the subscription schedule was canceled.Time at which the subscription schedule was completed.Time at which the object was created.Object representing the start and end dates for the current phase of the subscription schedule, if it isactive
.Get ID of expandablecustomer
object.Get expandedcustomer
.Behavior of the subscription schedule and underlying subscription when it ends.getId()
Unique identifier for the object.Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode.Set of key-value pairs that you can attach to an object.String representing the object's type.Configuration for the subscription schedule's phases.Time at which the subscription schedule was released.ID of the subscription once managed by the subscription schedule (if it is released).The present status of the subscription schedule.Get ID of expandablesubscription
object.Get expandedsubscription
.Get ID of expandabletestClock
object.Get expandedtestClock
.int
hashCode()
list
(SubscriptionScheduleListParams params) Retrieves the list of your subscription schedules.list
(SubscriptionScheduleListParams params, RequestOptions options) Retrieves the list of your subscription schedules.Retrieves the list of your subscription schedules.list
(Map<String, Object> params, RequestOptions options) Retrieves the list of your subscription schedules.release()
Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place.release
(RequestOptions options) Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place.Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place.release
(SubscriptionScheduleReleaseParams params, RequestOptions options) Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place.Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place.release
(Map<String, Object> params, RequestOptions options) Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place.static SubscriptionSchedule
Retrieves the details of an existing subscription schedule.static SubscriptionSchedule
retrieve
(String schedule, RequestOptions options) Retrieves the details of an existing subscription schedule.static SubscriptionSchedule
retrieve
(String schedule, SubscriptionScheduleRetrieveParams params, RequestOptions options) Retrieves the details of an existing subscription schedule.static SubscriptionSchedule
Retrieves the details of an existing subscription schedule.void
setApplication
(String id) void
setApplicationObject
(Application expandableObject) void
setCanceledAt
(Long canceledAt) Time at which the subscription schedule was canceled.void
setCompletedAt
(Long completedAt) Time at which the subscription schedule was completed.void
setCreated
(Long created) Time at which the object was created.void
setCurrentPhase
(SubscriptionSchedule.CurrentPhase currentPhase) Object representing the start and end dates for the current phase of the subscription schedule, if it isactive
.void
setCustomer
(String id) void
setCustomerObject
(Customer expandableObject) void
setDefaultSettings
(SubscriptionSchedule.DefaultSettings defaultSettings) void
setEndBehavior
(String endBehavior) Behavior of the subscription schedule and underlying subscription when it ends.void
Unique identifier for the object.void
setLivemode
(Boolean livemode) Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode.void
setMetadata
(Map<String, String> metadata) Set of key-value pairs that you can attach to an object.void
String representing the object's type.void
setPhases
(List<SubscriptionSchedule.Phase> phases) Configuration for the subscription schedule's phases.void
setReleasedAt
(Long releasedAt) Time at which the subscription schedule was released.void
setReleasedSubscription
(String releasedSubscription) ID of the subscription once managed by the subscription schedule (if it is released).void
setResponseGetter
(StripeResponseGetter responseGetter) Get expandeddestination
.void
The present status of the subscription schedule.void
void
setSubscriptionObject
(Subscription expandableObject) void
setTestClock
(String id) void
setTestClockObject
(TestClock expandableObject) Updates an existing subscription schedule.update
(SubscriptionScheduleUpdateParams params, RequestOptions options) Updates an existing subscription schedule.Updates an existing subscription schedule.update
(Map<String, Object> params, RequestOptions options) Updates an existing subscription schedule.Methods inherited from class com.stripe.net.ApiResource
checkNullTypedParams, getGlobalResponseGetter, getResponseGetter, setExpandableFieldId, setStripeResponseGetter, urlEncode, urlEncodeId
Methods inherited from class com.stripe.model.StripeObject
deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.stripe.model.StripeActiveObject
trySetResponseGetter
-
Constructor Details
-
SubscriptionSchedule
public SubscriptionSchedule()
-
-
Method Details
-
getApplication
Get ID of expandableapplication
object. -
setApplication
-
getApplicationObject
Get expandedapplication
. -
setApplicationObject
-
getCustomer
Get ID of expandablecustomer
object. -
setCustomer
-
getCustomerObject
Get expandedcustomer
. -
setCustomerObject
-
getSubscription
Get ID of expandablesubscription
object. -
setSubscription
-
getSubscriptionObject
Get expandedsubscription
. -
setSubscriptionObject
-
getTestClock
Get ID of expandabletestClock
object. -
setTestClock
-
getTestClockObject
Get expandedtestClock
. -
setTestClockObject
-
cancel
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 isnot_started
oractive
.- Throws:
StripeException
-
cancel
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 isnot_started
oractive
.- Throws:
StripeException
-
cancel
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 isnot_started
oractive
.- Throws:
StripeException
-
cancel
public SubscriptionSchedule cancel(Map<String, Object> params, RequestOptions options) throws StripeExceptionCancels 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 isnot_started
oractive
.- Throws:
StripeException
-
cancel
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 isnot_started
oractive
.- Throws:
StripeException
-
cancel
public SubscriptionSchedule cancel(SubscriptionScheduleCancelParams params, RequestOptions options) throws StripeException 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 isnot_started
oractive
.- Throws:
StripeException
-
create
Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions.- Throws:
StripeException
-
create
public static SubscriptionSchedule create(Map<String, Object> params, RequestOptions options) throws StripeExceptionCreates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions.- Throws:
StripeException
-
create
public static SubscriptionSchedule create(SubscriptionScheduleCreateParams params) throws StripeException Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions.- Throws:
StripeException
-
create
public static SubscriptionSchedule create(SubscriptionScheduleCreateParams params, RequestOptions options) throws StripeException Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions.- Throws:
StripeException
-
list
Retrieves the list of your subscription schedules.- Throws:
StripeException
-
list
public static SubscriptionScheduleCollection list(Map<String, Object> params, RequestOptions options) throws StripeExceptionRetrieves the list of your subscription schedules.- Throws:
StripeException
-
list
public static SubscriptionScheduleCollection list(SubscriptionScheduleListParams params) throws StripeException Retrieves the list of your subscription schedules.- Throws:
StripeException
-
list
public static SubscriptionScheduleCollection list(SubscriptionScheduleListParams params, RequestOptions options) throws StripeException Retrieves the list of your subscription schedules.- Throws:
StripeException
-
release
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 isnot_started
oractive
. If the subscription schedule is currently associated with a subscription, releasing it will remove itssubscription
property and set the subscription’s ID to thereleased_subscription
property.- Throws:
StripeException
-
release
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 isnot_started
oractive
. If the subscription schedule is currently associated with a subscription, releasing it will remove itssubscription
property and set the subscription’s ID to thereleased_subscription
property.- Throws:
StripeException
-
release
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 isnot_started
oractive
. If the subscription schedule is currently associated with a subscription, releasing it will remove itssubscription
property and set the subscription’s ID to thereleased_subscription
property.- Throws:
StripeException
-
release
public SubscriptionSchedule release(Map<String, Object> params, RequestOptions options) throws StripeExceptionReleases 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 isnot_started
oractive
. If the subscription schedule is currently associated with a subscription, releasing it will remove itssubscription
property and set the subscription’s ID to thereleased_subscription
property.- Throws:
StripeException
-
release
public SubscriptionSchedule release(SubscriptionScheduleReleaseParams params) throws StripeException 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 isnot_started
oractive
. If the subscription schedule is currently associated with a subscription, releasing it will remove itssubscription
property and set the subscription’s ID to thereleased_subscription
property.- Throws:
StripeException
-
release
public SubscriptionSchedule release(SubscriptionScheduleReleaseParams params, RequestOptions options) throws StripeException 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 isnot_started
oractive
. If the subscription schedule is currently associated with a subscription, releasing it will remove itssubscription
property and set the subscription’s ID to thereleased_subscription
property.- Throws:
StripeException
-
retrieve
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.- Throws:
StripeException
-
retrieve
public static SubscriptionSchedule retrieve(String schedule, RequestOptions options) throws StripeException 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.- Throws:
StripeException
-
retrieve
public static SubscriptionSchedule retrieve(String schedule, Map<String, Object> params, RequestOptions options) throws StripeExceptionRetrieves the details of an existing subscription schedule. You only need to supply the unique subscription schedule identifier that was returned upon subscription schedule creation.- Throws:
StripeException
-
retrieve
public static SubscriptionSchedule retrieve(String schedule, SubscriptionScheduleRetrieveParams params, RequestOptions options) throws StripeException 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.- Throws:
StripeException
-
update
Updates an existing subscription schedule.- Specified by:
update
in interfaceMetadataStore<SubscriptionSchedule>
- Throws:
StripeException
-
update
public SubscriptionSchedule update(Map<String, Object> params, RequestOptions options) throws StripeExceptionUpdates an existing subscription schedule.- Specified by:
update
in interfaceMetadataStore<SubscriptionSchedule>
- Throws:
StripeException
-
update
Updates an existing subscription schedule.- Throws:
StripeException
-
update
public SubscriptionSchedule update(SubscriptionScheduleUpdateParams params, RequestOptions options) throws StripeException Updates an existing subscription schedule.- Throws:
StripeException
-
setResponseGetter
Get expandeddestination
.- Specified by:
setResponseGetter
in interfaceStripeActiveObject
- Overrides:
setResponseGetter
in classApiResource
- Parameters:
responseGetter
- theStripeResponseGetter
instance to use for making further requests.
-
getCanceledAt
Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch. -
getCompletedAt
Time at which the subscription schedule was completed. Measured in seconds since the Unix epoch. -
getCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
getCurrentPhase
Object representing the start and end dates for the current phase of the subscription schedule, if it isactive
. -
getDefaultSettings
-
getEndBehavior
Behavior of the subscription schedule and underlying subscription when it ends. Possible values arerelease
orcancel
with the default beingrelease
.release
will end the subscription schedule and keep the underlying subscription running.cancel
will end the subscription schedule and cancel the underlying subscription.One of
cancel
,none
,release
, orrenew
. -
getLivemode
Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode. -
getObject
String representing the object's type. Objects of the same type share the same value.Equal to
subscription_schedule
. -
getPhases
Configuration for the subscription schedule's phases. -
getReleasedAt
Time at which the subscription schedule was released. Measured in seconds since the Unix epoch. -
getReleasedSubscription
ID of the subscription once managed by the subscription schedule (if it is released). -
getStatus
The present status of the subscription schedule. Possible values arenot_started
,active
,completed
,released
, andcanceled
. You can read more about the different states in our behavior guide.One of
active
,canceled
,completed
,not_started
, orreleased
. -
setCanceledAt
Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch. -
setCompletedAt
Time at which the subscription schedule was completed. Measured in seconds since the Unix epoch. -
setCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
setCurrentPhase
Object representing the start and end dates for the current phase of the subscription schedule, if it isactive
. -
setDefaultSettings
-
setEndBehavior
Behavior of the subscription schedule and underlying subscription when it ends. Possible values arerelease
orcancel
with the default beingrelease
.release
will end the subscription schedule and keep the underlying subscription running.cancel
will end the subscription schedule and cancel the underlying subscription.One of
cancel
,none
,release
, orrenew
. -
setId
Unique identifier for the object. -
setLivemode
Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode. -
setMetadata
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. -
setObject
String representing the object's type. Objects of the same type share the same value.Equal to
subscription_schedule
. -
setPhases
Configuration for the subscription schedule's phases. -
setReleasedAt
Time at which the subscription schedule was released. Measured in seconds since the Unix epoch. -
setReleasedSubscription
ID of the subscription once managed by the subscription schedule (if it is released). -
setStatus
The present status of the subscription schedule. Possible values arenot_started
,active
,completed
,released
, andcanceled
. You can read more about the different states in our behavior guide.One of
active
,canceled
,completed
,not_started
, orreleased
. -
equals
-
canEqual
-
hashCode
public int hashCode() -
getId
Unique identifier for the object. -
getMetadata
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.- Specified by:
getMetadata
in interfaceMetadataStore<SubscriptionSchedule>
-