Class SubscriptionItem
- java.lang.Object
-
- com.stripe.model.StripeObject
-
- com.stripe.net.ApiResource
-
- com.stripe.model.SubscriptionItem
-
- All Implemented Interfaces:
HasId,MetadataStore<SubscriptionItem>,StripeObjectInterface
public class SubscriptionItem extends ApiResource implements HasId, MetadataStore<SubscriptionItem>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSubscriptionItem.BillingThresholds-
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 SubscriptionItem()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(java.lang.Object other)static SubscriptionItemcreate(SubscriptionItemCreateParams params)Adds a new item to an existing subscription.static SubscriptionItemcreate(SubscriptionItemCreateParams params, RequestOptions options)Adds a new item to an existing subscription.static SubscriptionItemcreate(java.util.Map<java.lang.String,java.lang.Object> params)Adds a new item to an existing subscription.static SubscriptionItemcreate(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Adds a new item to an existing subscription.SubscriptionItemdelete()Deletes an item from the subscription.SubscriptionItemdelete(RequestOptions options)Deletes an item from the subscription.SubscriptionItemdelete(SubscriptionItemDeleteParams params)Deletes an item from the subscription.SubscriptionItemdelete(SubscriptionItemDeleteParams params, RequestOptions options)Deletes an item from the subscription.SubscriptionItemdelete(java.util.Map<java.lang.String,java.lang.Object> params)Deletes an item from the subscription.SubscriptionItemdelete(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Deletes an item from the subscription.booleanequals(java.lang.Object o)SubscriptionItem.BillingThresholdsgetBillingThresholds()Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period.java.lang.LonggetCreated()Time at which the object was created.java.lang.BooleangetDeleted()Always true for a deleted object.java.lang.StringgetId()Unique identifier for the object.java.util.Map<java.lang.String,java.lang.String>getMetadata()Set of key-value pairs that you can attach to an object.java.lang.StringgetObject()String representing the object's type.PlangetPlan()You can now model subscriptions more flexibly using the Prices API.PricegetPrice()Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products.java.lang.LonggetQuantity()The quantity of the plan to which the customer should be subscribed.java.lang.StringgetSubscription()Thesubscriptionthissubscription_itembelongs to.java.util.List<TaxRate>getTaxRates()The tax rates which apply to thissubscription_item.inthashCode()static SubscriptionItemCollectionlist(SubscriptionItemListParams params)Returns a list of your subscription items for a given subscription.static SubscriptionItemCollectionlist(SubscriptionItemListParams params, RequestOptions options)Returns a list of your subscription items for a given subscription.static SubscriptionItemCollectionlist(java.util.Map<java.lang.String,java.lang.Object> params)Returns a list of your subscription items for a given subscription.static SubscriptionItemCollectionlist(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Returns a list of your subscription items for a given subscription.static SubscriptionItemretrieve(java.lang.String item)Retrieves the subscription item with the given ID.static SubscriptionItemretrieve(java.lang.String item, RequestOptions options)Retrieves the subscription item with the given ID.static SubscriptionItemretrieve(java.lang.String item, SubscriptionItemRetrieveParams params, RequestOptions options)Retrieves the subscription item with the given ID.static SubscriptionItemretrieve(java.lang.String item, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Retrieves the subscription item with the given ID.voidsetBillingThresholds(SubscriptionItem.BillingThresholds billingThresholds)Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period.voidsetCreated(java.lang.Long created)Time at which the object was created.voidsetDeleted(java.lang.Boolean deleted)Always true for a deleted object.voidsetId(java.lang.String id)Unique identifier for the object.voidsetMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)Set of key-value pairs that you can attach to an object.voidsetObject(java.lang.String object)String representing the object's type.voidsetPlan(Plan plan)You can now model subscriptions more flexibly using the Prices API.voidsetPrice(Price price)Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products.voidsetQuantity(java.lang.Long quantity)The quantity of the plan to which the customer should be subscribed.voidsetSubscription(java.lang.String subscription)Thesubscriptionthissubscription_itembelongs to.voidsetTaxRates(java.util.List<TaxRate> taxRates)The tax rates which apply to thissubscription_item.SubscriptionItemupdate(SubscriptionItemUpdateParams params)Updates the plan or quantity of an item on a current subscription.SubscriptionItemupdate(SubscriptionItemUpdateParams params, RequestOptions options)Updates the plan or quantity of an item on a current subscription.SubscriptionItemupdate(java.util.Map<java.lang.String,java.lang.Object> params)Updates the plan or quantity of an item on a current subscription.SubscriptionItemupdate(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Updates the plan or quantity of an item on a current subscription.UsageRecordSummaryCollectionusageRecordSummaries()For the specified subscription item, returns a list of summary objects.UsageRecordSummaryCollectionusageRecordSummaries(SubscriptionItemUsageRecordSummariesParams params)For the specified subscription item, returns a list of summary objects.UsageRecordSummaryCollectionusageRecordSummaries(SubscriptionItemUsageRecordSummariesParams params, RequestOptions options)For the specified subscription item, returns a list of summary objects.UsageRecordSummaryCollectionusageRecordSummaries(java.util.Map<java.lang.String,java.lang.Object> params)For the specified subscription item, returns a list of summary objects.UsageRecordSummaryCollectionusageRecordSummaries(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)For the specified subscription item, returns a list of summary objects.-
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
-
list
public static SubscriptionItemCollection list(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Returns a list of your subscription items for a given subscription.- Throws:
StripeException
-
list
public static SubscriptionItemCollection list(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Returns a list of your subscription items for a given subscription.- Throws:
StripeException
-
list
public static SubscriptionItemCollection list(SubscriptionItemListParams params) throws StripeException
Returns a list of your subscription items for a given subscription.- Throws:
StripeException
-
list
public static SubscriptionItemCollection list(SubscriptionItemListParams params, RequestOptions options) throws StripeException
Returns a list of your subscription items for a given subscription.- Throws:
StripeException
-
retrieve
public static SubscriptionItem retrieve(java.lang.String item) throws StripeException
Retrieves the subscription item with the given ID.- Throws:
StripeException
-
retrieve
public static SubscriptionItem retrieve(java.lang.String item, RequestOptions options) throws StripeException
Retrieves the subscription item with the given ID.- Throws:
StripeException
-
retrieve
public static SubscriptionItem retrieve(java.lang.String item, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Retrieves the subscription item with the given ID.- Throws:
StripeException
-
retrieve
public static SubscriptionItem retrieve(java.lang.String item, SubscriptionItemRetrieveParams params, RequestOptions options) throws StripeException
Retrieves the subscription item with the given ID.- Throws:
StripeException
-
create
public static SubscriptionItem create(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Adds a new item to an existing subscription. No existing items will be changed or replaced.- Throws:
StripeException
-
create
public static SubscriptionItem create(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Adds a new item to an existing subscription. No existing items will be changed or replaced.- Throws:
StripeException
-
create
public static SubscriptionItem create(SubscriptionItemCreateParams params) throws StripeException
Adds a new item to an existing subscription. No existing items will be changed or replaced.- Throws:
StripeException
-
create
public static SubscriptionItem create(SubscriptionItemCreateParams params, RequestOptions options) throws StripeException
Adds a new item to an existing subscription. No existing items will be changed or replaced.- Throws:
StripeException
-
update
public SubscriptionItem update(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Updates the plan or quantity of an item on a current subscription.- Specified by:
updatein interfaceMetadataStore<SubscriptionItem>- Throws:
StripeException
-
update
public SubscriptionItem update(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Updates the plan or quantity of an item on a current subscription.- Specified by:
updatein interfaceMetadataStore<SubscriptionItem>- Throws:
StripeException
-
update
public SubscriptionItem update(SubscriptionItemUpdateParams params) throws StripeException
Updates the plan or quantity of an item on a current subscription.- Throws:
StripeException
-
update
public SubscriptionItem update(SubscriptionItemUpdateParams params, RequestOptions options) throws StripeException
Updates the plan or quantity of an item on a current subscription.- Throws:
StripeException
-
delete
public SubscriptionItem delete() throws StripeException
Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription.- Throws:
StripeException
-
delete
public SubscriptionItem delete(RequestOptions options) throws StripeException
Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription.- Throws:
StripeException
-
delete
public SubscriptionItem delete(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription.- Throws:
StripeException
-
delete
public SubscriptionItem delete(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription.- Throws:
StripeException
-
delete
public SubscriptionItem delete(SubscriptionItemDeleteParams params) throws StripeException
Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription.- Throws:
StripeException
-
delete
public SubscriptionItem delete(SubscriptionItemDeleteParams params, RequestOptions options) throws StripeException
Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription.- Throws:
StripeException
-
usageRecordSummaries
public UsageRecordSummaryCollection usageRecordSummaries() throws StripeException
For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that’s been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September).The list is sorted in reverse-chronological order (newest first). The first list item represents the most current usage period that hasn’t ended yet. Since new usage records can still be added, the returned summary information for the subscription item’s ID should be seen as unstable until the subscription billing period ends.
- Throws:
StripeException
-
usageRecordSummaries
public UsageRecordSummaryCollection usageRecordSummaries(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that’s been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September).The list is sorted in reverse-chronological order (newest first). The first list item represents the most current usage period that hasn’t ended yet. Since new usage records can still be added, the returned summary information for the subscription item’s ID should be seen as unstable until the subscription billing period ends.
- Throws:
StripeException
-
usageRecordSummaries
public UsageRecordSummaryCollection usageRecordSummaries(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that’s been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September).The list is sorted in reverse-chronological order (newest first). The first list item represents the most current usage period that hasn’t ended yet. Since new usage records can still be added, the returned summary information for the subscription item’s ID should be seen as unstable until the subscription billing period ends.
- Throws:
StripeException
-
usageRecordSummaries
public UsageRecordSummaryCollection usageRecordSummaries(SubscriptionItemUsageRecordSummariesParams params) throws StripeException
For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that’s been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September).The list is sorted in reverse-chronological order (newest first). The first list item represents the most current usage period that hasn’t ended yet. Since new usage records can still be added, the returned summary information for the subscription item’s ID should be seen as unstable until the subscription billing period ends.
- Throws:
StripeException
-
usageRecordSummaries
public UsageRecordSummaryCollection usageRecordSummaries(SubscriptionItemUsageRecordSummariesParams params, RequestOptions options) throws StripeException
For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that’s been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September).The list is sorted in reverse-chronological order (newest first). The first list item represents the most current usage period that hasn’t ended yet. Since new usage records can still be added, the returned summary information for the subscription item’s ID should be seen as unstable until the subscription billing period ends.
- Throws:
StripeException
-
getBillingThresholds
public SubscriptionItem.BillingThresholds getBillingThresholds()
Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period.
-
getCreated
public java.lang.Long getCreated()
Time at which the object was created. Measured in seconds since the Unix epoch.
-
getDeleted
public java.lang.Boolean getDeleted()
Always true for a deleted object.
-
getObject
public java.lang.String getObject()
String representing the object's type. Objects of the same type share the same value.Equal to
subscription_item.
-
getPlan
public Plan getPlan()
You can now model subscriptions more flexibly using the Prices API. It replaces the Plans API and is backwards compatible to simplify your migration.Plans define the base price, currency, and billing cycle for recurring purchases of products. Products help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme.
For example, you might have a single "gold" product that has plans for $10/month, $100/year, €9/month, and €90/year.
Related guides: Set up a subscription and more about products and prices.
-
getPrice
public Price getPrice()
Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products. Products help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme.For example, you might have a single "gold" product that has prices for $10/month, $100/year, and €9 once.
Related guides: Set up a subscription, create an invoice, and more about products and prices.
-
getQuantity
public java.lang.Long getQuantity()
The quantity of the plan to which the customer should be subscribed.
-
getSubscription
public java.lang.String getSubscription()
Thesubscriptionthissubscription_itembelongs to.
-
getTaxRates
public java.util.List<TaxRate> getTaxRates()
The tax rates which apply to thissubscription_item. When set, thedefault_tax_rateson the subscription do not apply to thissubscription_item.
-
setBillingThresholds
public void setBillingThresholds(SubscriptionItem.BillingThresholds billingThresholds)
Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period.
-
setCreated
public void setCreated(java.lang.Long created)
Time at which the object was created. Measured in seconds since the Unix epoch.
-
setDeleted
public void setDeleted(java.lang.Boolean deleted)
Always true for a deleted object.
-
setId
public void setId(java.lang.String id)
Unique identifier for the object.
-
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.
-
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_item.
-
setPlan
public void setPlan(Plan 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.Plans define the base price, currency, and billing cycle for recurring purchases of products. Products help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme.
For example, you might have a single "gold" product that has plans for $10/month, $100/year, €9/month, and €90/year.
Related guides: Set up a subscription and more about products and prices.
-
setPrice
public void setPrice(Price price)
Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products. Products help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme.For example, you might have a single "gold" product that has prices for $10/month, $100/year, and €9 once.
Related guides: Set up a subscription, create an invoice, and more about products and prices.
-
setQuantity
public void setQuantity(java.lang.Long quantity)
The quantity of the plan to which the customer should be subscribed.
-
setSubscription
public void setSubscription(java.lang.String subscription)
Thesubscriptionthissubscription_itembelongs to.
-
setTaxRates
public void setTaxRates(java.util.List<TaxRate> taxRates)
The tax rates which apply to thissubscription_item. When set, thedefault_tax_rateson the subscription do not apply to thissubscription_item.
-
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<SubscriptionItem>
-
-