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
Nested ClassesModifier and TypeClassDescriptionstatic classFor more details about MarketingFeature, please refer to the API Reference.static classFor more details about PackageDimensions, please refer to the API Reference.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_GSONFields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanstatic Productcreate(ProductCreateParams params) Creates a new product object.static Productcreate(ProductCreateParams params, RequestOptions options) Creates a new product object.static ProductCreates a new product object.static Productcreate(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.booleanWhether the product is currently available for purchase.Time at which the object was created.Get ID of expandabledefaultPriceobject.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 valuetrueif the object exists in live mode or the valuefalseif 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 expandabletaxCodeobject.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.inthashCode()static ProductCollectionlist(ProductListParams params) Returns a list of your products.static ProductCollectionlist(ProductListParams params, RequestOptions options) Returns a list of your products.static ProductCollectionReturns a list of your products.static ProductCollectionlist(Map<String, Object> params, RequestOptions options) Returns a list of your products.static ProductRetrieves the details of an existing product.static Productretrieve(String id, RequestOptions options) Retrieves the details of an existing product.static Productretrieve(String id, ProductRetrieveParams params, RequestOptions options) Retrieves the details of an existing product.static ProductRetrieves the details of an existing product.static ProductSearchResultsearch(ProductSearchParams params) Search for products you’ve previously created using Stripe’s Search Query Language.static ProductSearchResultsearch(ProductSearchParams params, RequestOptions options) Search for products you’ve previously created using Stripe’s Search Query Language.static ProductSearchResultSearch for products you’ve previously created using Stripe’s Search Query Language.static ProductSearchResultsearch(Map<String, Object> params, RequestOptions options) Search for products you’ve previously created using Stripe’s Search Query Language.voidWhether the product is currently available for purchase.voidsetCreated(Long created) Time at which the object was created.voidvoidsetDefaultPriceObject(Price expandableObject) voidsetDeleted(Boolean deleted) Always true for a deleted object.voidsetDescription(String description) The product's description, meant to be displayable to the customer.voidUnique identifier for the object.voidA list of up to 8 URLs of images for this product, meant to be displayable to the customer.voidsetLivemode(Boolean livemode) Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.voidsetMarketingFeatures(List<Product.MarketingFeature> marketingFeatures) A list of up to 15 marketing features for this product.voidsetMetadata(Map<String, String> metadata) Set of key-value pairs that you can attach to an object.voidThe product's name, meant to be displayable to the customer.voidString representing the object's type.voidsetPackageDimensions(Product.PackageDimensions packageDimensions) The dimensions of this product for shipping purposes.voidsetResponseGetter(StripeResponseGetter responseGetter) Method is used by the containing object orStripeResponseGetterimplementations to set theStripeResponseGetterinstance used to make further requests.voidsetShippable(Boolean shippable) Whether this product is shipped (i.e., physical goods).voidsetStatementDescriptor(String statementDescriptor) Extra information about a product which will appear on your customer's credit card statement.voidsetTaxCode(String id) voidsetTaxCodeObject(TaxCode expandableObject) voidThe type of the product.voidsetUnitLabel(String unitLabel) A label that represents units of this product.voidsetUpdated(Long updated) Time at which the object was last updated.voidA 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, setGlobalResponseGetter, urlEncode, urlEncodeIdMethods inherited from class com.stripe.model.StripeObject
deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.stripe.model.StripeActiveObject
trySetResponseGetter
-
Constructor Details
-
Product
public Product()
-
-
Method Details
-
getDefaultPrice
Get ID of expandabledefaultPriceobject. -
setDefaultPrice
-
getDefaultPriceObject
Get expandeddefaultPrice. -
setDefaultPriceObject
-
getTaxCode
Get ID of expandabletaxCodeobject. -
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=goodis 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=goodis 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=goodis 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=goodis 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:
updatein 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:
updatein 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:StripeActiveObjectMethod is used by the containing object orStripeResponseGetterimplementations to set theStripeResponseGetterinstance used to make further requests.- Specified by:
setResponseGetterin interfaceStripeActiveObject- Overrides:
setResponseGetterin classApiResource- Parameters:
responseGetter- theStripeResponseGetterinstance 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 valuetrueif the object exists in live mode or the valuefalseif 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 valuetrueif the object exists in live mode or the valuefalseif 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:
getMetadatain interfaceMetadataStore<Product>
-