Package com.stripe.model
Class Plan
java.lang.Object
com.stripe.model.StripeObject
com.stripe.net.ApiResource
com.stripe.model.Plan
- All Implemented Interfaces:
HasId,MetadataStore<Plan>,StripeObjectInterface
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.stripe.net.ApiResource
ApiResource.RequestMethod -
Field Summary
Fields inherited from class com.stripe.net.ApiResource
CHARSET, GSONFields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanstatic Plancreate(PlanCreateParams params) You can now model subscriptions more flexibly using the Prices API.static Plancreate(PlanCreateParams params, RequestOptions options) You can now model subscriptions more flexibly using the Prices API.static PlanYou can now model subscriptions more flexibly using the Prices API.static Plancreate(Map<String, Object> params, RequestOptions options) You can now model subscriptions more flexibly using the Prices API.delete()Deleting plans means new subscribers can’t be added.delete(RequestOptions options) Deleting plans means new subscribers can’t be added.Deleting plans means new subscribers can’t be added.delete(Map<String, Object> params, RequestOptions options) Deleting plans means new subscribers can’t be added.booleanWhether the plan can be used for new purchases.Specifies a usage aggregation strategy for plans ofusage_type=metered.The unit amount in %s to be charged, represented as a whole integer if possible.The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places.Describes how to compute the price per period.Time at which the object was created.Three-letter ISO currency code, in lowercase.Always true for a deleted object.getId()Unique identifier for the object.The frequency at which a subscription is billed.The number of intervals (specified in theintervalattribute) between subscription billings.Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.Set of key-value pairs that you can attach to an object.A brief description of the plan, hidden from customers.String representing the object's type.Get ID of expandableproductobject.Get expandedproduct.getTiers()Each element represents a pricing tier.Defines if the tiering price should begraduatedorvolumebased.Apply a transformation to the reported usage or set quantity before computing the amount billed.Default number of trial days when subscribing a customer to this plan usingtrial_from_plan=true.Configures how the quantity per period should be determined.inthashCode()static PlanCollectionlist(PlanListParams params) Returns a list of your plans.static PlanCollectionlist(PlanListParams params, RequestOptions options) Returns a list of your plans.static PlanCollectionReturns a list of your plans.static PlanCollectionlist(Map<String, Object> params, RequestOptions options) Returns a list of your plans.static PlanRetrieves the plan with the given ID.static Planretrieve(String plan, RequestOptions options) Retrieves the plan with the given ID.static Planretrieve(String plan, PlanRetrieveParams params, RequestOptions options) Retrieves the plan with the given ID.static PlanRetrieves the plan with the given ID.voidWhether the plan can be used for new purchases.voidsetAggregateUsage(String aggregateUsage) Specifies a usage aggregation strategy for plans ofusage_type=metered.voidThe unit amount in %s to be charged, represented as a whole integer if possible.voidsetAmountDecimal(BigDecimal amountDecimal) The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places.voidsetBillingScheme(String billingScheme) Describes how to compute the price per period.voidsetCreated(Long created) Time at which the object was created.voidsetCurrency(String currency) Three-letter ISO currency code, in lowercase.voidsetDeleted(Boolean deleted) Always true for a deleted object.voidUnique identifier for the object.voidsetInterval(String interval) The frequency at which a subscription is billed.voidsetIntervalCount(Long intervalCount) The number of intervals (specified in theintervalattribute) between subscription billings.voidsetLivemode(Boolean livemode) Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.voidsetMetadata(Map<String, String> metadata) Set of key-value pairs that you can attach to an object.voidsetNickname(String nickname) A brief description of the plan, hidden from customers.voidString representing the object's type.voidsetProduct(String id) voidsetProductObject(Product expandableObject) voidEach element represents a pricing tier.voidsetTiersMode(String tiersMode) Defines if the tiering price should begraduatedorvolumebased.voidsetTransformUsage(Plan.TransformUsage transformUsage) Apply a transformation to the reported usage or set quantity before computing the amount billed.voidsetTrialPeriodDays(Long trialPeriodDays) Default number of trial days when subscribing a customer to this plan usingtrial_from_plan=true.voidsetUsageType(String usageType) Configures how the quantity per period should be determined.update(PlanUpdateParams params) Updates the specified plan by setting the values of the parameters passed.update(PlanUpdateParams params, RequestOptions options) Updates the specified plan by setting the values of the parameters passed.Updates the specified plan by setting the values of the parameters passed.update(Map<String, Object> params, RequestOptions options) Updates the specified plan by setting the values of the parameters passed.Methods inherited from class com.stripe.net.ApiResource
checkNullTypedParams, classUrl, classUrl, instanceUrl, instanceUrl, request, request, requestCollection, requestCollection, requestSearchResult, requestSearchResult, requestStream, requestStream, setExpandableFieldId, setStripeResponseGetter, singleClassUrl, singleClassUrl, subresourceUrl, urlEncode, urlEncodeIdMethods inherited from class com.stripe.model.StripeObject
equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toString
-
Constructor Details
-
Plan
public Plan()
-
-
Method Details
-
getProduct
Get ID of expandableproductobject. -
setProduct
-
getProductObject
Get expandedproduct. -
setProductObject
-
list
Returns a list of your plans.- Throws:
StripeException
-
list
public static PlanCollection list(Map<String, Object> params, RequestOptions options) throws StripeExceptionReturns a list of your plans.- Throws:
StripeException
-
list
Returns a list of your plans.- Throws:
StripeException
-
list
public static PlanCollection list(PlanListParams params, RequestOptions options) throws StripeException Returns a list of your plans.- Throws:
StripeException
-
create
You can now model subscriptions more flexibly using the Prices API. It replaces the Plans API and is backwards compatible to simplify your migration.- Throws:
StripeException
-
create
You can now model subscriptions more flexibly using the Prices API. It replaces the Plans API and is backwards compatible to simplify your migration.- Throws:
StripeException
-
create
You can now model subscriptions more flexibly using the Prices API. It replaces the Plans API and is backwards compatible to simplify your migration.- Throws:
StripeException
-
create
You can now model subscriptions more flexibly using the Prices API. It replaces the Plans API and is backwards compatible to simplify your migration.- Throws:
StripeException
-
retrieve
Retrieves the plan with the given ID.- Throws:
StripeException
-
retrieve
Retrieves the plan with the given ID.- Throws:
StripeException
-
retrieve
public static Plan retrieve(String plan, Map<String, Object> params, RequestOptions options) throws StripeExceptionRetrieves the plan with the given ID.- Throws:
StripeException
-
retrieve
public static Plan retrieve(String plan, PlanRetrieveParams params, RequestOptions options) throws StripeException Retrieves the plan with the given ID.- Throws:
StripeException
-
update
Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan’s ID, amount, currency, or billing cycle.- Specified by:
updatein interfaceMetadataStore<Plan>- Throws:
StripeException
-
update
Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan’s ID, amount, currency, or billing cycle.- Specified by:
updatein interfaceMetadataStore<Plan>- Throws:
StripeException
-
update
Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan’s ID, amount, currency, or billing cycle.- Throws:
StripeException
-
update
Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan’s ID, amount, currency, or billing cycle.- Throws:
StripeException
-
delete
Deleting plans means new subscribers can’t be added. Existing subscribers aren’t affected.- Throws:
StripeException
-
delete
Deleting plans means new subscribers can’t be added. Existing subscribers aren’t affected.- Throws:
StripeException
-
delete
Deleting plans means new subscribers can’t be added. Existing subscribers aren’t affected.- Throws:
StripeException
-
delete
Deleting plans means new subscribers can’t be added. Existing subscribers aren’t affected.- Throws:
StripeException
-
getActive
Whether the plan can be used for new purchases. -
getAggregateUsage
Specifies a usage aggregation strategy for plans ofusage_type=metered. Allowed values aresumfor summing up all usage during a period,last_during_periodfor using the last usage record reported within a period,last_everfor using the last usage record ever (across period bounds) ormaxwhich uses the usage record with the maximum reported usage during a period. Defaults tosum.One of
last_during_period,last_ever,max, orsum. -
getAmount
The unit amount in %s to be charged, represented as a whole integer if possible. Only set ifbilling_scheme=per_unit. -
getAmountDecimal
The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places. Only set ifbilling_scheme=per_unit. -
getBillingScheme
Describes how to compute the price per period. Eitherper_unitortiered.per_unitindicates that the fixed amount (specified inamount) will be charged per unit inquantity(for plans withusage_type=licensed), or per unit of total usage (for plans withusage_type=metered).tieredindicates that the unit pricing will be computed using a tiering strategy as defined using thetiersandtiers_modeattributes.One of
per_unit, ortiered. -
getCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
getCurrency
Three-letter ISO currency code, in lowercase. Must be a supported currency. -
getDeleted
Always true for a deleted object. -
getInterval
The frequency at which a subscription is billed. One ofday,week,monthoryear. -
getIntervalCount
The number of intervals (specified in theintervalattribute) between subscription billings. For example,interval=monthandinterval_count=3bills every 3 months. -
getLivemode
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode. -
getNickname
A brief description of the plan, hidden from customers. -
getObject
String representing the object's type. Objects of the same type share the same value.Equal to
plan. -
getTiers
Each element represents a pricing tier. This parameter requiresbilling_schemeto be set totiered. See also the documentation forbilling_scheme. -
getTiersMode
Defines if the tiering price should begraduatedorvolumebased. Involume-based tiering, the maximum quantity within a period determines the per unit price. Ingraduatedtiering, pricing can change as the quantity grows.One of
graduated, orvolume. -
getTransformUsage
Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined withtiers. -
getTrialPeriodDays
Default number of trial days when subscribing a customer to this plan usingtrial_from_plan=true. -
getUsageType
Configures how the quantity per period should be determined. Can be eithermeteredorlicensed.licensedautomatically bills thequantityset when adding it to a subscription.meteredaggregates the total usage based on usage records. Defaults tolicensed. -
setActive
Whether the plan can be used for new purchases. -
setAggregateUsage
Specifies a usage aggregation strategy for plans ofusage_type=metered. Allowed values aresumfor summing up all usage during a period,last_during_periodfor using the last usage record reported within a period,last_everfor using the last usage record ever (across period bounds) ormaxwhich uses the usage record with the maximum reported usage during a period. Defaults tosum.One of
last_during_period,last_ever,max, orsum. -
setAmount
The unit amount in %s to be charged, represented as a whole integer if possible. Only set ifbilling_scheme=per_unit. -
setAmountDecimal
The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places. Only set ifbilling_scheme=per_unit. -
setBillingScheme
Describes how to compute the price per period. Eitherper_unitortiered.per_unitindicates that the fixed amount (specified inamount) will be charged per unit inquantity(for plans withusage_type=licensed), or per unit of total usage (for plans withusage_type=metered).tieredindicates that the unit pricing will be computed using a tiering strategy as defined using thetiersandtiers_modeattributes.One of
per_unit, ortiered. -
setCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
setCurrency
Three-letter ISO currency code, in lowercase. Must be a supported currency. -
setDeleted
Always true for a deleted object. -
setId
Unique identifier for the object. -
setInterval
The frequency at which a subscription is billed. One ofday,week,monthoryear. -
setIntervalCount
The number of intervals (specified in theintervalattribute) between subscription billings. For example,interval=monthandinterval_count=3bills every 3 months. -
setLivemode
Has the valuetrueif the object exists in live mode or the valuefalseif 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. -
setNickname
A brief description of the plan, hidden from customers. -
setObject
String representing the object's type. Objects of the same type share the same value.Equal to
plan. -
setTiers
Each element represents a pricing tier. This parameter requiresbilling_schemeto be set totiered. See also the documentation forbilling_scheme. -
setTiersMode
Defines if the tiering price should begraduatedorvolumebased. Involume-based tiering, the maximum quantity within a period determines the per unit price. Ingraduatedtiering, pricing can change as the quantity grows.One of
graduated, orvolume. -
setTransformUsage
Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined withtiers. -
setTrialPeriodDays
Default number of trial days when subscribing a customer to this plan usingtrial_from_plan=true. -
setUsageType
Configures how the quantity per period should be determined. Can be eithermeteredorlicensed.licensedautomatically bills thequantityset when adding it to a subscription.meteredaggregates the total usage based on usage records. Defaults tolicensed. -
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:
getMetadatain interfaceMetadataStore<Plan>
-