Package com.stripe.model
Class Price
java.lang.Object
com.stripe.model.StripeObject
com.stripe.net.ApiResource
com.stripe.model.Price
- All Implemented Interfaces:
- HasId,- MetadataStore<Price>,- StripeActiveObject,- StripeObjectInterface
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.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classFor more details about CurrencyOption, please refer to the API Reference.static classFor more details about CustomUnitAmount, please refer to the API Reference.static classFor more details about MigrateTo, please refer to the API Reference.static classFor more details about Recurring, please refer to the API Reference.static classFor more details about Tier, please refer to the API Reference.static classFor more details about TransformQuantity, please refer to the API Reference.Nested classes/interfaces inherited from class com.stripe.net.ApiResourceApiResource.RequestMethod
- 
Field SummaryFields inherited from class com.stripe.net.ApiResourceCHARSET, GSON, INTERNAL_GSONFields inherited from class com.stripe.model.StripeObjectPRETTY_PRINT_GSON
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected booleanstatic Pricecreate(PriceCreateParams params) static Pricecreate(PriceCreateParams params, RequestOptions options) static Pricestatic Pricecreate(Map<String, Object> params, RequestOptions options) booleanWhether the price can be used for new purchases.Describes how to compute the price per period.Time at which the object was created.Three-letter ISO currency code, in lowercase.Prices defined in each available currency option.When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links.Always true for a deleted object.getId()Unique identifier for the object.Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.A lookup key used to retrieve prices dynamically from a static string.Set of key-value pairs that you can attach to an object.Subscriptions using this price will be migrated to use the new referenced price.A brief description of the price, hidden from customers.String representing the object's type.Get ID of expandableproductobject.Get expandedproduct.The recurring components of a price such asintervalandusage_type.Only required if a default tax behavior was not provided in the Stripe Tax settings.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.getType()One ofone_timeorrecurringdepending on whether the price is for a one-time purchase or a recurring (subscription) purchase.The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible.The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places.inthashCode()static PriceCollectionlist(PriceListParams params) Returns a list of your active prices, excluding inline prices.static PriceCollectionlist(PriceListParams params, RequestOptions options) Returns a list of your active prices, excluding inline prices.static PriceCollectionReturns a list of your active prices, excluding inline prices.static PriceCollectionlist(Map<String, Object> params, RequestOptions options) Returns a list of your active prices, excluding inline prices.static PriceRetrieves the price with the given ID.static Priceretrieve(String price, RequestOptions options) Retrieves the price with the given ID.static Priceretrieve(String price, PriceRetrieveParams params, RequestOptions options) Retrieves the price with the given ID.static PriceRetrieves the price with the given ID.static PriceSearchResultsearch(PriceSearchParams params) Search for prices you’ve previously created using Stripe’s Search Query Language.static PriceSearchResultsearch(PriceSearchParams params, RequestOptions options) Search for prices you’ve previously created using Stripe’s Search Query Language.static PriceSearchResultSearch for prices you’ve previously created using Stripe’s Search Query Language.static PriceSearchResultsearch(Map<String, Object> params, RequestOptions options) Search for prices you’ve previously created using Stripe’s Search Query Language.voidWhether the price can be used for new purchases.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.voidsetCurrencyOptions(Map<String, Price.CurrencyOption> currencyOptions) Prices defined in each available currency option.voidsetCustomUnitAmount(Price.CustomUnitAmount customUnitAmount) When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links.voidsetDeleted(Boolean deleted) Always true for a deleted object.voidUnique identifier for the object.voidsetLivemode(Boolean livemode) Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.voidsetLookupKey(String lookupKey) A lookup key used to retrieve prices dynamically from a static string.voidsetMetadata(Map<String, String> metadata) Set of key-value pairs that you can attach to an object.voidsetMigrateTo(Price.MigrateTo migrateTo) Subscriptions using this price will be migrated to use the new referenced price.voidsetNickname(String nickname) A brief description of the price, hidden from customers.voidString representing the object's type.voidsetProduct(String id) voidsetProductObject(Product expandableObject) voidsetRecurring(Price.Recurring recurring) The recurring components of a price such asintervalandusage_type.voidsetResponseGetter(StripeResponseGetter responseGetter) Method is used by the containing object orStripeResponseGetterimplementations to set theStripeResponseGetterinstance used to make further requests.voidsetTaxBehavior(String taxBehavior) Only required if a default tax behavior was not provided in the Stripe Tax settings.voidsetTiers(List<Price.Tier> tiers) Each element represents a pricing tier.voidsetTiersMode(String tiersMode) Defines if the tiering price should begraduatedorvolumebased.voidsetTransformQuantity(Price.TransformQuantity transformQuantity) Apply a transformation to the reported usage or set quantity before computing the amount billed.voidOne ofone_timeorrecurringdepending on whether the price is for a one-time purchase or a recurring (subscription) purchase.voidsetUnitAmount(Long unitAmount) The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible.voidsetUnitAmountDecimal(BigDecimal unitAmountDecimal) The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places.update(PriceUpdateParams params) Updates the specified price by setting the values of the parameters passed.update(PriceUpdateParams params, RequestOptions options) Updates the specified price by setting the values of the parameters passed.Updates the specified price by setting the values of the parameters passed.update(Map<String, Object> params, RequestOptions options) Updates the specified price by setting the values of the parameters passed.Methods inherited from class com.stripe.net.ApiResourcecheckNullTypedParams, getGlobalResponseGetter, getResponseGetter, setExpandableFieldId, setGlobalResponseGetter, urlEncode, urlEncodeIdMethods inherited from class com.stripe.model.StripeObjectdeserializeStripeObject, deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toStringMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.stripe.model.StripeActiveObjecttrySetResponseGetter
- 
Constructor Details- 
Pricepublic Price()
 
