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>
,StripeActiveObject
,StripeObjectInterface
Products describe the specific goods or services you offer to your customers. For example, you
might offer a Standard and Premium version of your goods or service; each version would be a
separate Product. They can be used in conjunction with Prices to configure pricing in Payment Links,
Checkout, and Subscriptions.
Related guides: Set up a subscription, share a Payment Link, accept payments with Checkout, and more about Products and Prices
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
Nested classes/interfaces inherited from class com.stripe.net.ApiResource
ApiResource.RequestMethod
-
Field Summary
Fields inherited from class com.stripe.net.ApiResource
CHARSET, GSON, INTERNAL_GSON
Fields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
static Product
create
(ProductCreateParams params) Creates a new product object.static Product
create
(ProductCreateParams params, RequestOptions options) Creates a new product object.static Product
Creates a new product object.static Product
create
(Map<String, Object> params, RequestOptions options) Creates a new product object.delete()
Delete a product.delete
(RequestOptions options) Delete a product.Delete a product.delete
(Map<String, Object> params, RequestOptions options) Delete a product.boolean
Whether the product is currently available for purchase.Time at which the object was created.Get ID of expandabledefaultPrice
object.Get expandeddefaultPrice
.Always true for a deleted object.The product's description, meant to be displayable to the customer.getId()
Unique identifier for the object.A list of up to 8 URLs of images for this product, meant to be displayable to the customer.Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode.A list of up to 15 marketing features for this product.Set of key-value pairs that you can attach to an object.getName()
The product's name, meant to be displayable to the customer.String representing the object's type.The dimensions of this product for shipping purposes.Whether this product is shipped (i.e., physical goods).Extra information about a product which will appear on your customer's credit card statement.Get ID of expandabletaxCode
object.Get expandedtaxCode
.getType()
The type of the product.A label that represents units of this product.Time at which the object was last updated.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
Returns a list of your products.static ProductCollection
list
(Map<String, Object> params, RequestOptions options) Returns a list of your products.static Product
Retrieves the details of an existing product.static Product
retrieve
(String id, RequestOptions options) Retrieves the details of an existing product.static Product
retrieve
(String id, ProductRetrieveParams params, RequestOptions options) Retrieves the details of an existing product.static Product
Retrieves the details of an existing product.static ProductSearchResult
search
(ProductSearchParams params) Search for products you’ve previously created using Stripe’s Search Query Language.static ProductSearchResult
search
(ProductSearchParams params, RequestOptions options) Search for products you’ve previously created using Stripe’s Search Query Language.static ProductSearchResult
Search for products you’ve previously created using Stripe’s Search Query Language.static ProductSearchResult
search
(Map<String, Object> params, RequestOptions options) Search for products you’ve previously created using Stripe’s Search Query Language.void
Whether the product is currently available for purchase.void
setCreated
(Long created) Time at which the object was created.void
void
setDefaultPriceObject
(Price expandableObject) void
setDeleted
(Boolean deleted) Always true for a deleted object.void
setDescription
(String description) The product's description, meant to be displayable to the customer.void
Unique identifier for the object.void
A list of up to 8 URLs of images for this product, meant to be displayable to the customer.void
setLivemode
(Boolean livemode) Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode.void
setMarketingFeatures
(List<Product.MarketingFeature> marketingFeatures) A list of up to 15 marketing features for this product.void
setMetadata
(Map<String, String> metadata) Set of key-value pairs that you can attach to an object.void
The product's name, meant to be displayable to the customer.void
String representing the object's type.void
setPackageDimensions
(Product.PackageDimensions packageDimensions) The dimensions of this product for shipping purposes.void
setResponseGetter
(StripeResponseGetter responseGetter) Method is used by the containing object orStripeResponseGetter
implementations to set theStripeResponseGetter
instance used to make further requests.void
setShippable
(Boolean shippable) Whether this product is shipped (i.e., physical goods).void
setStatementDescriptor
(String statementDescriptor) Extra information about a product which will appear on your customer's credit card statement.void
setTaxCode
(String id) void
setTaxCodeObject
(TaxCode expandableObject) void
The type of the product.void
setUnitLabel
(String unitLabel) A label that represents units of this product.void
setUpdated
(Long updated) Time at which the object was last updated.void
A URL of a publicly-accessible webpage for this product.update
(ProductUpdateParams params) Updates the specific product by setting the values of the parameters passed.update
(ProductUpdateParams params, RequestOptions options) Updates the specific product by setting the values of the parameters passed.Updates the specific product by setting the values of the parameters passed.update
(Map<String, 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, getGlobalResponseGetter, getResponseGetter, setExpandableFieldId, setStripeResponseGetter, urlEncode, urlEncodeId
Methods inherited from class com.stripe.model.StripeObject
deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.stripe.model.StripeActiveObject
trySetResponseGetter
-
Constructor Details
-
Product
public Product()
-
-
Method Details
-
getDefaultPrice
Get ID of expandabledefaultPrice
object. -
setDefaultPrice
-
getDefaultPriceObject
Get expandeddefaultPrice
. -
setDefaultPriceObject
-
getTaxCode
Get ID of expandabletaxCode
object. -
setTaxCode
-
getTaxCodeObject
Get expandedtaxCode
. -
setTaxCodeObject
-
create
Creates a new product object.- Throws:
StripeException
-
create
public static Product create(Map<String, Object> params, RequestOptions options) throws StripeExceptionCreates a new product object.- Throws:
StripeException
-
create
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
-
delete
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
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
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
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
-
list
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(Map<String, Object> params, RequestOptions options) throws StripeExceptionReturns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first.- Throws:
StripeException
-
list
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
-
retrieve
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
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(String id, Map<String, Object> params, RequestOptions options) throws StripeExceptionRetrieves 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(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
-
search
Search for products 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
-
search
public static ProductSearchResult search(Map<String, Object> params, RequestOptions options) throws StripeExceptionSearch for products 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
-
search
Search for products 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
-
search
public static ProductSearchResult search(ProductSearchParams params, RequestOptions options) throws StripeException Search for products 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
-
update
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
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
Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged.- Throws:
StripeException
-
update
Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged.- Throws:
StripeException
-
setResponseGetter
Description copied from interface:StripeActiveObject
Method is used by the containing object orStripeResponseGetter
implementations to set theStripeResponseGetter
instance used to make further requests.- Specified by:
setResponseGetter
in interfaceStripeActiveObject
- Overrides:
setResponseGetter
in classApiResource
- Parameters:
responseGetter
- theStripeResponseGetter
instance to use for making further requests.
-
getActive
Whether the product is currently available for purchase. -
getCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
getDeleted
Always true for a deleted object. -
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
A list of up to 8 URLs of images for this product, meant to be displayable to the customer. -
getLivemode
Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode. -
getMarketingFeatures
A list of up to 15 marketing features for this product. These are displayed in pricing tables. -
getName
The product's name, meant to be displayable to the customer. -
getObject
String representing the object's type. Objects of the same type share the same value.Equal to
product
. -
getPackageDimensions
The dimensions of this product for shipping purposes. -
getShippable
Whether this product is shipped (i.e., physical goods). -
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. Only used for subscription payments. -
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
A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. -
getUpdated
Time at which the object was last updated. Measured in seconds since the Unix epoch. -
getUrl
A URL of a publicly-accessible webpage for this product. -
setActive
Whether the product is currently available for purchase. -
setCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
setDeleted
Always true for a deleted object. -
setDescription
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
Unique identifier for the object. -
setImages
A list of up to 8 URLs of images for this product, meant to be displayable to the customer. -
setLivemode
Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode. -
setMarketingFeatures
A list of up to 15 marketing features for this product. These are displayed in pricing tables. -
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. -
setName
The product's name, meant to be displayable to the customer. -
setObject
String representing the object's type. Objects of the same type share the same value.Equal to
product
. -
setPackageDimensions
The dimensions of this product for shipping purposes. -
setShippable
Whether this product is shipped (i.e., physical goods). -
setStatementDescriptor
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. Only used for subscription payments. -
setType
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
A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. -
setUpdated
Time at which the object was last updated. Measured in seconds since the Unix epoch. -
setUrl
A URL of a publicly-accessible webpage for this product. -
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:
getMetadata
in interfaceMetadataStore<Product>
-