[−][src]Struct stripe::Product
The resource representing a Stripe "Product".
For more details see https://stripe.com/docs/api/products/object.
Fields
id: ProductId
Unique identifier for the object.
active: Option<bool>
Whether the product is currently available for purchase.
attributes: Option<Vec<String>>
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
.
A short one-line description of the product, meant to be displayable to the customer.
Only applicable to products of type=good
.
created: Option<Timestamp>
Time at which the object was created.
Measured in seconds since the Unix epoch.
deactivate_on: Option<Vec<String>>
An array of connect application identifiers that cannot purchase this product.
Only applicable to products of type=good
.
deleted: bool
description: Option<String>
The product's description, meant to be displayable to the customer.
Only applicable to products of type=good
.
images: Option<Vec<String>>
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: Option<bool>
Has the value true
if the object exists in live mode or the value false
if the object exists in test mode.
metadata: 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.
name: Option<String>
The product's name, meant to be displayable to the customer.
Applicable to both service
and good
types.
package_dimensions: Option<PackageDimensions>
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
.
shippable: Option<bool>
Whether this product is a shipped good.
Only applicable to products of type=good
.
statement_descriptor: Option<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
.
type_: Option<ProductType>
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: Option<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: Option<Timestamp>
url: Option<String>
A URL of a publicly-accessible webpage for this product.
Only applicable to products of type=good
.
Methods
impl Product
[src]
pub fn list(client: &Client, params: ListProducts) -> Response<List<Product>>
[src]
Returns a list of your products.
The products are returned sorted by creation date, with the most recently created products appearing first.
pub fn create(client: &Client, params: CreateProduct) -> Response<Product>
[src]
Creates a new product object.
To create a product for use with subscriptions, see Subscriptions Products.
pub fn retrieve(
client: &Client,
id: &ProductId,
expand: &[&str]
) -> Response<Product>
[src]
client: &Client,
id: &ProductId,
expand: &[&str]
) -> Response<Product>
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.
pub fn update(
client: &Client,
id: &ProductId,
params: UpdateProduct
) -> Response<Product>
[src]
client: &Client,
id: &ProductId,
params: UpdateProduct
) -> Response<Product>
Updates the specific product by setting the values of the parameters passed.
Any parameters not provided will be left unchanged. Note that a product’s attributes
are not editable.
Instead, you would need to deactivate the existing product and create a new one with the new attribute values.
pub fn delete(client: &Client, id: &ProductId) -> Response<Deleted<ProductId>>
[src]
Delete a product.
Deleting a product with type=good
is only possible if it has no SKUs associated with it.
Deleting a product with type=service
is only possible if it has no plans associated with it.
Trait Implementations
impl Object for Product
[src]
type Id = ProductId
The canonical id type for this object.
fn id(&self) -> Self::Id
[src]
fn object(&self) -> &'static str
[src]
impl Clone for Product
[src]
impl Debug for Product
[src]
impl Serialize for Product
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for Product
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl Send for Product
impl Unpin for Product
impl Sync for Product
impl UnwindSafe for Product
impl RefUnwindSafe for Product
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> Erased for T
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self