- 
- 
Method Details- 
getProductGet ID of expandableproductobject.
- 
setProduct
- 
getProductObjectGet expandedproduct.
- 
setProductObject
- 
create- Throws:
- StripeException
 
- 
createpublic static Price create(Map<String, Object> params, RequestOptions options) throws StripeException- Throws:
- StripeException
 
- 
create- Throws:
- StripeException
 
- 
create- Throws:
- StripeException
 
- 
listReturns a list of your active prices, excluding inline prices. For the list of inactive prices, setactiveto false.- Throws:
- StripeException
 
- 
listpublic static PriceCollection list(Map<String, Object> params, RequestOptions options) throws StripeExceptionReturns a list of your active prices, excluding inline prices. For the list of inactive prices, setactiveto false.- Throws:
- StripeException
 
- 
listReturns a list of your active prices, excluding inline prices. For the list of inactive prices, setactiveto false.- Throws:
- StripeException
 
- 
listpublic static PriceCollection list(PriceListParams params, RequestOptions options) throws StripeException Returns a list of your active prices, excluding inline prices. For the list of inactive prices, setactiveto false.- Throws:
- StripeException
 
- 
retrieveRetrieves the price with the given ID.- Throws:
- StripeException
 
- 
retrieveRetrieves the price with the given ID.- Throws:
- StripeException
 
- 
retrievepublic static Price retrieve(String price, Map<String, Object> params, RequestOptions options) throws StripeExceptionRetrieves the price with the given ID.- Throws:
- StripeException
 
- 
retrievepublic static Price retrieve(String price, PriceRetrieveParams params, RequestOptions options) throws StripeException Retrieves the price with the given ID.- Throws:
- StripeException
 
- 
searchSearch for prices you’ve previously created using Stripe’s Search Query Language. Don’t use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India.- Throws:
- StripeException
 
- 
searchpublic static PriceSearchResult search(Map<String, Object> params, RequestOptions options) throws StripeExceptionSearch for prices you’ve previously created using Stripe’s Search Query Language. Don’t use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India.- Throws:
- StripeException
 
- 
searchSearch for prices you’ve previously created using Stripe’s Search Query Language. Don’t use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India.- Throws:
- StripeException
 
- 
searchpublic static PriceSearchResult search(PriceSearchParams params, RequestOptions options) throws StripeException Search for prices you’ve previously created using Stripe’s Search Query Language. Don’t use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India.- Throws:
- StripeException
 
- 
updateUpdates the specified price by setting the values of the parameters passed. Any parameters not provided are left unchanged.- Specified by:
- updatein interface- MetadataStore<Price>
- Throws:
- StripeException
 
- 
updateUpdates the specified price by setting the values of the parameters passed. Any parameters not provided are left unchanged.- Specified by:
- updatein interface- MetadataStore<Price>
- Throws:
- StripeException
 
- 
updateUpdates the specified price by setting the values of the parameters passed. Any parameters not provided are left unchanged.- Throws:
- StripeException
 
- 
updateUpdates the specified price by setting the values of the parameters passed. Any parameters not provided are left unchanged.- Throws:
- StripeException
 
