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>,StripeObjectInterface
public class Price extends ApiResource implements HasId, MetadataStore<Price>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPrice.Recurringstatic classPrice.Tierstatic classPrice.TransformQuantity-
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 Price()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(java.lang.Object other)static Pricecreate(PriceCreateParams params)Creates a new price for an existing product.static Pricecreate(PriceCreateParams params, RequestOptions options)Creates a new price for an existing product.static Pricecreate(java.util.Map<java.lang.String,java.lang.Object> params)Creates a new price for an existing product.static Pricecreate(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Creates a new price for an existing product.booleanequals(java.lang.Object o)java.lang.BooleangetActive()Whether the price can be used for new purchases.java.lang.StringgetBillingScheme()Describes how to compute the price per period.java.lang.LonggetCreated()Time at which the object was created.java.lang.StringgetCurrency()Three-letter ISO currency code, in lowercase.java.lang.BooleangetDeleted()Always true for a deleted object.java.lang.StringgetId()Unique identifier for the object.java.lang.BooleangetLivemode()Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.java.lang.StringgetLookupKey()A lookup key used to retrieve prices dynamically from a static string.java.util.Map<java.lang.String,java.lang.String>getMetadata()Set of key-value pairs that you can attach to an object.java.lang.StringgetNickname()A brief description of the price, hidden from customers.java.lang.StringgetObject()String representing the object's type.java.lang.StringgetProduct()Get ID of expandableproductobject.ProductgetProductObject()Get expandedproduct.Price.RecurringgetRecurring()The recurring components of a price such asintervalandusage_type.java.lang.StringgetTaxBehavior()Specifies whether the price is considered inclusive of taxes or exclusive of taxes.java.util.List<Price.Tier>getTiers()Each element represents a pricing tier.java.lang.StringgetTiersMode()Defines if the tiering price should begraduatedorvolumebased.Price.TransformQuantitygetTransformQuantity()Apply a transformation to the reported usage or set quantity before computing the amount billed.java.lang.StringgetType()One ofone_timeorrecurringdepending on whether the price is for a one-time purchase or a recurring (subscription) purchase.java.lang.LonggetUnitAmount()The unit amount in %s to be charged, represented as a whole integer if possible.java.math.BigDecimalgetUnitAmountDecimal()The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places.inthashCode()static PriceCollectionlist(PriceListParams params)Returns a list of your prices.static PriceCollectionlist(PriceListParams params, RequestOptions options)Returns a list of your prices.static PriceCollectionlist(java.util.Map<java.lang.String,java.lang.Object> params)Returns a list of your prices.static PriceCollectionlist(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Returns a list of your prices.static Priceretrieve(java.lang.String price)Retrieves the price with the given ID.static Priceretrieve(java.lang.String price, RequestOptions options)Retrieves the price with the given ID.static Priceretrieve(java.lang.String price, PriceRetrieveParams params, RequestOptions options)Retrieves the price with the given ID.static Priceretrieve(java.lang.String price, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Retrieves the price with the given ID.voidsetActive(java.lang.Boolean active)Whether the price can be used for new purchases.voidsetBillingScheme(java.lang.String billingScheme)Describes how to compute the price per period.voidsetCreated(java.lang.Long created)Time at which the object was created.voidsetCurrency(java.lang.String currency)Three-letter ISO currency code, in lowercase.voidsetDeleted(java.lang.Boolean deleted)Always true for a deleted object.voidsetId(java.lang.String id)Unique identifier for the object.voidsetLivemode(java.lang.Boolean livemode)Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.voidsetLookupKey(java.lang.String lookupKey)A lookup key used to retrieve prices dynamically from a static string.voidsetMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)Set of key-value pairs that you can attach to an object.voidsetNickname(java.lang.String nickname)A brief description of the price, hidden from customers.voidsetObject(java.lang.String object)String representing the object's type.voidsetProduct(java.lang.String id)voidsetProductObject(Product expandableObject)voidsetRecurring(Price.Recurring recurring)The recurring components of a price such asintervalandusage_type.voidsetTaxBehavior(java.lang.String taxBehavior)Specifies whether the price is considered inclusive of taxes or exclusive of taxes.voidsetTiers(java.util.List<Price.Tier> tiers)Each element represents a pricing tier.voidsetTiersMode(java.lang.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.voidsetType(java.lang.String type)One ofone_timeorrecurringdepending on whether the price is for a one-time purchase or a recurring (subscription) purchase.voidsetUnitAmount(java.lang.Long unitAmount)The unit amount in %s to be charged, represented as a whole integer if possible.voidsetUnitAmountDecimal(java.math.BigDecimal unitAmountDecimal)The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places.Priceupdate(PriceUpdateParams params)Updates the specified price by setting the values of the parameters passed.Priceupdate(PriceUpdateParams params, RequestOptions options)Updates the specified price by setting the values of the parameters passed.Priceupdate(java.util.Map<java.lang.String,java.lang.Object> params)Updates the specified price by setting the values of the parameters passed.Priceupdate(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Updates the specified price 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, setExpandableFieldId, setStripeResponseGetter, singleClassUrl, singleClassUrl, subresourceUrl, urlEncode, urlEncodeId
-
Methods inherited from class com.stripe.model.StripeObject
equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toString
-
-
-
-
Method Detail
-
getProduct
public java.lang.String getProduct()
Get ID of expandableproductobject.
-
setProduct
public void setProduct(java.lang.String id)
-
getProductObject
public Product getProductObject()
Get expandedproduct.
-
setProductObject
public void setProductObject(Product expandableObject)
-
list
public static PriceCollection list(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Returns a list of your prices.- Throws:
StripeException
-
list
public static PriceCollection list(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Returns a list of your prices.- Throws:
StripeException
-
list
public static PriceCollection list(PriceListParams params) throws StripeException
Returns a list of your prices.- Throws:
StripeException
-
list
public static PriceCollection list(PriceListParams params, RequestOptions options) throws StripeException
Returns a list of your prices.- Throws:
StripeException
-
create
public static Price create(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Creates a new price for an existing product. The price can be recurring or one-time.- Throws:
StripeException
-
create
public static Price create(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Creates a new price for an existing product. The price can be recurring or one-time.- Throws:
StripeException
-
create
public static Price create(PriceCreateParams params) throws StripeException
Creates a new price for an existing product. The price can be recurring or one-time.- Throws:
StripeException
-
create
public static Price create(PriceCreateParams params, RequestOptions options) throws StripeException
Creates a new price for an existing product. The price can be recurring or one-time.- Throws:
StripeException
-
retrieve
public static Price retrieve(java.lang.String price) throws StripeException
Retrieves the price with the given ID.- Throws:
StripeException
-
retrieve
public static Price retrieve(java.lang.String price, RequestOptions options) throws StripeException
Retrieves the price with the given ID.- Throws:
StripeException
-
retrieve
public static Price retrieve(java.lang.String price, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Retrieves the price with the given ID.- Throws:
StripeException
-
retrieve
public static Price retrieve(java.lang.String price, PriceRetrieveParams params, RequestOptions options) throws StripeException
Retrieves the price with the given ID.- Throws:
StripeException
-
update
public Price update(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Updates the specified price by setting the values of the parameters passed. Any parameters not provided are left unchanged.- Specified by:
updatein interfaceMetadataStore<Price>- Throws:
StripeException
-
update
public Price update(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Updates the specified price by setting the values of the parameters passed. Any parameters not provided are left unchanged.- Specified by:
updatein interfaceMetadataStore<Price>- Throws:
StripeException
-
update
public Price update(PriceUpdateParams params) throws StripeException
Updates the specified price by setting the values of the parameters passed. Any parameters not provided are left unchanged.- Throws:
StripeException
-
update
public Price update(PriceUpdateParams params, RequestOptions options) throws StripeException
Updates the specified price by setting the values of the parameters passed. Any parameters not provided are left unchanged.- Throws:
StripeException
-
getActive
public java.lang.Boolean getActive()
Whether the price can be used for new purchases.
-
getBillingScheme
public java.lang.String getBillingScheme()
Describes 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.
-
getCreated
public java.lang.Long getCreated()
Time at which the object was created. Measured in seconds since the Unix epoch.
-
getCurrency
public java.lang.String getCurrency()
Three-letter ISO currency code, in lowercase. Must be a supported currency.
-
getDeleted
public java.lang.Boolean getDeleted()
Always true for a deleted object.
-
getLivemode
public java.lang.Boolean getLivemode()
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.
-
getLookupKey
public java.lang.String getLookupKey()
A lookup key used to retrieve prices dynamically from a static string.
-
getNickname
public java.lang.String getNickname()
A brief description of the price, hidden from customers.
-
getObject
public java.lang.String getObject()
String representing the object's type. Objects of the same type share the same value.Equal to
price.
-
getRecurring
public Price.Recurring getRecurring()
The recurring components of a price such asintervalandusage_type.
-
getTaxBehavior
public java.lang.String getTaxBehavior()
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.
-
getTiers
public java.util.List<Price.Tier> getTiers()
Each element represents a pricing tier. This parameter requiresbilling_schemeto be set totiered. See also the documentation forbilling_scheme.
-
getTiersMode
public java.lang.String 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.
-
getTransformQuantity
public Price.TransformQuantity getTransformQuantity()
Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined withtiers.
-
getType
public java.lang.String getType()
One ofone_timeorrecurringdepending on whether the price is for a one-time purchase or a recurring (subscription) purchase.
-
getUnitAmount
public java.lang.Long getUnitAmount()
The unit amount in %s to be charged, represented as a whole integer if possible. Only set ifbilling_scheme=per_unit.
-
getUnitAmountDecimal
public java.math.BigDecimal getUnitAmountDecimal()
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.
-
setActive
public void setActive(java.lang.Boolean active)
Whether the price can be used for new purchases.
-
setBillingScheme
public void setBillingScheme(java.lang.String billingScheme)
Describes 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.
-
setCreated
public void setCreated(java.lang.Long created)
Time at which the object was created. Measured in seconds since the Unix epoch.
-
setCurrency
public void setCurrency(java.lang.String currency)
Three-letter ISO currency code, in lowercase. Must be a supported currency.
-
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.
-
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.
-
setLookupKey
public void setLookupKey(java.lang.String lookupKey)
A lookup key used to retrieve prices dynamically from a static string.
-
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.
-
setNickname
public void setNickname(java.lang.String nickname)
A brief description of the price, hidden from customers.
-
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
price.
-
setRecurring
public void setRecurring(Price.Recurring recurring)
The recurring components of a price such asintervalandusage_type.
-
setTaxBehavior
public void setTaxBehavior(java.lang.String taxBehavior)
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.
-
setTiers
public void setTiers(java.util.List<Price.Tier> tiers)
Each element represents a pricing tier. This parameter requiresbilling_schemeto be set totiered. See also the documentation forbilling_scheme.
-
setTiersMode
public void setTiersMode(java.lang.String tiersMode)
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.
-
setTransformQuantity
public void setTransformQuantity(Price.TransformQuantity transformQuantity)
Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined withtiers.
-
setType
public void setType(java.lang.String type)
One ofone_timeorrecurringdepending on whether the price is for a one-time purchase or a recurring (subscription) purchase.
-
setUnitAmount
public void setUnitAmount(java.lang.Long unitAmount)
The unit amount in %s to be charged, represented as a whole integer if possible. Only set ifbilling_scheme=per_unit.
-
setUnitAmountDecimal
public void setUnitAmountDecimal(java.math.BigDecimal unitAmountDecimal)
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.
-
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<Price>
-
-