Struct stripe::Product[][src]

pub struct Product {
    pub id: ProductId,
    pub active: Option<bool>,
    pub attributes: Option<Vec<String>>,
    pub caption: Option<String>,
    pub created: Option<Timestamp>,
    pub deactivate_on: Option<Vec<String>>,
    pub deleted: bool,
    pub description: Option<String>,
    pub images: Option<Vec<String>>,
    pub livemode: Option<bool>,
    pub metadata: Metadata,
    pub name: Option<String>,
    pub package_dimensions: Option<PackageDimensions>,
    pub shippable: Option<bool>,
    pub statement_descriptor: Option<String>,
    pub unit_label: Option<String>,
    pub updated: Option<Timestamp>,
    pub url: Option<String>,
}

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"]).

caption: Option<String>

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: booldescription: Option<String>

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.

images: Option<Vec<String>>

A list of up to 8 URLs of images for this product, meant to be displayable to the customer.

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.

Whenever this product is sold via a subscription, name will show up on associated invoice line item descriptions.

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.

unit_label: Option<String>

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.

updated: Option<Timestamp>

Time at which the object was last updated.

Measured in seconds since the Unix epoch.

url: Option<String>

A URL of a publicly-accessible webpage for this product.

Only applicable to products of type=good.

Implementations

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.

pub fn retrieve(
    client: &Client,
    id: &ProductId,
    expand: &[&str]
) -> Response<Product>
[src]

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]

Updates the specific product by setting the values of the parameters passed.

Any parameters not provided will be left unchanged.

pub fn delete(client: &Client, id: &ProductId) -> Response<Deleted<ProductId>>[src]

Delete a product.

Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it.

Trait Implementations

impl Clone for Product[src]

impl Debug for Product[src]

impl<'de> Deserialize<'de> for Product[src]

impl Object for Product[src]

type Id = ProductId

The canonical id type for this object.

impl Serialize for Product[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]