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
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
Nested ClassesModifier 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
Fields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON
-
Constructor Summary
Constructors -
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.A list of up to 5 attributes that each SKU can provide values for (e.g.,["color", "size"]
).A short one-line description of the product, meant to be displayable to the customer.Time at which the object was created.An array of connect application identifiers that cannot purchase this product.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.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.Provisioning configuration for this product.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
setAttributes
(List<String> attributes) A list of up to 5 attributes that each SKU can provide values for (e.g.,["color", "size"]
).void
setCaption
(String caption) A short one-line description of the product, meant to be displayable to the customer.void
setCreated
(Long created) Time at which the object was created.void
setDeactivateOn
(List<String> deactivateOn) An array of connect application identifiers that cannot purchase this product.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
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
setProvisioning
(Product.Provisioning provisioning) Provisioning configuration for this product.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, classUrl, classUrl, fullUrl, 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
-
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
-
getActive
Whether the product is currently available for purchase. -
getAttributes
A list of up to 5 attributes that each SKU can provide values for (e.g.,["color", "size"]
). -
getCaption
A short one-line description of the product, meant to be displayable to the customer. Only applicable to products oftype=good
. -
getCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
getDeactivateOn
An array of connect application identifiers that cannot purchase this product. Only applicable to products oftype=good
. -
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. -
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. -
getProvisioning
Provisioning configuration for this product. -
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. -
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. -
setAttributes
A list of up to 5 attributes that each SKU can provide values for (e.g.,["color", "size"]
). -
setCaption
A short one-line description of the product, meant to be displayable to the customer. Only applicable to products oftype=good
. -
setCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
setDeactivateOn
An array of connect application identifiers that cannot purchase this product. Only applicable to products oftype=good
. -
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. -
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. -
setProvisioning
Provisioning configuration for this product. -
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. -
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>
-