pub struct InvoiceItem {
Show 23 fields pub id: InvoiceItemId, pub amount: Option<i64>, pub currency: Option<Currency>, pub customer: Option<Expandable<Customer>>, pub date: Option<Timestamp>, pub deleted: bool, pub description: Option<String>, pub discountable: Option<bool>, pub discounts: Option<Vec<Expandable<Discount>>>, pub invoice: Option<Expandable<Invoice>>, pub livemode: Option<bool>, pub metadata: Metadata, pub period: Option<Period>, pub plan: Option<Plan>, pub price: Option<Price>, pub proration: Option<bool>, pub quantity: Option<u64>, pub subscription: Option<Expandable<Subscription>>, pub subscription_item: Option<String>, pub tax_rates: Option<Vec<TaxRate>>, pub test_clock: Option<Expandable<TestHelpersTestClock>>, pub unit_amount: Option<i64>, pub unit_amount_decimal: Option<String>,
}
Expand description

The resource representing a Stripe “InvoiceItem”.

For more details see https://stripe.com/docs/api/invoiceitems/object

Fields§

§id: InvoiceItemId

Unique identifier for the object.

§amount: Option<i64>

Amount (in the currency specified) of the invoice item.

This should always be equal to unit_amount * quantity.

§currency: Option<Currency>

Three-letter ISO currency code, in lowercase.

Must be a supported currency.

§customer: Option<Expandable<Customer>>

The ID of the customer who will be billed when this invoice item is billed.

§date: Option<Timestamp>

Time at which the object was created.

Measured in seconds since the Unix epoch.

§deleted: bool§description: Option<String>

An arbitrary string attached to the object.

Often useful for displaying to users.

§discountable: Option<bool>

If true, discounts will apply to this invoice item.

Always false for prorations.

§discounts: Option<Vec<Expandable<Discount>>>

The discounts which apply to the invoice item.

Item discounts are applied before invoice discounts. Use expand[]=discounts to expand each discount.

§invoice: Option<Expandable<Invoice>>

The ID of the invoice this invoice item belongs to.

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

§period: Option<Period>§plan: Option<Plan>

If the invoice item is a proration, the plan of the subscription that the proration was computed for.

§price: Option<Price>

The price of the invoice item.

§proration: Option<bool>

Whether the invoice item was created automatically as a proration adjustment when the customer switched plans.

§quantity: Option<u64>

Quantity of units for the invoice item.

If the invoice item is a proration, the quantity of the subscription that the proration was computed for.

§subscription: Option<Expandable<Subscription>>

The subscription that this invoice item has been created for, if any.

§subscription_item: Option<String>

The subscription item that this invoice item has been created for, if any.

§tax_rates: Option<Vec<TaxRate>>

The tax rates which apply to the invoice item.

When set, the default_tax_rates on the invoice do not apply to this invoice item.

§test_clock: Option<Expandable<TestHelpersTestClock>>

ID of the test clock this invoice item belongs to.

§unit_amount: Option<i64>

Unit amount (in the currency specified) of the invoice item.

§unit_amount_decimal: Option<String>

Same as unit_amount, but contains a decimal value with at most 12 decimal places.

Implementations§

source§

impl InvoiceItem

source

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

Returns a list of your invoice items.

Invoice items are returned sorted by creation date, with the most recently created invoice items appearing first.

source

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

Creates an item to be added to a draft invoice (up to 250 items per invoice).

If no invoice is specified, the item will be on the next invoice created for the customer specified.

source

pub fn retrieve( client: &Client, id: &InvoiceItemId, expand: &[&str] ) -> Response<InvoiceItem>

Retrieves the invoice item with the given ID.

source

pub fn update( client: &Client, id: &InvoiceItemId, params: UpdateInvoiceItem<'_> ) -> Response<InvoiceItem>

Updates the amount or description of an invoice item on an upcoming invoice.

Updating an invoice item is only possible before the invoice it’s attached to is closed.

source

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

Deletes an invoice item, removing it from an invoice.

Deleting invoice items is only possible when they’re not attached to invoices, or if it’s attached to a draft invoice.

Trait Implementations§

source§

impl Clone for InvoiceItem

source§

fn clone(&self) -> InvoiceItem

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 InvoiceItem

source§

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

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

impl Default for InvoiceItem

source§

fn default() -> InvoiceItem

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

impl<'de> Deserialize<'de> for InvoiceItem

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 InvoiceItem

§

type Id = InvoiceItemId

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 InvoiceItem

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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · 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 Twhere U: From<T>,

const: unstable · 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<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere 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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
§

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

§

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 Twhere T: for<'de> Deserialize<'de>,