NAME
Net::API::Stripe::Product - A Stripe Product Object
SYNOPSIS
my $prod = $stripe->product({
active => $stripe->true,
attributes => [qw( colour size gender )],
caption => 'Fashionable T-shirt',
description => 'Product for limited edition t-shirt',
images => [qw(
https://img.example.com/p12/file1.jpg
https://img.example.com/p12/file2.jpg
https://img.example.com/p12/file3.jpg
)],
livemode => $stripe->false,
metadata => { product_id => 123, customer_id => 456 },
name => 'Limited Edition Shirt',
package_dimensions =>
{
use_metric => 1,
width => 30,
length => 50,
height => 15,
weight => 500,
},
shippable => $stripe->true,
type => 'good',
url => 'https://store.example.com/p12/',
});
See documentation in Net::API::Stripe for example to make api calls to Stripe to create those objects.
VERSION
v0.101.0
DESCRIPTION
Store representations of products you sell in Product objects, used in conjunction with SKUs. Products may be physical goods, to be shipped, or digital.
Documentation on Products for use with Subscriptions can be found at Subscription Products.
CONSTRUCTOR
new( %ARG )
Creates a new Net::API::Stripe::Product object.
METHODS
id string
Unique identifier for the object.
object string, value is "product"
String representing the object’s type. Objects of the same type share the same value.
active boolean
Whether the product is currently available for purchase.
attributes array containing strings
A list of up to 5 attributes that each SKU can provide values for (e.g., ["color", "size"]). Only applicable to products of type=good.
caption string
A short one-line description of the product, meant to be displayable to the customer. Only applicable to products of type=good.
created timestamp
Time at which the object was created. Measured in seconds since the Unix epoch.
deactivate_on array containing strings
An array of connect application identifiers that cannot purchase this product. Only applicable to products of type=good.
default_price expandable
The ID of the Price object that is the default price for this product.
When expanded this is an Net::API::Stripe::Price object.
deleted boolean
Set to true when the product has been deleted.
description string
The product’s description, meant to be displayable to the customer. Only applicable to products of type=good.
images array containing strings
A list of up to 8 URLs of images for this product, meant to be displayable to the customer. Only applicable to products of type=good.
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.
name string
The product’s name, meant to be displayable to the customer. Applicable to both service and good types.
package_dimensions hash
The dimensions of this product for shipping purposes. A SKU associated with this product can override this value by having its own package_dimensions. Only applicable to products of type=good.
This is a Net::API::Stripe::Product::PackageDimension object.
shippable boolean
Whether this product is a shipped good. Only applicable to products of type=good.
skus list
This is a list (Net::API::Stripe::List) of Net::API::Stripe::Order::SKU objects.
This is an undocumented property.
statement_descriptor string
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 available on products of type=service.
tax_code expandable
A tax code ID.
When expanded this is an Net::API::Stripe::Product::TaxCode object.
type string
The type of the product. The product is either of type good, which is eligible for use with Orders and SKUs, or service, which is eligible for use with Subscriptions and Plans.
unit_label string
A label that represents units of this product, such as seat(s), in Stripe and on customers’ receipts and invoices. Only available on products of type=service.
updated timestamp
Time at which the object was last updated. Measured in seconds since the Unix epoch.
url string
A URL of a publicly-accessible webpage for this product. Only applicable to products of type=good
This returns a URI object.
API SAMPLE
{
"id": "prod_fake123456789",
"object": "product",
"active": true,
"attributes": [],
"caption": null,
"created": 1541833574,
"deactivate_on": [],
"description": null,
"images": [],
"livemode": false,
"metadata": {},
"name": "Provider, Inc investor yearly membership",
"package_dimensions": null,
"shippable": null,
"statement_descriptor": null,
"type": "service",
"unit_label": null,
"updated": 1565089803,
"url": null
}
HISTORY
v0.1
Initial version
STRIPE HISTORY
2018-05-21
Products no longer have SKU lists embedded.
AUTHOR
Jacques Deguest <jack@deguest.jp>
SEE ALSO
Stripe API documentation:
https://stripe.com/docs/api/products, https://stripe.com/docs/orders#define-products-skus, https://stripe.com/docs/billing/subscriptions/products-and-plans#products
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.