pub struct CreateCreditNote { /* private fields */ }
Expand description
Issue a credit note to adjust the amount of a finalized invoice.
A credit note will first reduce the invoice’s amount_remaining
(and amount_due
), but not below zero.
This amount is indicated by the credit note’s pre_payment_amount
.
The excess amount is indicated by post_payment_amount
, and it can result in any combination of the following:.
- Refunds: create a new refund (using `refund_amount`) or link existing refunds (using `refunds`). .
- Customer balance credit: credit the customer’s balance (using `credit_amount`) which will be automatically applied to their next invoice when it’s finalized. .
- Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using `out_of_band_amount`). .
The sum of refunds, customer balance credits, and outside of Stripe credits must equal the post_payment_amount
.
You may issue multiple credit notes for an invoice.
Each credit note may increment the invoice’s pre_payment_credit_notes_amount
,.
post_payment_credit_notes_amount
, or both, depending on the invoice’s amount_remaining
at the time of credit note creation.
Implementations§
Source§impl CreateCreditNote
impl CreateCreditNote
Sourcepub fn amount(self, amount: impl Into<i64>) -> Self
pub fn amount(self, amount: impl Into<i64>) -> Self
The integer amount in cents (or local equivalent) representing the total amount of the credit note.
One of amount
, lines
, or shipping_cost
must be provided.
Sourcepub fn credit_amount(self, credit_amount: impl Into<i64>) -> Self
pub fn credit_amount(self, credit_amount: impl Into<i64>) -> Self
The integer amount in cents (or local equivalent) representing the amount to credit the customer’s balance, which will be automatically applied to their next invoice.
Sourcepub fn effective_at(self, effective_at: impl Into<Timestamp>) -> Self
pub fn effective_at(self, effective_at: impl Into<Timestamp>) -> Self
The date when this credit note is in effect.
Same as created
unless overwritten.
When defined, this value replaces the system-generated ‘Date of issue’ printed on the credit note PDF.
Sourcepub fn email_type(
self,
email_type: impl Into<CreateCreditNoteEmailType>,
) -> Self
pub fn email_type( self, email_type: impl Into<CreateCreditNoteEmailType>, ) -> Self
Type of email to send to the customer, one of credit_note
or none
and the default is credit_note
.
Sourcepub fn expand(self, expand: impl Into<Vec<String>>) -> Self
pub fn expand(self, expand: impl Into<Vec<String>>) -> Self
Specifies which fields in the response should be expanded.
Sourcepub fn lines(self, lines: impl Into<Vec<CreateCreditNoteLines>>) -> Self
pub fn lines(self, lines: impl Into<Vec<CreateCreditNoteLines>>) -> Self
Line items that make up the credit note.
One of amount
, lines
, or shipping_cost
must be provided.
Sourcepub fn memo(self, memo: impl Into<String>) -> Self
pub fn memo(self, memo: impl Into<String>) -> Self
The credit note’s memo appears on the credit note PDF.
Sourcepub fn metadata(self, metadata: impl Into<HashMap<String, String>>) -> Self
pub fn metadata(self, metadata: impl Into<HashMap<String, String>>) -> Self
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.
Individual keys can be unset by posting an empty value to them.
All keys can be unset by posting an empty value to metadata
.
Sourcepub fn out_of_band_amount(self, out_of_band_amount: impl Into<i64>) -> Self
pub fn out_of_band_amount(self, out_of_band_amount: impl Into<i64>) -> Self
The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe.
Sourcepub fn reason(self, reason: impl Into<CreditNoteReason>) -> Self
pub fn reason(self, reason: impl Into<CreditNoteReason>) -> Self
Reason for issuing this credit note, one of duplicate
, fraudulent
, order_change
, or product_unsatisfactory
.
Sourcepub fn refund_amount(self, refund_amount: impl Into<i64>) -> Self
pub fn refund_amount(self, refund_amount: impl Into<i64>) -> Self
The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice.
Sourcepub fn refunds(self, refunds: impl Into<Vec<CreditNoteRefundParams>>) -> Self
pub fn refunds(self, refunds: impl Into<Vec<CreditNoteRefundParams>>) -> Self
Refunds to link to this credit note.
Sourcepub fn shipping_cost(
self,
shipping_cost: impl Into<CreditNoteShippingCost>,
) -> Self
pub fn shipping_cost( self, shipping_cost: impl Into<CreditNoteShippingCost>, ) -> Self
When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note.
One of amount
, lines
, or shipping_cost
must be provided.
Source§impl CreateCreditNote
impl CreateCreditNote
Sourcepub async fn send<C: StripeClient>(
&self,
client: &C,
) -> Result<<Self as StripeRequest>::Output, C::Err>
pub async fn send<C: StripeClient>( &self, client: &C, ) -> Result<<Self as StripeRequest>::Output, C::Err>
Send the request and return the deserialized response.
Sourcepub fn send_blocking<C: StripeBlockingClient>(
&self,
client: &C,
) -> Result<<Self as StripeRequest>::Output, C::Err>
pub fn send_blocking<C: StripeBlockingClient>( &self, client: &C, ) -> Result<<Self as StripeRequest>::Output, C::Err>
Send the request and return the deserialized response, blocking until completion.
Trait Implementations§
Source§impl Clone for CreateCreditNote
impl Clone for CreateCreditNote
Source§fn clone(&self) -> CreateCreditNote
fn clone(&self) -> CreateCreditNote
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more