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 class
Price.Recurring
static class
Price.Tier
static class
Price.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 boolean
canEqual(java.lang.Object other)
static Price
create(PriceCreateParams params)
Creates a new price for an existing product.static Price
create(PriceCreateParams params, RequestOptions options)
Creates a new price for an existing product.static Price
create(java.util.Map<java.lang.String,java.lang.Object> params)
Creates a new price for an existing product.static Price
create(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)
Creates a new price for an existing product.boolean
equals(java.lang.Object o)
java.lang.Boolean
getActive()
Whether the price can be used for new purchases.java.lang.String
getBillingScheme()
Describes how to compute the price per period.java.lang.Long
getCreated()
Time at which the object was created.java.lang.String
getCurrency()
Three-letter ISO currency code, in lowercase.java.lang.Boolean
getDeleted()
Always true for a deleted object.java.lang.String
getId()
Unique identifier for the object.java.lang.Boolean
getLivemode()
Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode.java.lang.String
getLookupKey()
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.String
getNickname()
A brief description of the price, hidden from customers.java.lang.String
getObject()
String representing the object's type.java.lang.String
getProduct()
Get ID of expandableproduct
object.Product
getProductObject()
Get expandedproduct
.Price.Recurring
getRecurring()
The recurring components of a price such asinterval
andusage_type
.java.lang.String
getTaxBehavior()
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.String
getTiersMode()
Defines if the tiering price should begraduated
orvolume
based.Price.TransformQuantity
getTransformQuantity()
Apply a transformation to the reported usage or set quantity before computing the amount billed.java.lang.String
getType()
One ofone_time
orrecurring
depending on whether the price is for a one-time purchase or a recurring (subscription) purchase.java.lang.Long
getUnitAmount()
The unit amount in %s to be charged, represented as a whole integer if possible.java.math.BigDecimal
getUnitAmountDecimal()
The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places.int
hashCode()
static PriceCollection
list(PriceListParams params)
Returns a list of your prices.static PriceCollection
list(PriceListParams params, RequestOptions options)
Returns a list of your prices.static PriceCollection
list(java.util.Map<java.lang.String,java.lang.Object> params)
Returns a list of your prices.static PriceCollection
list(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)
Returns a list of your prices.static Price
retrieve(java.lang.String price)
Retrieves the price with the given ID.static Price
retrieve(java.lang.String price, RequestOptions options)
Retrieves the price with the given ID.static Price
retrieve(java.lang.String price, PriceRetrieveParams params, RequestOptions options)
Retrieves the price with the given ID.static Price
retrieve(java.lang.String price, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)
Retrieves the price with the given ID.void
setActive(java.lang.Boolean active)
Whether the price can be used for new purchases.void
setBillingScheme(java.lang.String billingScheme)
Describes how to compute the price per period.void
setCreated(java.lang.Long created)
Time at which the object was created.void
setCurrency(java.lang.String currency)
Three-letter ISO currency code, in lowercase.void
setDeleted(java.lang.Boolean deleted)
Always true for a deleted object.void
setId(java.lang.String id)
Unique identifier for the object.void
setLivemode(java.lang.Boolean livemode)
Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode.void
setLookupKey(java.lang.String lookupKey)
A lookup key used to retrieve prices dynamically from a static string.void
setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
Set of key-value pairs that you can attach to an object.void
setNickname(java.lang.String nickname)
A brief description of the price, hidden from customers.void
setObject(java.lang.String object)
String representing the object's type.void
setProduct(java.lang.String id)
void
setProductObject(Product expandableObject)
void
setRecurring(Price.Recurring recurring)
The recurring components of a price such asinterval
andusage_type
.void
setTaxBehavior(java.lang.String taxBehavior)
Specifies whether the price is considered inclusive of taxes or exclusive of taxes.void
setTiers(java.util.List<Price.Tier> tiers)
Each element represents a pricing tier.void
setTiersMode(java.lang.String tiersMode)
Defines if the tiering price should begraduated
orvolume
based.void
setTransformQuantity(Price.TransformQuantity transformQuantity)
Apply a transformation to the reported usage or set quantity before computing the amount billed.void
setType(java.lang.String type)
One ofone_time
orrecurring
depending on whether the price is for a one-time purchase or a recurring (subscription) purchase.void
setUnitAmount(java.lang.Long unitAmount)
The unit amount in %s to be charged, represented as a whole integer if possible.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.Price
update(PriceUpdateParams params)
Updates the specified price by setting the values of the parameters passed.Price
update(PriceUpdateParams params, RequestOptions options)
Updates the specified price by setting the values of the parameters passed.Price
update(java.util.Map<java.lang.String,java.lang.Object> params)
Updates the specified price by setting the values of the parameters passed.Price
update(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 expandableproduct
object.
-
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:
update
in 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:
update
in 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_unit
ortiered
.per_unit
indicates that the fixed amount (specified inunit_amount
orunit_amount_decimal
) will be charged per unit inquantity
(for prices withusage_type=licensed
), or per unit of total usage (for prices withusage_type=metered
).tiered
indicates that the unit pricing will be computed using a tiering strategy as defined using thetiers
andtiers_mode
attributes.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 valuetrue
if the object exists in live mode or the valuefalse
if 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 asinterval
andusage_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 eitherinclusive
orexclusive
, it cannot be changed.
-
getTiers
public java.util.List<Price.Tier> getTiers()
Each element represents a pricing tier. This parameter requiresbilling_scheme
to be set totiered
. See also the documentation forbilling_scheme
.
-
getTiersMode
public java.lang.String getTiersMode()
Defines if the tiering price should begraduated
orvolume
based. Involume
-based tiering, the maximum quantity within a period determines the per unit price. Ingraduated
tiering, 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_time
orrecurring
depending 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_unit
ortiered
.per_unit
indicates that the fixed amount (specified inunit_amount
orunit_amount_decimal
) will be charged per unit inquantity
(for prices withusage_type=licensed
), or per unit of total usage (for prices withusage_type=metered
).tiered
indicates that the unit pricing will be computed using a tiering strategy as defined using thetiers
andtiers_mode
attributes.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 valuetrue
if the object exists in live mode or the valuefalse
if 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 asinterval
andusage_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 eitherinclusive
orexclusive
, it cannot be changed.
-
setTiers
public void setTiers(java.util.List<Price.Tier> tiers)
Each element represents a pricing tier. This parameter requiresbilling_scheme
to be set totiered
. See also the documentation forbilling_scheme
.
-
setTiersMode
public void setTiersMode(java.lang.String tiersMode)
Defines if the tiering price should begraduated
orvolume
based. Involume
-based tiering, the maximum quantity within a period determines the per unit price. Ingraduated
tiering, 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_time
orrecurring
depending 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:
equals
in classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in 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:
getMetadata
in interfaceMetadataStore<Price>
-
-