Class Subscription
- java.lang.Object
-
- com.stripe.model.StripeObject
-
- com.stripe.net.ApiResource
-
- com.stripe.model.Subscription
-
- All Implemented Interfaces:
HasId,MetadataStore<Subscription>,StripeObjectInterface
public class Subscription extends ApiResource implements HasId, MetadataStore<Subscription>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSubscription.AutomaticTaxstatic classSubscription.BillingThresholdsstatic classSubscription.PauseCollectionstatic classSubscription.PendingInvoiceItemIntervalstatic classSubscription.PendingUpdatestatic classSubscription.TransferData-
Nested classes/interfaces inherited from class com.stripe.net.ApiResource
ApiResource.RequestMethod
-
-
Field Summary
-
Fields inherited from class com.stripe.net.ApiResource
CHARSET, GSON
-
Fields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON
-
-
Constructor Summary
Constructors Constructor Description Subscription()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Subscriptioncancel()Cancels a customer’s subscription immediately.Subscriptioncancel(SubscriptionCancelParams params)Cancels a customer’s subscription immediately.Subscriptioncancel(SubscriptionCancelParams params, RequestOptions options)Cancels a customer’s subscription immediately.Subscriptioncancel(java.util.Map<java.lang.String,java.lang.Object> params)Cancels a customer’s subscription immediately.Subscriptioncancel(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Cancels a customer’s subscription immediately.protected booleancanEqual(java.lang.Object other)static Subscriptioncreate(SubscriptionCreateParams params)Creates a new subscription on an existing customer.static Subscriptioncreate(SubscriptionCreateParams params, RequestOptions options)Creates a new subscription on an existing customer.static Subscriptioncreate(java.util.Map<java.lang.String,java.lang.Object> params)Creates a new subscription on an existing customer.static Subscriptioncreate(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Creates a new subscription on an existing customer.DiscountdeleteDiscount()Removes the currently applied discount on a subscription.DiscountdeleteDiscount(java.util.Map<java.lang.String,java.lang.Object> params)Removes the currently applied discount on a subscription.DiscountdeleteDiscount(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Removes the currently applied discount on a subscription.booleanequals(java.lang.Object o)java.math.BigDecimalgetApplicationFeePercent()A non-negative decimal between 0 and 100, with at most two decimal places.Subscription.AutomaticTaxgetAutomaticTax()java.lang.LonggetBillingCycleAnchor()Determines the date of the first full invoice, and, for plans withmonthoryearintervals, the day of the month for subsequent invoices.Subscription.BillingThresholdsgetBillingThresholds()Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period.java.lang.LonggetCancelAt()A date in the future at which the subscription will automatically get canceled.java.lang.BooleangetCancelAtPeriodEnd()If the subscription has been canceled with theat_period_endflag set totrue,cancel_at_period_endon the subscription will be true.java.lang.LonggetCanceledAt()If the subscription has been canceled, the date of that cancellation.java.lang.StringgetCollectionMethod()Eithercharge_automatically, orsend_invoice.java.lang.LonggetCreated()Time at which the object was created.java.lang.LonggetCurrentPeriodEnd()End of the current period that the subscription has been invoiced for.java.lang.LonggetCurrentPeriodStart()Start of the current period that the subscription has been invoiced for.java.lang.StringgetCustomer()Get ID of expandablecustomerobject.CustomergetCustomerObject()Get expandedcustomer.java.lang.LonggetDaysUntilDue()Number of days a customer has to pay invoices generated by this subscription.java.lang.StringgetDefaultPaymentMethod()Get ID of expandabledefaultPaymentMethodobject.PaymentMethodgetDefaultPaymentMethodObject()Get expandeddefaultPaymentMethod.java.lang.StringgetDefaultSource()Get ID of expandabledefaultSourceobject.PaymentSourcegetDefaultSourceObject()Get expandeddefaultSource.java.util.List<TaxRate>getDefaultTaxRates()The tax rates that will apply to any subscription item that does not havetax_ratesset.DiscountgetDiscount()Describes the current discount applied to this subscription, if there is one.java.lang.LonggetEndedAt()If the subscription has ended, the date the subscription ended.java.lang.StringgetId()Unique identifier for the object.SubscriptionItemCollectiongetItems()List of subscription items, each with an attached price.java.lang.StringgetLatestInvoice()Get ID of expandablelatestInvoiceobject.InvoicegetLatestInvoiceObject()Get expandedlatestInvoice.java.lang.BooleangetLivemode()Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.java.util.Map<java.lang.String,java.lang.String>getMetadata()Set of key-value pairs that you can attach to an object.java.lang.LonggetNextPendingInvoiceItemInvoice()Specifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided atpending_invoice_item_interval.java.lang.StringgetObject()String representing the object's type.Subscription.PauseCollectiongetPauseCollection()If specified, payment collection for this subscription will be paused.Subscription.PendingInvoiceItemIntervalgetPendingInvoiceItemInterval()Specifies an interval for how often to bill for any pending invoice items.java.lang.StringgetPendingSetupIntent()Get ID of expandablependingSetupIntentobject.SetupIntentgetPendingSetupIntentObject()Get expandedpendingSetupIntent.Subscription.PendingUpdategetPendingUpdate()If specified, pending updates that will be applied to the subscription once thelatest_invoicehas been paid.java.lang.StringgetSchedule()Get ID of expandablescheduleobject.SubscriptionSchedulegetScheduleObject()Get expandedschedule.java.lang.LonggetStartDate()Date when the subscription was first created.java.lang.StringgetStatus()Possible values areincomplete,incomplete_expired,trialing,active,past_due,canceled, orunpaid.Subscription.TransferDatagetTransferData()The account (if any) the subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices.java.lang.LonggetTrialEnd()If the subscription has a trial, the end of that trial.java.lang.LonggetTrialStart()If the subscription has a trial, the beginning of that trial.inthashCode()static SubscriptionCollectionlist(SubscriptionListParams params)By default, returns a list of subscriptions that have not been canceled.static SubscriptionCollectionlist(SubscriptionListParams params, RequestOptions options)By default, returns a list of subscriptions that have not been canceled.static SubscriptionCollectionlist(java.util.Map<java.lang.String,java.lang.Object> params)By default, returns a list of subscriptions that have not been canceled.static SubscriptionCollectionlist(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)By default, returns a list of subscriptions that have not been canceled.static Subscriptionretrieve(java.lang.String subscriptionExposedId)Retrieves the subscription with the given ID.static Subscriptionretrieve(java.lang.String subscriptionExposedId, RequestOptions options)Retrieves the subscription with the given ID.static Subscriptionretrieve(java.lang.String subscriptionExposedId, SubscriptionRetrieveParams params, RequestOptions options)Retrieves the subscription with the given ID.static Subscriptionretrieve(java.lang.String subscriptionExposedId, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Retrieves the subscription with the given ID.voidsetApplicationFeePercent(java.math.BigDecimal applicationFeePercent)A non-negative decimal between 0 and 100, with at most two decimal places.voidsetAutomaticTax(Subscription.AutomaticTax automaticTax)voidsetBillingCycleAnchor(java.lang.Long billingCycleAnchor)Determines the date of the first full invoice, and, for plans withmonthoryearintervals, the day of the month for subsequent invoices.voidsetBillingThresholds(Subscription.BillingThresholds billingThresholds)Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period.voidsetCancelAt(java.lang.Long cancelAt)A date in the future at which the subscription will automatically get canceled.voidsetCancelAtPeriodEnd(java.lang.Boolean cancelAtPeriodEnd)If the subscription has been canceled with theat_period_endflag set totrue,cancel_at_period_endon the subscription will be true.voidsetCanceledAt(java.lang.Long canceledAt)If the subscription has been canceled, the date of that cancellation.voidsetCollectionMethod(java.lang.String collectionMethod)Eithercharge_automatically, orsend_invoice.voidsetCreated(java.lang.Long created)Time at which the object was created.voidsetCurrentPeriodEnd(java.lang.Long currentPeriodEnd)End of the current period that the subscription has been invoiced for.voidsetCurrentPeriodStart(java.lang.Long currentPeriodStart)Start of the current period that the subscription has been invoiced for.voidsetCustomer(java.lang.String id)voidsetCustomerObject(Customer expandableObject)voidsetDaysUntilDue(java.lang.Long daysUntilDue)Number of days a customer has to pay invoices generated by this subscription.voidsetDefaultPaymentMethod(java.lang.String id)voidsetDefaultPaymentMethodObject(PaymentMethod expandableObject)voidsetDefaultSource(java.lang.String id)voidsetDefaultSourceObject(PaymentSource expandableObject)voidsetDefaultTaxRates(java.util.List<TaxRate> defaultTaxRates)The tax rates that will apply to any subscription item that does not havetax_ratesset.voidsetDiscount(Discount discount)Describes the current discount applied to this subscription, if there is one.voidsetEndedAt(java.lang.Long endedAt)If the subscription has ended, the date the subscription ended.voidsetId(java.lang.String id)Unique identifier for the object.voidsetItems(SubscriptionItemCollection items)List of subscription items, each with an attached price.voidsetLatestInvoice(java.lang.String id)voidsetLatestInvoiceObject(Invoice expandableObject)voidsetLivemode(java.lang.Boolean livemode)Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.voidsetMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)Set of key-value pairs that you can attach to an object.voidsetNextPendingInvoiceItemInvoice(java.lang.Long nextPendingInvoiceItemInvoice)Specifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided atpending_invoice_item_interval.voidsetObject(java.lang.String object)String representing the object's type.voidsetPauseCollection(Subscription.PauseCollection pauseCollection)If specified, payment collection for this subscription will be paused.voidsetPendingInvoiceItemInterval(Subscription.PendingInvoiceItemInterval pendingInvoiceItemInterval)Specifies an interval for how often to bill for any pending invoice items.voidsetPendingSetupIntent(java.lang.String id)voidsetPendingSetupIntentObject(SetupIntent expandableObject)voidsetPendingUpdate(Subscription.PendingUpdate pendingUpdate)If specified, pending updates that will be applied to the subscription once thelatest_invoicehas been paid.voidsetSchedule(java.lang.String id)voidsetScheduleObject(SubscriptionSchedule expandableObject)voidsetStartDate(java.lang.Long startDate)Date when the subscription was first created.voidsetStatus(java.lang.String status)Possible values areincomplete,incomplete_expired,trialing,active,past_due,canceled, orunpaid.voidsetTransferData(Subscription.TransferData transferData)The account (if any) the subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices.voidsetTrialEnd(java.lang.Long trialEnd)If the subscription has a trial, the end of that trial.voidsetTrialStart(java.lang.Long trialStart)If the subscription has a trial, the beginning of that trial.Subscriptionupdate(SubscriptionUpdateParams params)Updates an existing subscription on a customer to match the specified parameters.Subscriptionupdate(SubscriptionUpdateParams params, RequestOptions options)Updates an existing subscription on a customer to match the specified parameters.Subscriptionupdate(java.util.Map<java.lang.String,java.lang.Object> params)Updates an existing subscription on a customer to match the specified parameters.Subscriptionupdate(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Updates an existing subscription on a customer to match the specified parameters.-
Methods inherited from class com.stripe.net.ApiResource
checkNullTypedParams, classUrl, classUrl, instanceUrl, instanceUrl, request, request, requestCollection, requestCollection, setExpandableFieldId, setStripeResponseGetter, singleClassUrl, singleClassUrl, subresourceUrl, urlEncode, urlEncodeId
-
Methods inherited from class com.stripe.model.StripeObject
equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toString
-
-
-
-
Method Detail
-
getCustomer
public java.lang.String getCustomer()
Get ID of expandablecustomerobject.
-
setCustomer
public void setCustomer(java.lang.String id)
-
getCustomerObject
public Customer getCustomerObject()
Get expandedcustomer.
-
setCustomerObject
public void setCustomerObject(Customer expandableObject)
-
getDefaultPaymentMethod
public java.lang.String getDefaultPaymentMethod()
Get ID of expandabledefaultPaymentMethodobject.
-
setDefaultPaymentMethod
public void setDefaultPaymentMethod(java.lang.String id)
-
getDefaultPaymentMethodObject
public PaymentMethod getDefaultPaymentMethodObject()
Get expandeddefaultPaymentMethod.
-
setDefaultPaymentMethodObject
public void setDefaultPaymentMethodObject(PaymentMethod expandableObject)
-
getDefaultSource
public java.lang.String getDefaultSource()
Get ID of expandabledefaultSourceobject.
-
setDefaultSource
public void setDefaultSource(java.lang.String id)
-
getDefaultSourceObject
public PaymentSource getDefaultSourceObject()
Get expandeddefaultSource.
-
setDefaultSourceObject
public void setDefaultSourceObject(PaymentSource expandableObject)
-
getLatestInvoice
public java.lang.String getLatestInvoice()
Get ID of expandablelatestInvoiceobject.
-
setLatestInvoice
public void setLatestInvoice(java.lang.String id)
-
getLatestInvoiceObject
public Invoice getLatestInvoiceObject()
Get expandedlatestInvoice.
-
setLatestInvoiceObject
public void setLatestInvoiceObject(Invoice expandableObject)
-
getPendingSetupIntent
public java.lang.String getPendingSetupIntent()
Get ID of expandablependingSetupIntentobject.
-
setPendingSetupIntent
public void setPendingSetupIntent(java.lang.String id)
-
getPendingSetupIntentObject
public SetupIntent getPendingSetupIntentObject()
Get expandedpendingSetupIntent.
-
setPendingSetupIntentObject
public void setPendingSetupIntentObject(SetupIntent expandableObject)
-
getSchedule
public java.lang.String getSchedule()
Get ID of expandablescheduleobject.
-
setSchedule
public void setSchedule(java.lang.String id)
-
getScheduleObject
public SubscriptionSchedule getScheduleObject()
Get expandedschedule.
-
setScheduleObject
public void setScheduleObject(SubscriptionSchedule expandableObject)
-
list
public static SubscriptionCollection list(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
By default, returns a list of subscriptions that have not been canceled. In order to list canceled subscriptions, specifystatus=canceled.- Throws:
StripeException
-
list
public static SubscriptionCollection list(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
By default, returns a list of subscriptions that have not been canceled. In order to list canceled subscriptions, specifystatus=canceled.- Throws:
StripeException
-
list
public static SubscriptionCollection list(SubscriptionListParams params) throws StripeException
By default, returns a list of subscriptions that have not been canceled. In order to list canceled subscriptions, specifystatus=canceled.- Throws:
StripeException
-
list
public static SubscriptionCollection list(SubscriptionListParams params, RequestOptions options) throws StripeException
By default, returns a list of subscriptions that have not been canceled. In order to list canceled subscriptions, specifystatus=canceled.- Throws:
StripeException
-
create
public static Subscription create(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Creates a new subscription on an existing customer. Each customer can have up to 500 active or scheduled subscriptions.- Throws:
StripeException
-
create
public static Subscription create(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Creates a new subscription on an existing customer. Each customer can have up to 500 active or scheduled subscriptions.- Throws:
StripeException
-
create
public static Subscription create(SubscriptionCreateParams params) throws StripeException
Creates a new subscription on an existing customer. Each customer can have up to 500 active or scheduled subscriptions.- Throws:
StripeException
-
create
public static Subscription create(SubscriptionCreateParams params, RequestOptions options) throws StripeException
Creates a new subscription on an existing customer. Each customer can have up to 500 active or scheduled subscriptions.- Throws:
StripeException
-
update
public Subscription update(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Updates an existing subscription on a customer to match the specified parameters. When changing plans or quantities, we will optionally prorate the price we charge next month to make up for any price changes. To preview how the proration will be calculated, use the upcoming invoice endpoint.- Specified by:
updatein interfaceMetadataStore<Subscription>- Throws:
StripeException
-
update
public Subscription update(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Updates an existing subscription on a customer to match the specified parameters. When changing plans or quantities, we will optionally prorate the price we charge next month to make up for any price changes. To preview how the proration will be calculated, use the upcoming invoice endpoint.- Specified by:
updatein interfaceMetadataStore<Subscription>- Throws:
StripeException
-
update
public Subscription update(SubscriptionUpdateParams params) throws StripeException
Updates an existing subscription on a customer to match the specified parameters. When changing plans or quantities, we will optionally prorate the price we charge next month to make up for any price changes. To preview how the proration will be calculated, use the upcoming invoice endpoint.- Throws:
StripeException
-
update
public Subscription update(SubscriptionUpdateParams params, RequestOptions options) throws StripeException
Updates an existing subscription on a customer to match the specified parameters. When changing plans or quantities, we will optionally prorate the price we charge next month to make up for any price changes. To preview how the proration will be calculated, use the upcoming invoice endpoint.- Throws:
StripeException
-
retrieve
public static Subscription retrieve(java.lang.String subscriptionExposedId) throws StripeException
Retrieves the subscription with the given ID.- Throws:
StripeException
-
retrieve
public static Subscription retrieve(java.lang.String subscriptionExposedId, RequestOptions options) throws StripeException
Retrieves the subscription with the given ID.- Throws:
StripeException
-
retrieve
public static Subscription retrieve(java.lang.String subscriptionExposedId, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Retrieves the subscription with the given ID.- Throws:
StripeException
-
retrieve
public static Subscription retrieve(java.lang.String subscriptionExposedId, SubscriptionRetrieveParams params, RequestOptions options) throws StripeException
Retrieves the subscription with the given ID.- Throws:
StripeException
-
cancel
public Subscription cancel() throws StripeException
Cancels a customer’s subscription immediately. The customer will not be charged again for the subscription.Note, however, that any pending invoice items that you’ve created will still be charged for at the end of the period, unless manually deleted. If you’ve set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed.
By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.
- Throws:
StripeException
-
cancel
public Subscription cancel(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Cancels a customer’s subscription immediately. The customer will not be charged again for the subscription.Note, however, that any pending invoice items that you’ve created will still be charged for at the end of the period, unless manually deleted. If you’ve set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed.
By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.
- Throws:
StripeException
-
cancel
public Subscription cancel(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Cancels a customer’s subscription immediately. The customer will not be charged again for the subscription.Note, however, that any pending invoice items that you’ve created will still be charged for at the end of the period, unless manually deleted. If you’ve set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed.
By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.
- Throws:
StripeException
-
cancel
public Subscription cancel(SubscriptionCancelParams params) throws StripeException
Cancels a customer’s subscription immediately. The customer will not be charged again for the subscription.Note, however, that any pending invoice items that you’ve created will still be charged for at the end of the period, unless manually deleted. If you’ve set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed.
By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.
- Throws:
StripeException
-
cancel
public Subscription cancel(SubscriptionCancelParams params, RequestOptions options) throws StripeException
Cancels a customer’s subscription immediately. The customer will not be charged again for the subscription.Note, however, that any pending invoice items that you’ve created will still be charged for at the end of the period, unless manually deleted. If you’ve set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed.
By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.
- Throws:
StripeException
-
deleteDiscount
public Discount deleteDiscount() throws StripeException
Removes the currently applied discount on a subscription.- Throws:
StripeException
-
deleteDiscount
public Discount deleteDiscount(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Removes the currently applied discount on a subscription.- Throws:
StripeException
-
deleteDiscount
public Discount deleteDiscount(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Removes the currently applied discount on a subscription.- Throws:
StripeException
-
getApplicationFeePercent
public java.math.BigDecimal getApplicationFeePercent()
A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account.
-
getAutomaticTax
public Subscription.AutomaticTax getAutomaticTax()
-
getBillingCycleAnchor
public java.lang.Long getBillingCycleAnchor()
Determines the date of the first full invoice, and, for plans withmonthoryearintervals, the day of the month for subsequent invoices.
-
getBillingThresholds
public Subscription.BillingThresholds getBillingThresholds()
Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period.
-
getCancelAt
public java.lang.Long getCancelAt()
A date in the future at which the subscription will automatically get canceled.
-
getCancelAtPeriodEnd
public java.lang.Boolean getCancelAtPeriodEnd()
If the subscription has been canceled with theat_period_endflag set totrue,cancel_at_period_endon the subscription will be true. You can use this attribute to determine whether a subscription that has a status of active is scheduled to be canceled at the end of the current period.
-
getCanceledAt
public java.lang.Long getCanceledAt()
If the subscription has been canceled, the date of that cancellation. If the subscription was canceled withcancel_at_period_end,canceled_atwill reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state.
-
getCollectionMethod
public java.lang.String getCollectionMethod()
Eithercharge_automatically, orsend_invoice. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions.One of
charge_automatically, orsend_invoice.
-
getCreated
public java.lang.Long getCreated()
Time at which the object was created. Measured in seconds since the Unix epoch.
-
getCurrentPeriodEnd
public java.lang.Long getCurrentPeriodEnd()
End of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created.
-
getCurrentPeriodStart
public java.lang.Long getCurrentPeriodStart()
Start of the current period that the subscription has been invoiced for.
-
getDaysUntilDue
public java.lang.Long getDaysUntilDue()
Number of days a customer has to pay invoices generated by this subscription. This value will benullfor subscriptions wherecollection_method=charge_automatically.
-
getDefaultTaxRates
public java.util.List<TaxRate> getDefaultTaxRates()
The tax rates that will apply to any subscription item that does not havetax_ratesset. Invoices created will have theirdefault_tax_ratespopulated from the subscription.
-
getDiscount
public Discount getDiscount()
Describes the current discount applied to this subscription, if there is one. When billing, a discount applied to a subscription overrides a discount applied on a customer-wide basis.
-
getEndedAt
public java.lang.Long getEndedAt()
If the subscription has ended, the date the subscription ended.
-
getItems
public SubscriptionItemCollection getItems()
List of subscription items, each with an attached price.
-
getLivemode
public java.lang.Boolean getLivemode()
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.
-
getNextPendingInvoiceItemInvoice
public java.lang.Long getNextPendingInvoiceItemInvoice()
Specifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided atpending_invoice_item_interval.
-
getObject
public java.lang.String getObject()
String representing the object's type. Objects of the same type share the same value.Equal to
subscription.
-
getPauseCollection
public Subscription.PauseCollection getPauseCollection()
If specified, payment collection for this subscription will be paused.
-
getPendingInvoiceItemInterval
public Subscription.PendingInvoiceItemInterval getPendingInvoiceItemInterval()
Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling Create an invoice for the given subscription at the specified interval.
-
getPendingUpdate
public Subscription.PendingUpdate getPendingUpdate()
If specified, pending updates that will be applied to the subscription once thelatest_invoicehas been paid.
-
getStartDate
public java.lang.Long getStartDate()
Date when the subscription was first created. The date might differ from thecreateddate due to backdating.
-
getStatus
public java.lang.String getStatus()
Possible values areincomplete,incomplete_expired,trialing,active,past_due,canceled, orunpaid.For
collection_method=charge_automaticallya subscription moves intoincompleteif the initial payment attempt fails. A subscription in this state can only have metadata and default_source updated. Once the first invoice is paid, the subscription moves into anactivestate. If the first invoice is not paid within 23 hours, the subscription transitions toincomplete_expired. This is a terminal state, the open invoice will be voided and no further invoices will be generated.A subscription that is currently in a trial period is
trialingand moves toactivewhen the trial period is over.If subscription
collection_method=charge_automaticallyit becomespast_duewhen payment to renew it fails andcanceledorunpaid(depending on your subscriptions settings) when Stripe has exhausted all payment retry attempts.If subscription
collection_method=send_invoiceit becomespast_duewhen its invoice is not paid by the due date, andcanceledorunpaidif it is still not paid by an additional deadline after that. Note that when a subscription has a status ofunpaid, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed). After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices.One of
active,canceled,incomplete,incomplete_expired,past_due,trialing, orunpaid.
-
getTransferData
public Subscription.TransferData getTransferData()
The account (if any) the subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices.
-
getTrialEnd
public java.lang.Long getTrialEnd()
If the subscription has a trial, the end of that trial.
-
getTrialStart
public java.lang.Long getTrialStart()
If the subscription has a trial, the beginning of that trial.
-
setApplicationFeePercent
public void setApplicationFeePercent(java.math.BigDecimal applicationFeePercent)
A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account.
-
setAutomaticTax
public void setAutomaticTax(Subscription.AutomaticTax automaticTax)
-
setBillingCycleAnchor
public void setBillingCycleAnchor(java.lang.Long billingCycleAnchor)
Determines the date of the first full invoice, and, for plans withmonthoryearintervals, the day of the month for subsequent invoices.
-
setBillingThresholds
public void setBillingThresholds(Subscription.BillingThresholds billingThresholds)
Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period.
-
setCancelAt
public void setCancelAt(java.lang.Long cancelAt)
A date in the future at which the subscription will automatically get canceled.
-
setCancelAtPeriodEnd
public void setCancelAtPeriodEnd(java.lang.Boolean cancelAtPeriodEnd)
If the subscription has been canceled with theat_period_endflag set totrue,cancel_at_period_endon the subscription will be true. You can use this attribute to determine whether a subscription that has a status of active is scheduled to be canceled at the end of the current period.
-
setCanceledAt
public void setCanceledAt(java.lang.Long canceledAt)
If the subscription has been canceled, the date of that cancellation. If the subscription was canceled withcancel_at_period_end,canceled_atwill reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state.
-
setCollectionMethod
public void setCollectionMethod(java.lang.String collectionMethod)
Eithercharge_automatically, orsend_invoice. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions.One of
charge_automatically, orsend_invoice.
-
setCreated
public void setCreated(java.lang.Long created)
Time at which the object was created. Measured in seconds since the Unix epoch.
-
setCurrentPeriodEnd
public void setCurrentPeriodEnd(java.lang.Long currentPeriodEnd)
End of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created.
-
setCurrentPeriodStart
public void setCurrentPeriodStart(java.lang.Long currentPeriodStart)
Start of the current period that the subscription has been invoiced for.
-
setDaysUntilDue
public void setDaysUntilDue(java.lang.Long daysUntilDue)
Number of days a customer has to pay invoices generated by this subscription. This value will benullfor subscriptions wherecollection_method=charge_automatically.
-
setDefaultTaxRates
public void setDefaultTaxRates(java.util.List<TaxRate> defaultTaxRates)
The tax rates that will apply to any subscription item that does not havetax_ratesset. Invoices created will have theirdefault_tax_ratespopulated from the subscription.
-
setDiscount
public void setDiscount(Discount discount)
Describes the current discount applied to this subscription, if there is one. When billing, a discount applied to a subscription overrides a discount applied on a customer-wide basis.
-
setEndedAt
public void setEndedAt(java.lang.Long endedAt)
If the subscription has ended, the date the subscription ended.
-
setId
public void setId(java.lang.String id)
Unique identifier for the object.
-
setItems
public void setItems(SubscriptionItemCollection items)
List of subscription items, each with an attached price.
-
setLivemode
public void setLivemode(java.lang.Boolean livemode)
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.
-
setMetadata
public void setMetadata(java.util.Map<java.lang.String,java.lang.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.
-
setNextPendingInvoiceItemInvoice
public void setNextPendingInvoiceItemInvoice(java.lang.Long nextPendingInvoiceItemInvoice)
Specifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided atpending_invoice_item_interval.
-
setObject
public void setObject(java.lang.String object)
String representing the object's type. Objects of the same type share the same value.Equal to
subscription.
-
setPauseCollection
public void setPauseCollection(Subscription.PauseCollection pauseCollection)
If specified, payment collection for this subscription will be paused.
-
setPendingInvoiceItemInterval
public void setPendingInvoiceItemInterval(Subscription.PendingInvoiceItemInterval pendingInvoiceItemInterval)
Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling Create an invoice for the given subscription at the specified interval.
-
setPendingUpdate
public void setPendingUpdate(Subscription.PendingUpdate pendingUpdate)
If specified, pending updates that will be applied to the subscription once thelatest_invoicehas been paid.
-
setStartDate
public void setStartDate(java.lang.Long startDate)
Date when the subscription was first created. The date might differ from thecreateddate due to backdating.
-
setStatus
public void setStatus(java.lang.String status)
Possible values areincomplete,incomplete_expired,trialing,active,past_due,canceled, orunpaid.For
collection_method=charge_automaticallya subscription moves intoincompleteif the initial payment attempt fails. A subscription in this state can only have metadata and default_source updated. Once the first invoice is paid, the subscription moves into anactivestate. If the first invoice is not paid within 23 hours, the subscription transitions toincomplete_expired. This is a terminal state, the open invoice will be voided and no further invoices will be generated.A subscription that is currently in a trial period is
trialingand moves toactivewhen the trial period is over.If subscription
collection_method=charge_automaticallyit becomespast_duewhen payment to renew it fails andcanceledorunpaid(depending on your subscriptions settings) when Stripe has exhausted all payment retry attempts.If subscription
collection_method=send_invoiceit becomespast_duewhen its invoice is not paid by the due date, andcanceledorunpaidif it is still not paid by an additional deadline after that. Note that when a subscription has a status ofunpaid, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed). After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices.One of
active,canceled,incomplete,incomplete_expired,past_due,trialing, orunpaid.
-
setTransferData
public void setTransferData(Subscription.TransferData transferData)
The account (if any) the subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices.
-
setTrialEnd
public void setTrialEnd(java.lang.Long trialEnd)
If the subscription has a trial, the end of that trial.
-
setTrialStart
public void setTrialStart(java.lang.Long trialStart)
If the subscription has a trial, the beginning of that trial.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getId
public java.lang.String getId()
Unique identifier for the object.
-
getMetadata
public java.util.Map<java.lang.String,java.lang.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:
getMetadatain interfaceMetadataStore<Subscription>
-
-