Package com.stripe.model
Class Sku
java.lang.Object
com.stripe.model.StripeObject
com.stripe.net.ApiResource
com.stripe.model.Sku
- All Implemented Interfaces:
HasId
,MetadataStore<Sku>
,StripeObjectInterface
-
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
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
static Sku
create
(SkuCreateParams params) Creates a new SKU associated with a product.static Sku
create
(SkuCreateParams params, RequestOptions options) Creates a new SKU associated with a product.static Sku
Creates a new SKU associated with a product.static Sku
create
(Map<String, Object> params, RequestOptions options) Creates a new SKU associated with a product.delete()
Delete a SKU.delete
(RequestOptions options) Delete a SKU.Delete a SKU.delete
(Map<String, Object> params, RequestOptions options) Delete a SKU.boolean
Whether the SKU is available for purchase.A dictionary of attributes and values for the attributes defined by the product.Time at which the object was created.Three-letter ISO currency code, in lowercase.Always true for a deleted object.getId()
Unique identifier for the object.getImage()
The URL of an image for this SKU, 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.String representing the object's type.The dimensions of this SKU for shipping purposes.getPrice()
The cost of the item as a positive integer in the smallest currency unit (that is, 100 cents to charge $1.00, or 100 to charge ¥100, Japanese Yen being a zero-decimal currency).Get ID of expandableproduct
object.Get expandedproduct
.Time at which the object was last updated.int
hashCode()
static SkuCollection
list
(SkuListParams params) Returns a list of your SKUs.static SkuCollection
list
(SkuListParams params, RequestOptions options) Returns a list of your SKUs.static SkuCollection
Returns a list of your SKUs.static SkuCollection
list
(Map<String, Object> params, RequestOptions options) Returns a list of your SKUs.static Sku
Retrieves the details of an existing SKU.static Sku
retrieve
(String id, RequestOptions options) Retrieves the details of an existing SKU.static Sku
retrieve
(String id, SkuRetrieveParams params, RequestOptions options) Retrieves the details of an existing SKU.static Sku
Retrieves the details of an existing SKU.void
Whether the SKU is available for purchase.void
setAttributes
(Map<String, String> attributes) A dictionary of attributes and values for the attributes defined by the product.void
setCreated
(Long created) Time at which the object was created.void
setCurrency
(String currency) Three-letter ISO currency code, in lowercase.void
setDeleted
(Boolean deleted) Always true for a deleted object.void
Unique identifier for the object.void
The URL of an image for this SKU, meant to be displayable to the customer.void
setInventory
(Sku.Inventory inventory) 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
String representing the object's type.void
setPackageDimensions
(PackageDimensions packageDimensions) The dimensions of this SKU for shipping purposes.void
The cost of the item as a positive integer in the smallest currency unit (that is, 100 cents to charge $1.00, or 100 to charge ¥100, Japanese Yen being a zero-decimal currency).void
setProduct
(String id) void
setProductObject
(Product expandableObject) void
setUpdated
(Long updated) Time at which the object was last updated.update
(SkuUpdateParams params) Updates the specific SKU by setting the values of the parameters passed.update
(SkuUpdateParams params, RequestOptions options) Updates the specific SKU by setting the values of the parameters passed.Updates the specific SKU by setting the values of the parameters passed.update
(Map<String, Object> params, RequestOptions options) Updates the specific SKU 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
-
Constructor Details
-
Sku
public Sku()
-
-
Method Details
-
getProduct
Get ID of expandableproduct
object. -
setProduct
-
getProductObject
Get expandedproduct
. -
setProductObject
-
retrieve
Retrieves the details of an existing SKU. Supply the unique SKU identifier from either a SKU creation request or from the product, and Stripe will return the corresponding SKU information.- Throws:
StripeException
-
retrieve
Retrieves the details of an existing SKU. Supply the unique SKU identifier from either a SKU creation request or from the product, and Stripe will return the corresponding SKU information.- Throws:
StripeException
-
retrieve
public static Sku retrieve(String id, Map<String, Object> params, RequestOptions options) throws StripeExceptionRetrieves the details of an existing SKU. Supply the unique SKU identifier from either a SKU creation request or from the product, and Stripe will return the corresponding SKU information.- Throws:
StripeException
-
retrieve
public static Sku retrieve(String id, SkuRetrieveParams params, RequestOptions options) throws StripeException Retrieves the details of an existing SKU. Supply the unique SKU identifier from either a SKU creation request or from the product, and Stripe will return the corresponding SKU information.- Throws:
StripeException
-
list
Returns a list of your SKUs. The SKUs are returned sorted by creation date, with the most recently created SKUs appearing first.- Throws:
StripeException
-
list
public static SkuCollection list(Map<String, Object> params, RequestOptions options) throws StripeExceptionReturns a list of your SKUs. The SKUs are returned sorted by creation date, with the most recently created SKUs appearing first.- Throws:
StripeException
-
list
Returns a list of your SKUs. The SKUs are returned sorted by creation date, with the most recently created SKUs appearing first.- Throws:
StripeException
-
list
public static SkuCollection list(SkuListParams params, RequestOptions options) throws StripeException Returns a list of your SKUs. The SKUs are returned sorted by creation date, with the most recently created SKUs appearing first.- Throws:
StripeException
-
update
Updates the specific SKU by setting the values of the parameters passed. Any parameters not provided will be left unchanged.Note that a SKU’s
attributes
are not editable. Instead, you would need to deactivate the existing SKU and create a new one with the new attribute values.- Specified by:
update
in interfaceMetadataStore<Sku>
- Throws:
StripeException
-
update
Updates the specific SKU by setting the values of the parameters passed. Any parameters not provided will be left unchanged.Note that a SKU’s
attributes
are not editable. Instead, you would need to deactivate the existing SKU and create a new one with the new attribute values.- Specified by:
update
in interfaceMetadataStore<Sku>
- Throws:
StripeException
-
update
Updates the specific SKU by setting the values of the parameters passed. Any parameters not provided will be left unchanged.Note that a SKU’s
attributes
are not editable. Instead, you would need to deactivate the existing SKU and create a new one with the new attribute values.- Throws:
StripeException
-
update
Updates the specific SKU by setting the values of the parameters passed. Any parameters not provided will be left unchanged.Note that a SKU’s
attributes
are not editable. Instead, you would need to deactivate the existing SKU and create a new one with the new attribute values.- Throws:
StripeException
-
create
Creates a new SKU associated with a product.- Throws:
StripeException
-
create
Creates a new SKU associated with a product.- Throws:
StripeException
-
create
Creates a new SKU associated with a product.- Throws:
StripeException
-
create
Creates a new SKU associated with a product.- Throws:
StripeException
-
delete
Delete a SKU. Deleting a SKU is only possible until it has been used in an order.- Throws:
StripeException
-
delete
Delete a SKU. Deleting a SKU is only possible until it has been used in an order.- Throws:
StripeException
-
delete
Delete a SKU. Deleting a SKU is only possible until it has been used in an order.- Throws:
StripeException
-
delete
Delete a SKU. Deleting a SKU is only possible until it has been used in an order.- Throws:
StripeException
-
getActive
Whether the SKU is available for purchase. -
getAttributes
A dictionary of attributes and values for the attributes defined by the product. If, for example, a product's attributes are["size", "gender"]
, a valid SKU has the following dictionary of attributes:{"size": "Medium", "gender": "Unisex"}
. -
getCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
getCurrency
Three-letter ISO currency code, in lowercase. Must be a supported currency. -
getDeleted
Always true for a deleted object. -
getImage
The URL of an image for this SKU, meant to be displayable to the customer. -
getInventory
-
getLivemode
Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode. -
getObject
String representing the object's type. Objects of the same type share the same value.Equal to
sku
. -
getPackageDimensions
The dimensions of this SKU for shipping purposes. -
getPrice
The cost of the item as a positive integer in the smallest currency unit (that is, 100 cents to charge $1.00, or 100 to charge ¥100, Japanese Yen being a zero-decimal currency). -
getUpdated
Time at which the object was last updated. Measured in seconds since the Unix epoch. -
setActive
Whether the SKU is available for purchase. -
setAttributes
A dictionary of attributes and values for the attributes defined by the product. If, for example, a product's attributes are["size", "gender"]
, a valid SKU has the following dictionary of attributes:{"size": "Medium", "gender": "Unisex"}
. -
setCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
setCurrency
Three-letter ISO currency code, in lowercase. Must be a supported currency. -
setDeleted
Always true for a deleted object. -
setId
Unique identifier for the object. -
setImage
The URL of an image for this SKU, meant to be displayable to the customer. -
setInventory
-
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. -
setObject
String representing the object's type. Objects of the same type share the same value.Equal to
sku
. -
setPackageDimensions
The dimensions of this SKU for shipping purposes. -
setPrice
The cost of the item as a positive integer in the smallest currency unit (that is, 100 cents to charge $1.00, or 100 to charge ¥100, Japanese Yen being a zero-decimal currency). -
setUpdated
Time at which the object was last updated. Measured in seconds since the Unix epoch. -
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<Sku>
-