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 booleancanEqual(java.lang.Object other)static Productcreate(ProductCreateParams params)Creates a new product object.static Productcreate(ProductCreateParams params, RequestOptions options)Creates a new product object.static Productcreate(java.util.Map<java.lang.String,java.lang.Object> params)Creates a new product object.static Productcreate(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Creates a new product object.Productdelete()Delete a product.Productdelete(RequestOptions options)Delete a product.Productdelete(java.util.Map<java.lang.String,java.lang.Object> params)Delete a product.Productdelete(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Delete a product.booleanequals(java.lang.Object o)java.lang.BooleangetActive()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.StringgetCaption()A short one-line description of the product, meant to be displayable to the customer.java.lang.LonggetCreated()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.BooleangetDeleted()Always true for a deleted object.java.lang.StringgetDescription()The product's description, meant to be displayable to the customer.java.lang.StringgetId()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.BooleangetLivemode()Has the valuetrueif the object exists in live mode or the valuefalseif 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.StringgetName()The product's name, meant to be displayable to the customer.java.lang.StringgetObject()String representing the object's type.PackageDimensionsgetPackageDimensions()The dimensions of this product for shipping purposes.java.lang.BooleangetShippable()Whether this product is shipped (i.e., physical goods).java.lang.StringgetStatementDescriptor()Extra information about a product which will appear on your customer's credit card statement.java.lang.StringgetTaxCode()Get ID of expandabletaxCodeobject.TaxCodegetTaxCodeObject()Get expandedtaxCode.java.lang.StringgetType()The type of the product.java.lang.StringgetUnitLabel()A label that represents units of this product in Stripe and on customers’ receipts and invoices.java.lang.LonggetUpdated()Time at which the object was last updated.java.lang.StringgetUrl()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 ProductCollectionlist(java.util.Map<java.lang.String,java.lang.Object> params)Returns a list of your products.static ProductCollectionlist(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Returns a list of your products.static Productretrieve(java.lang.String id)Retrieves the details of an existing product.static Productretrieve(java.lang.String id, RequestOptions options)Retrieves the details of an existing product.static Productretrieve(java.lang.String id, ProductRetrieveParams params, RequestOptions options)Retrieves the details of an existing product.static Productretrieve(java.lang.String id, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Retrieves the details of an existing product.voidsetActive(java.lang.Boolean active)Whether the product is currently available for purchase.voidsetAttributes(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"]).voidsetCaption(java.lang.String caption)A short one-line description of the product, meant to be displayable to the customer.voidsetCreated(java.lang.Long created)Time at which the object was created.voidsetDeactivateOn(java.util.List<java.lang.String> deactivateOn)An array of connect application identifiers that cannot purchase this product.voidsetDeleted(java.lang.Boolean deleted)Always true for a deleted object.voidsetDescription(java.lang.String description)The product's description, meant to be displayable to the customer.voidsetId(java.lang.String id)Unique identifier for the object.voidsetImages(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.voidsetLivemode(java.lang.Boolean livemode)Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.voidsetMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)Set of key-value pairs that you can attach to an object.voidsetName(java.lang.String name)The product's name, meant to be displayable to the customer.voidsetObject(java.lang.String object)String representing the object's type.voidsetPackageDimensions(PackageDimensions packageDimensions)The dimensions of this product for shipping purposes.voidsetShippable(java.lang.Boolean shippable)Whether this product is shipped (i.e., physical goods).voidsetStatementDescriptor(java.lang.String statementDescriptor)Extra information about a product which will appear on your customer's credit card statement.voidsetTaxCode(java.lang.String id)voidsetTaxCodeObject(TaxCode expandableObject)voidsetType(java.lang.String type)The type of the product.voidsetUnitLabel(java.lang.String unitLabel)A label that represents units of this product in Stripe and on customers’ receipts and invoices.voidsetUpdated(java.lang.Long updated)Time at which the object was last updated.voidsetUrl(java.lang.String url)A URL of a publicly-accessible webpage for this product.Productupdate(ProductUpdateParams params)Updates the specific product by setting the values of the parameters passed.Productupdate(ProductUpdateParams params, RequestOptions options)Updates the specific product by setting the values of the parameters passed.Productupdate(java.util.Map<java.lang.String,java.lang.Object> params)Updates the specific product by setting the values of the parameters passed.Productupdate(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, 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 expandabletaxCodeobject.
-
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:
updatein 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:
updatein 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=goodis 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=goodis 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=goodis 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=goodis 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 valuetrueif the object exists in live mode or the valuefalseif 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 valuetrueif the object exists in live mode or the valuefalseif 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:
equalsin classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCodein 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:
getMetadatain interfaceMetadataStore<Product>
-
-