Class SubscriptionSchedule

All Implemented Interfaces:
HasId, MetadataStore<SubscriptionSchedule>, 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.

  • Constructor Details

    • SubscriptionSchedule

      public SubscriptionSchedule()
  • Method Details

    • getApplication

      public String getApplication()
      Get ID of expandable application object.
    • setApplication

      public void setApplication(String id)
    • getApplicationObject

      public Application getApplicationObject()
      Get expanded application.
    • setApplicationObject

      public void setApplicationObject(Application expandableObject)
    • getCustomer

      public String getCustomer()
      Get ID of expandable customer object.
    • setCustomer

      public void setCustomer(String id)
    • getCustomerObject

      public Customer getCustomerObject()
      Get expanded customer.
    • setCustomerObject

      public void setCustomerObject(Customer expandableObject)
    • getSubscription

      public String getSubscription()
      Get ID of expandable subscription object.
    • setSubscription

      public void setSubscription(String id)
    • getSubscriptionObject

      public Subscription getSubscriptionObject()
      Get expanded subscription.
    • setSubscriptionObject

      public void setSubscriptionObject(Subscription expandableObject)
    • getTestClock

      public String getTestClock()
      Get ID of expandable testClock object.
    • setTestClock

      public void setTestClock(String id)
    • getTestClockObject

      public TestClock getTestClockObject()
      Get expanded testClock.
    • setTestClockObject

      public void setTestClockObject(TestClock expandableObject)
    • cancel

      public SubscriptionSchedule cancel() 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 is not_started or active.
      Throws:
      StripeException
    • cancel

      public SubscriptionSchedule cancel(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 is not_started or active.
      Throws:
      StripeException
    • cancel

      public SubscriptionSchedule cancel(Map<String,Object> params) 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 is not_started or active.
      Throws:
      StripeException
    • cancel

      public SubscriptionSchedule cancel(Map<String,Object> 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 is not_started or active.
      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 is not_started or active.
      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 is not_started or active.
      Throws:
      StripeException
    • create

      public static SubscriptionSchedule create(Map<String,Object> 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(Map<String,Object> params, RequestOptions options) throws StripeException
      Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions.
      Throws:
      StripeException
    • create

      Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions.
      Throws:
      StripeException
    • create

      Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions.
      Throws:
      StripeException
    • list

      public static SubscriptionScheduleCollection list(Map<String,Object> params) throws StripeException
      Retrieves the list of your subscription schedules.
      Throws:
      StripeException
    • list

      public static SubscriptionScheduleCollection list(Map<String,Object> params, RequestOptions options) throws StripeException
      Retrieves the list of your subscription schedules.
      Throws:
      StripeException
    • list

      Retrieves the list of your subscription schedules.
      Throws:
      StripeException
    • list

      Retrieves the list of your subscription schedules.
      Throws:
      StripeException
    • release

      public SubscriptionSchedule release() 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 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.
      Throws:
      StripeException
    • release

      public SubscriptionSchedule release(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 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.
      Throws:
      StripeException
    • release

      public SubscriptionSchedule release(Map<String,Object> 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 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.
      Throws:
      StripeException
    • release

      public SubscriptionSchedule release(Map<String,Object> 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 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.
      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 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.
      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 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.
      Throws:
      StripeException
    • retrieve

      public static SubscriptionSchedule retrieve(String schedule) 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, 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 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, 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

      public SubscriptionSchedule update(Map<String,Object> params) throws StripeException
      Updates an existing subscription schedule.
      Specified by:
      update in interface MetadataStore<SubscriptionSchedule>
      Throws:
      StripeException
    • update

      public SubscriptionSchedule update(Map<String,Object> params, RequestOptions options) throws StripeException
      Updates an existing subscription schedule.
      Specified by:
      update in interface MetadataStore<SubscriptionSchedule>
      Throws:
      StripeException
    • update

      Updates an existing subscription schedule.
      Throws:
      StripeException
    • update

      Updates an existing subscription schedule.
      Throws:
      StripeException
    • getCanceledAt

      public Long getCanceledAt()
      Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch.
    • getCompletedAt

      public Long getCompletedAt()
      Time at which the subscription schedule was completed. Measured in seconds since the Unix epoch.
    • getCreated

      public Long getCreated()
      Time at which the object was created. Measured in seconds since the Unix epoch.
    • getCurrentPhase

      public SubscriptionSchedule.CurrentPhase getCurrentPhase()
      Object representing the start and end dates for the current phase of the subscription schedule, if it is active.
    • getDefaultSettings

      public SubscriptionSchedule.DefaultSettings getDefaultSettings()
    • getEndBehavior

      public String getEndBehavior()
      Behavior of the subscription schedule and underlying subscription when it ends. Possible values are release and cancel.

      One of cancel, none, release, or renew.

    • getLivemode

      public Boolean getLivemode()
      Has the value true if the object exists in live mode or the value false if the object exists in test mode.
    • getObject

      public String getObject()
      String representing the object's type. Objects of the same type share the same value.

      Equal to subscription_schedule.

    • getPhases

      public List<SubscriptionSchedule.Phase> getPhases()
      Configuration for the subscription schedule's phases.
    • getReleasedAt

      public Long getReleasedAt()
      Time at which the subscription schedule was released. Measured in seconds since the Unix epoch.
    • getReleasedSubscription

      public String getReleasedSubscription()
      ID of the subscription once managed by the subscription schedule (if it is released).
    • getStatus

      public String getStatus()
      The present status of the subscription schedule. Possible values are not_started, active, completed, released, and canceled. You can read more about the different states in our behavior guide.

      One of active, canceled, completed, not_started, or released.

    • setCanceledAt

      public void setCanceledAt(Long canceledAt)
      Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch.
    • setCompletedAt

      public void setCompletedAt(Long completedAt)
      Time at which the subscription schedule was completed. Measured in seconds since the Unix epoch.
    • setCreated

      public void setCreated(Long created)
      Time at which the object was created. Measured in seconds since the Unix epoch.
    • setCurrentPhase

      public void setCurrentPhase(SubscriptionSchedule.CurrentPhase currentPhase)
      Object representing the start and end dates for the current phase of the subscription schedule, if it is active.
    • setDefaultSettings

      public void setDefaultSettings(SubscriptionSchedule.DefaultSettings defaultSettings)
    • setEndBehavior

      public void setEndBehavior(String endBehavior)
      Behavior of the subscription schedule and underlying subscription when it ends. Possible values are release and cancel.

      One of cancel, none, release, or renew.

    • setId

      public void setId(String id)
      Unique identifier for the object.
    • setLivemode

      public void setLivemode(Boolean livemode)
      Has the value true if the object exists in live mode or the value false if the object exists in test mode.
    • setMetadata

      public void setMetadata(Map<String,String> metadata)
      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

      public void setObject(String object)
      String representing the object's type. Objects of the same type share the same value.

      Equal to subscription_schedule.

    • setPhases

      public void setPhases(List<SubscriptionSchedule.Phase> phases)
      Configuration for the subscription schedule's phases.
    • setReleasedAt

      public void setReleasedAt(Long releasedAt)
      Time at which the subscription schedule was released. Measured in seconds since the Unix epoch.
    • setReleasedSubscription

      public void setReleasedSubscription(String releasedSubscription)
      ID of the subscription once managed by the subscription schedule (if it is released).
    • setStatus

      public void setStatus(String status)
      The present status of the subscription schedule. Possible values are not_started, active, completed, released, and canceled. You can read more about the different states in our behavior guide.

      One of active, canceled, completed, not_started, or released.

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getId

      public String getId()
      Unique identifier for the object.
      Specified by:
      getId in interface HasId
    • getMetadata

      public Map<String,String> 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 interface MetadataStore<SubscriptionSchedule>