NAME
Net::API::Stripe::Order::SKU - A Stripe SKU Object
SYNOPSIS
my $sku = $stripe->sku({
active => $stripe->true,
attributes =>
{
size => 'Medium',
gender => 'Unisex',
},
currency => 'jpy',
image => 'https://example.com/path/product.jpg',
inventory => $inventory_object,
metadata => { transaction_id => 123 },
package_dimensions =>
{
# In inches
height => 6,
length => 20,
# Ounce
weight => 21
width => 12
},
price => 2000,
product => $product_object,
});
See documentation in Net::API::Stripe for example to make api calls to Stripe to create those objects.
VERSION
v0.100.0
DESCRIPTION
Stores representations of stock keeping units (http://en.wikipedia.org/wiki/Stock_keeping_unit). SKUs describe specific product variations, taking into account any combination of: attributes, currency, and cost. For example, a product may be a T-shirt, whereas a specific SKU represents the size: large, color: red version of that shirt.
Can also be used to manage inventory.
CONSTRUCTOR
- new( %ARG )
-
Creates a new Net::API::Stripe::Order::SKU object. It may also take an hash like arguments, that also are method of the same name.
METHODS
- id string
-
Unique identifier for the object.
- object string, value is "sku"
-
String representing the object’s type. Objects of the same type share the same value.
- active boolean
-
Whether the SKU is available for purchase.
- attributes hash
-
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"}.
- created timestamp
-
Time at which the object was created. Measured in seconds since the Unix epoch.
- currency currency
-
Three-letter ISO currency code, in lowercase. Must be a supported currency.
- image string
-
The URL of an image for this SKU, meant to be displayable to the customer.
This is a URI object.
- inventory hash
-
Description of the SKU’s inventory.
This is a Net::API::Stripe::Order::SKU::Inventory object.
- livemode boolean
-
Has the value true if the object exists in live mode or the value false if the object exists in test mode.
- metadata hash
-
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.
- package_dimensions hash
-
The dimensions of this SKU for shipping purposes.
This is a Net::API::Stripe::Order::SKU::PackageDimensions object.
- price positive integer or zero
-
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).
- product string (expandable)
-
The ID of the product this SKU is associated with. The product must be currently active.
When expanded, this is a Net::API::Stripe::Product object.
- updated timestamp
API SAMPLE
{
"id": "sku_fake123456789",
"object": "sku",
"active": true,
"attributes": {
"size": "Medium",
"gender": "Unisex"
},
"created": 1571480453,
"currency": "jpy",
"image": null,
"inventory": {
"quantity": 50,
"type": "finite",
"value": null
},
"livemode": false,
"metadata": {},
"package_dimensions": null,
"price": 1500,
"product": "prod_fake123456789",
"updated": 1571480453
}
HISTORY
v0.1
Initial version
AUTHOR
Jacques Deguest <jack@deguest.jp>
SEE ALSO
Stripe API documentation:
https://stripe.com/docs/api/skus, https://stripe.com/docs/orders
COPYRIGHT & LICENSE
Copyright (c) 2019-2020 DEGUEST Pte. Ltd.
You can use, copy, modify and redistribute this package and associated files under the same terms as Perl itself.