Struct stripe::Product

source ·
pub struct Product {
Show 19 fields pub id: ProductId, pub active: Option<bool>, pub created: Option<Timestamp>, pub default_price: Option<Expandable<Price>>, pub deleted: bool, pub description: Option<String>, pub features: Option<Vec<ProductFeature>>, pub images: Option<Vec<String>>, pub livemode: Option<bool>, pub metadata: Option<Metadata>, pub name: Option<String>, pub package_dimensions: Option<PackageDimensions>, pub shippable: Option<bool>, pub statement_descriptor: Option<String>, pub tax_code: Option<Expandable<TaxCode>>, pub type_: Option<ProductType>, pub unit_label: Option<String>, pub updated: Option<Timestamp>, pub url: Option<String>,
}
Expand description

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.

§created: Option<Timestamp>

Time at which the object was created.

Measured in seconds since the Unix epoch.

§default_price: Option<Expandable<Price>>

The ID of the Price object that is the default price for this product.

§deleted: bool§description: 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.

§features: Option<Vec<ProductFeature>>

A list of up to 15 features for this product.

These are displayed in pricing tables.

§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: Option<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.

§package_dimensions: Option<PackageDimensions>

The dimensions of this product for shipping purposes.

§shippable: Option<bool>

Whether this product is shipped (i.e., physical goods).

§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.

§tax_code: Option<Expandable<TaxCode>>

A tax code ID.

§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.

When set, this will be included in customers’ receipts, invoices, Checkout, and the customer portal.

§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.

Implementations§

source§

impl Product

source

pub fn list( client: &Client, params: &ListProducts<'_> ) -> Response<List<Product>>

Returns a list of your products.

The products are returned sorted by creation date, with the most recently created products appearing first.

source

pub fn create(client: &Client, params: CreateProduct<'_>) -> Response<Product>

Creates a new product object.

source

pub fn retrieve( 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.

source

pub fn update( 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.

source

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

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.

source§

impl Product

source

pub fn search( client: &Client, params: ProductSearchParams<'_> ) -> Response<SearchList<Product>>

Searches for a product.

For more details see https://stripe.com/docs/api/products/search.

Trait Implementations§

source§

impl Clone for Product

source§

fn clone(&self) -> Product

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Product

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Product

source§

fn default() -> Product

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for Product

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Object for Product

§

type Id = ProductId

The canonical id type for this object.
source§

fn id(&self) -> Self::Id

The id of the object.
source§

fn object(&self) -> &'static str

The object’s type, typically represented in wire format as the object property.
source§

impl Serialize for Product

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

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

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

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