Package com.stripe.model
Class Product
- java.lang.Object
-
- com.stripe.model.StripeObject
-
- com.stripe.net.ApiResource
-
- com.stripe.model.Product
-
- All Implemented Interfaces:
HasId
,MetadataStore<Product>
,StripeObjectInterface
public class Product extends ApiResource implements HasId, MetadataStore<Product>
-
-
Nested Class Summary
-
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 Product()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canEqual(java.lang.Object other)
static Product
create(ProductCreateParams params)
Creates a new product object.static Product
create(ProductCreateParams params, RequestOptions options)
Creates a new product object.static Product
create(java.util.Map<java.lang.String,java.lang.Object> params)
Creates a new product object.static Product
create(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)
Creates a new product object.Product
delete()
Delete a product.Product
delete(RequestOptions options)
Delete a product.Product
delete(java.util.Map<java.lang.String,java.lang.Object> params)
Delete a product.Product
delete(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)
Delete a product.boolean
equals(java.lang.Object o)
java.lang.Boolean
getActive()
Whether the product is currently available for purchase.java.util.List<java.lang.String>
getAttributes()
A list of up to 5 attributes that each SKU can provide values for (e.g.,["color", "size"]
).java.lang.String
getCaption()
A short one-line description of the product, meant to be displayable to the customer.java.lang.Long
getCreated()
Time at which the object was created.java.util.List<java.lang.String>
getDeactivateOn()
An array of connect application identifiers that cannot purchase this product.java.lang.Boolean
getDeleted()
Always true for a deleted object.java.lang.String
getDescription()
The product's description, meant to be displayable to the customer.java.lang.String
getId()
Unique identifier for the object.java.util.List<java.lang.String>
getImages()
A list of up to 8 URLs of images for this product, meant to be displayable to the customer.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.util.Map<java.lang.String,java.lang.String>
getMetadata()
Set of key-value pairs that you can attach to an object.java.lang.String
getName()
The product's name, meant to be displayable to the customer.java.lang.String
getObject()
String representing the object's type.PackageDimensions
getPackageDimensions()
The dimensions of this product for shipping purposes.java.lang.Boolean
getShippable()
Whether this product is shipped (i.e., physical goods).java.lang.String
getStatementDescriptor()
Extra information about a product which will appear on your customer's credit card statement.java.lang.String
getTaxCode()
Get ID of expandabletaxCode
object.TaxCode
getTaxCodeObject()
Get expandedtaxCode
.java.lang.String
getType()
The type of the product.java.lang.String
getUnitLabel()
A label that represents units of this product in Stripe and on customers’ receipts and invoices.java.lang.Long
getUpdated()
Time at which the object was last updated.java.lang.String
getUrl()
A URL of a publicly-accessible webpage for this product.int
hashCode()
static ProductCollection
list(ProductListParams params)
Returns a list of your products.static ProductCollection
list(ProductListParams params, RequestOptions options)
Returns a list of your products.static ProductCollection
list(java.util.Map<java.lang.String,java.lang.Object> params)
Returns a list of your products.static ProductCollection
list(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)
Returns a list of your products.static Product
retrieve(java.lang.String id)
Retrieves the details of an existing product.static Product
retrieve(java.lang.String id, RequestOptions options)
Retrieves the details of an existing product.static Product
retrieve(java.lang.String id, ProductRetrieveParams params, RequestOptions options)
Retrieves the details of an existing product.static Product
retrieve(java.lang.String id, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)
Retrieves the details of an existing product.void
setActive(java.lang.Boolean active)
Whether the product is currently available for purchase.void
setAttributes(java.util.List<java.lang.String> attributes)
A list of up to 5 attributes that each SKU can provide values for (e.g.,["color", "size"]
).void
setCaption(java.lang.String caption)
A short one-line description of the product, meant to be displayable to the customer.void
setCreated(java.lang.Long created)
Time at which the object was created.void
setDeactivateOn(java.util.List<java.lang.String> deactivateOn)
An array of connect application identifiers that cannot purchase this product.void
setDeleted(java.lang.Boolean deleted)
Always true for a deleted object.void
setDescription(java.lang.String description)
The product's description, meant to be displayable to the customer.void
setId(java.lang.String id)
Unique identifier for the object.void
setImages(java.util.List<java.lang.String> images)
A list of up to 8 URLs of images for this product, meant to be displayable to the customer.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
setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
Set of key-value pairs that you can attach to an object.void
setName(java.lang.String name)
The product's name, meant to be displayable to the customer.void
setObject(java.lang.String object)
String representing the object's type.void
setPackageDimensions(PackageDimensions packageDimensions)
The dimensions of this product for shipping purposes.void
setShippable(java.lang.Boolean shippable)
Whether this product is shipped (i.e., physical goods).void
setStatementDescriptor(java.lang.String statementDescriptor)
Extra information about a product which will appear on your customer's credit card statement.void
setTaxCode(java.lang.String id)
void
setTaxCodeObject(TaxCode expandableObject)
void
setType(java.lang.String type)
The type of the product.void
setUnitLabel(java.lang.String unitLabel)
A label that represents units of this product in Stripe and on customers’ receipts and invoices.void
setUpdated(java.lang.Long updated)
Time at which the object was last updated.void
setUrl(java.lang.String url)
A URL of a publicly-accessible webpage for this product.Product
update(ProductUpdateParams params)
Updates the specific product by setting the values of the parameters passed.Product
update(ProductUpdateParams params, RequestOptions options)
Updates the specific product by setting the values of the parameters passed.Product
update(java.util.Map<java.lang.String,java.lang.Object> params)
Updates the specific product by setting the values of the parameters passed.Product
update(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)
Updates the specific product 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, urlEncodeId
-
Methods inherited from class com.stripe.model.StripeObject
equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toString
-
-
-
-
Method Detail
-
getTaxCode
public java.lang.String getTaxCode()
Get ID of expandabletaxCode
object.
-
setTaxCode
public void setTaxCode(java.lang.String id)
-
getTaxCodeObject
public TaxCode getTaxCodeObject()
Get expandedtaxCode
.
-
setTaxCodeObject
public void setTaxCodeObject(TaxCode expandableObject)
-
create
public static Product create(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Creates a new product object.- Throws:
StripeException
-
create
public static Product create(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Creates a new product object.- Throws:
StripeException
-
create
public static Product create(ProductCreateParams params) throws StripeException
Creates a new product object.- Throws:
StripeException
-
create
public static Product create(ProductCreateParams params, RequestOptions options) throws StripeException
Creates a new product object.- Throws:
StripeException
-
retrieve
public static Product retrieve(java.lang.String id) throws StripeException
Retrieves the details of an existing product. Supply the unique product ID from either a product creation request or the product list, and Stripe will return the corresponding product information.- Throws:
StripeException
-
retrieve
public static Product retrieve(java.lang.String id, RequestOptions options) throws StripeException
Retrieves the details of an existing product. Supply the unique product ID from either a product creation request or the product list, and Stripe will return the corresponding product information.- Throws:
StripeException
-
retrieve
public static Product retrieve(java.lang.String id, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Retrieves the details of an existing product. Supply the unique product ID from either a product creation request or the product list, and Stripe will return the corresponding product information.- Throws:
StripeException
-
retrieve
public static Product retrieve(java.lang.String id, ProductRetrieveParams params, RequestOptions options) throws StripeException
Retrieves the details of an existing product. Supply the unique product ID from either a product creation request or the product list, and Stripe will return the corresponding product information.- Throws:
StripeException
-
update
public Product update(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged.- Specified by:
update
in interfaceMetadataStore<Product>
- Throws:
StripeException
-
update
public Product update(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged.- Specified by:
update
in interfaceMetadataStore<Product>
- Throws:
StripeException
-
update
public Product update(ProductUpdateParams params) throws StripeException
Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged.- Throws:
StripeException
-
update
public Product update(ProductUpdateParams params, RequestOptions options) throws StripeException
Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged.- Throws:
StripeException
-
list
public static ProductCollection list(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first.- Throws:
StripeException
-
list
public static ProductCollection list(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first.- Throws:
StripeException
-
list
public static ProductCollection list(ProductListParams params) throws StripeException
Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first.- Throws:
StripeException
-
list
public static ProductCollection list(ProductListParams params, RequestOptions options) throws StripeException
Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first.- Throws:
StripeException
-
delete
public Product delete() throws StripeException
Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product withtype=good
is only possible if it has no SKUs associated with it.- Throws:
StripeException
-
delete
public Product delete(RequestOptions options) throws StripeException
Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product withtype=good
is only possible if it has no SKUs associated with it.- Throws:
StripeException
-
delete
public Product delete(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product withtype=good
is only possible if it has no SKUs associated with it.- Throws:
StripeException
-
delete
public Product delete(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product withtype=good
is only possible if it has no SKUs associated with it.- Throws:
StripeException
-
getActive
public java.lang.Boolean getActive()
Whether the product is currently available for purchase.
-
getAttributes
public java.util.List<java.lang.String> getAttributes()
A list of up to 5 attributes that each SKU can provide values for (e.g.,["color", "size"]
).
-
getCaption
public java.lang.String getCaption()
A short one-line description of the product, meant to be displayable to the customer. Only applicable to products oftype=good
.
-
getCreated
public java.lang.Long getCreated()
Time at which the object was created. Measured in seconds since the Unix epoch.
-
getDeactivateOn
public java.util.List<java.lang.String> getDeactivateOn()
An array of connect application identifiers that cannot purchase this product. Only applicable to products oftype=good
.
-
getDeleted
public java.lang.Boolean getDeleted()
Always true for a deleted object.
-
getDescription
public java.lang.String getDescription()
The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.
-
getImages
public java.util.List<java.lang.String> getImages()
A list of up to 8 URLs of images for this product, meant to be displayable to the customer.
-
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.
-
getName
public java.lang.String getName()
The product's name, meant to be displayable to the customer. Whenever this product is sold via a subscription, name will show up on associated invoice line item descriptions.
-
getObject
public java.lang.String getObject()
String representing the object's type. Objects of the same type share the same value.Equal to
product
.
-
getPackageDimensions
public PackageDimensions getPackageDimensions()
The dimensions of this product for shipping purposes.
-
getShippable
public java.lang.Boolean getShippable()
Whether this product is shipped (i.e., physical goods).
-
getStatementDescriptor
public java.lang.String getStatementDescriptor()
Extra information about a product which will appear on your customer's credit card statement. In the case that multiple products are billed at once, the first statement descriptor will be used.
-
getType
public java.lang.String getType()
The type of the product. The product is either of typegood
, which is eligible for use with Orders and SKUs, orservice
, which is eligible for use with Subscriptions and Plans.One of
good
, orservice
.
-
getUnitLabel
public java.lang.String getUnitLabel()
A label that represents units of this product in Stripe and on customers’ receipts and invoices. When set, this will be included in associated invoice line item descriptions.
-
getUpdated
public java.lang.Long getUpdated()
Time at which the object was last updated. Measured in seconds since the Unix epoch.
-
getUrl
public java.lang.String getUrl()
A URL of a publicly-accessible webpage for this product.
-
setActive
public void setActive(java.lang.Boolean active)
Whether the product is currently available for purchase.
-
setAttributes
public void setAttributes(java.util.List<java.lang.String> attributes)
A list of up to 5 attributes that each SKU can provide values for (e.g.,["color", "size"]
).
-
setCaption
public void setCaption(java.lang.String caption)
A short one-line description of the product, meant to be displayable to the customer. Only applicable to products oftype=good
.
-
setCreated
public void setCreated(java.lang.Long created)
Time at which the object was created. Measured in seconds since the Unix epoch.
-
setDeactivateOn
public void setDeactivateOn(java.util.List<java.lang.String> deactivateOn)
An array of connect application identifiers that cannot purchase this product. Only applicable to products oftype=good
.
-
setDeleted
public void setDeleted(java.lang.Boolean deleted)
Always true for a deleted object.
-
setDescription
public void setDescription(java.lang.String description)
The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.
-
setId
public void setId(java.lang.String id)
Unique identifier for the object.
-
setImages
public void setImages(java.util.List<java.lang.String> images)
A list of up to 8 URLs of images for this product, meant to be displayable to the customer.
-
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.
-
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.
-
setName
public void setName(java.lang.String name)
The product's name, meant to be displayable to the customer. Whenever this product is sold via a subscription, name will show up on associated invoice line item descriptions.
-
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
product
.
-
setPackageDimensions
public void setPackageDimensions(PackageDimensions packageDimensions)
The dimensions of this product for shipping purposes.
-
setShippable
public void setShippable(java.lang.Boolean shippable)
Whether this product is shipped (i.e., physical goods).
-
setStatementDescriptor
public void setStatementDescriptor(java.lang.String statementDescriptor)
Extra information about a product which will appear on your customer's credit card statement. In the case that multiple products are billed at once, the first statement descriptor will be used.
-
setType
public void setType(java.lang.String type)
The type of the product. The product is either of typegood
, which is eligible for use with Orders and SKUs, orservice
, which is eligible for use with Subscriptions and Plans.One of
good
, orservice
.
-
setUnitLabel
public void setUnitLabel(java.lang.String unitLabel)
A label that represents units of this product in Stripe and on customers’ receipts and invoices. When set, this will be included in associated invoice line item descriptions.
-
setUpdated
public void setUpdated(java.lang.Long updated)
Time at which the object was last updated. Measured in seconds since the Unix epoch.
-
setUrl
public void setUrl(java.lang.String url)
A URL of a publicly-accessible webpage for this product.
-
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<Product>
-
-