- 
setResponseGetterDescription copied from interface:StripeActiveObjectMethod is used by the containing object orStripeResponseGetterimplementations to set theStripeResponseGetterinstance used to make further requests.- Specified by:
- setResponseGetterin interface- StripeActiveObject
- Overrides:
- setResponseGetterin class- ApiResource
- Parameters:
- responseGetter- the- StripeResponseGetterinstance to use for making further requests.
 
- 
getActiveWhether the price can be used for new purchases.
- 
getBillingSchemeDescribes how to compute the price per period. Eitherper_unitortiered.per_unitindicates that the fixed amount (specified inunit_amountorunit_amount_decimal) will be charged per unit inquantity(for prices withusage_type=licensed), or per unit of total usage (for prices 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.
- 
getCreatedTime at which the object was created. Measured in seconds since the Unix epoch.
- 
getCurrencyThree-letter ISO currency code, in lowercase. Must be a supported currency.
- 
getCurrencyOptionsPrices defined in each available currency option. Each key must be a three-letter ISO currency code and a supported currency.
- 
getCustomUnitAmountWhen set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links.
- 
getDeletedAlways true for a deleted object.
- 
getLivemodeHas the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.
- 
getLookupKeyA lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters.
- 
getMigrateToSubscriptions using this price will be migrated to use the new referenced price.
- 
getNicknameA brief description of the price, hidden from customers.
- 
getObjectString representing the object's type. Objects of the same type share the same value.Equal to price.
- 
getRecurringThe recurring components of a price such asintervalandusage_type.
- 
getTaxBehaviorOnly required if a default tax behavior was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One ofinclusive,exclusive, orunspecified. Once specified as eitherinclusiveorexclusive, it cannot be changed.
- 
getTiersEach element represents a pricing tier. This parameter requiresbilling_schemeto be set totiered. See also the documentation forbilling_scheme.
- 
getTiersModeDefines 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.
- 
getTransformQuantityApply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined withtiers.
- 
getTypeOne ofone_timeorrecurringdepending on whether the price is for a one-time purchase or a recurring (subscription) purchase.
- 
getUnitAmountThe unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. Only set ifbilling_scheme=per_unit.
- 
getUnitAmountDecimalThe unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. Only set ifbilling_scheme=per_unit.
- 
setActiveWhether the price can be used for new purchases.
- 
setBillingSchemeDescribes how to compute the price per period. Eitherper_unitortiered.per_unitindicates that the fixed amount (specified inunit_amountorunit_amount_decimal) will be charged per unit inquantity(for prices withusage_type=licensed), or per unit of total usage (for prices 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.
- 
setCreatedTime at which the object was created. Measured in seconds since the Unix epoch.
- 
setCurrencyThree-letter ISO currency code, in lowercase. Must be a supported currency.
- 
setCurrencyOptionsPrices defined in each available currency option. Each key must be a three-letter ISO currency code and a supported currency.
- 
setCustomUnitAmountWhen set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links.
- 
setDeletedAlways true for a deleted object.
- 
setIdUnique identifier for the object.
- 
setLivemodeHas the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.
- 
setLookupKeyA lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters.
- 
setMetadataSet 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.
- 
setMigrateToSubscriptions using this price will be migrated to use the new referenced price.
- 
setNicknameA brief description of the price, hidden from customers.
- 
setObjectString representing the object's type. Objects of the same type share the same value.Equal to price.
- 
setRecurringThe recurring components of a price such asintervalandusage_type.
- 
setTaxBehaviorOnly required if a default tax behavior was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One ofinclusive,exclusive, orunspecified. Once specified as eitherinclusiveorexclusive, it cannot be changed.
- 
setTiersEach element represents a pricing tier. This parameter requiresbilling_schemeto be set totiered. See also the documentation forbilling_scheme.
- 
setTiersModeDefines 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.
- 
setTransformQuantityApply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined withtiers.
- 
setTypeOne ofone_timeorrecurringdepending on whether the price is for a one-time purchase or a recurring (subscription) purchase.
- 
setUnitAmountThe unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. Only set ifbilling_scheme=per_unit.
- 
setUnitAmountDecimalThe unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. Only set ifbilling_scheme=per_unit.
- 
equals
- 
canEqual
- 
hashCodepublic int hashCode()
- 
getIdUnique identifier for the object.
- 
getMetadataSet 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 interface- MetadataStore<Price>
 
 
-