class

Stripe::CreditNote

Inherits OpenApi::Json < OpenApi::Validatable < JSON::Serializable::Unmapped < JSON::Serializable < Reference < Object

Issue a credit note to adjust an invoice's amount after the invoice is finalized. Related guide: Credit notes

Constants

ERROR_MESSAGE_FOR__TYPE = "invalid value for \"_type\", must be one of [post_payment, pre_payment]."
ERROR_MESSAGE_FOR_OBJECT = "invalid value for \"object\", must be one of [credit_note]."
ERROR_MESSAGE_FOR_REASON = "invalid value for \"reason\", must be one of [duplicate, fraudulent, order_change, product_unsatisfactory]."
ERROR_MESSAGE_FOR_STATUS = "invalid value for \"status\", must be one of [issued, void]."
MAX_LENGTH_FOR_ID = 5000
MAX_LENGTH_FOR_MEMO = 5000
MAX_LENGTH_FOR_NUMBER = 5000
MAX_LENGTH_FOR_PDF = 5000
VALID_VALUES_FOR__TYPE = String.static_array("post_payment", "pre_payment")
VALID_VALUES_FOR_OBJECT = String.static_array("credit_note")
VALID_VALUES_FOR_REASON = String.static_array("duplicate", "fraudulent", "order_change", "product_unsatisfactory")
VALID_VALUES_FOR_STATUS = String.static_array("issued", "void")

Constructors

new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source
new(*, amount : Int64 | Nil = nil, amount_shipping : Int64 | Nil = nil, created : Int64 | Nil = nil, currency : String | Nil = nil, customer : Stripe::CreditNoteCustomer | Nil = nil, customer_balance_transaction : Stripe::CreditNoteCustomerBalanceTransaction | Nil = nil, discount_amount : Int64 | Nil = nil, discount_amounts : Array(Stripe::DiscountsResourceDiscountAmount) | Nil = nil, effective_at : Int64 | Nil = nil, id : String | Nil = nil, invoice : Stripe::CreditNoteInvoice | Nil = nil, lines : Stripe::CreditNoteLinesList | Nil = nil, livemode : Bool | Nil = nil, memo : String | Nil = nil, metadata : Hash(String, String) | Nil = nil, number : String | Nil = nil, object : String | Nil = nil, out_of_band_amount : Int64 | Nil = nil, pdf : String | Nil = nil, reason : String | Nil = nil, refund : Stripe::CreditNoteRefund | Nil = nil, shipping_cost : Stripe::CreditNoteShippingCost1 | Nil = nil, status : String | Nil = nil, subtotal : Int64 | Nil = nil, subtotal_excluding_tax : Int64 | Nil = nil, tax_amounts : Array(Stripe::CreditNoteTaxAmount) | Nil = nil, total : Int64 | Nil = nil, total_excluding_tax : Int64 | Nil = nil, _type : String | Nil = nil, voided_at : Int64 | Nil = nil)

Initializes the object @param [Hash] attributes Model attributes in the form of hash

Source

Instance methods

==(other : self)

Generates #hash and #== methods from all fields #== @return [Bool] #hash calculates hash code according to all attributes. #hash @return [UInt64] Hash code

_type

Type of this credit note, one of pre_payment or post_payment. A pre_payment credit note means it was issued when the invoice was open. A post_payment credit note means it was issued when the invoice was paid.

Source
_type=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] _type Object to be assigned

Source
amount

The integer amount in cents (or local equivalent) representing the total amount of the credit note, including tax.

Source
amount=(new_value : Int64 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] amount Object to be assigned

Source
amount_shipping

This is the sum of all the shipping amounts.

Source
amount_shipping=(new_value : Int64 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] amount_shipping Object to be assigned

Source
created

Time at which the object was created. Measured in seconds since the Unix epoch.

Source
created=(new_value : Int64 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] created Object to be assigned

Source
currency

Three-letter ISO currency code, in lowercase. Must be a supported currency.

Source
currency=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] currency Object to be assigned

Source
customer
Source
customer=(new_value : Stripe::CreditNoteCustomer | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] customer Object to be assigned

Source
customer_balance_transaction
Source
customer_balance_transaction=(new_value : Stripe::CreditNoteCustomerBalanceTransaction | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] customer_balance_transaction Object to be assigned

Source
discount_amount

The integer amount in cents (or local equivalent) representing the total amount of discount that was credited.

Source
discount_amount=(new_value : Int64 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] discount_amount Object to be assigned

Source
discount_amounts

The aggregate amounts calculated per discount for all line items.

Source
discount_amounts=(new_value : Array(Stripe::DiscountsResourceDiscountAmount) | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] discount_amounts Object to be assigned

Source
effective_at

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.

Source
effective_at=(new_value : Int64 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] effective_at Object to be assigned

Source
hash(hasher)

Generates #hash and #== methods from all fields #== @return [Bool] #hash calculates hash code according to all attributes. #hash @return [UInt64] Hash code

id

Unique identifier for the object.

Source
id=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] id Object to be assigned

Source
invoice
Source
invoice=(new_value : Stripe::CreditNoteInvoice | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] invoice Object to be assigned

Source
lines
Source
lines=(new_value : Stripe::CreditNoteLinesList | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] lines Object to be assigned

Source
list_invalid_properties

Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons

Source
livemode

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

Source
livemode=(new_value : Bool | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] livemode Object to be assigned

Source
memo

Customer-facing text that appears on the credit note PDF.

Source
memo=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] memo Object to be assigned

Source
metadata
Source
metadata=(new_value : Hash(String, String) | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] metadata Object to be assigned

Source
number

A unique number that identifies this particular credit note and appears on the PDF of the credit note and its associated invoice.

Source
number=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] number Object to be assigned

Source
object

String representing the object's type. Objects of the same type share the same value.

Source
object=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] object Object to be assigned

Source
out_of_band_amount

Amount that was credited outside of Stripe.

Source
out_of_band_amount=(new_value : Int64 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] out_of_band_amount Object to be assigned

Source
pdf

The link to download the PDF of the credit note.

Source
pdf=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] pdf Object to be assigned

Source
reason

Reason for issuing this credit note, one of duplicate, fraudulent, order_change, or product_unsatisfactory

Source
reason=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] reason Object to be assigned

Source
refund
Source
refund=(new_value : Stripe::CreditNoteRefund | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] refund Object to be assigned

Source
shipping_cost
Source
shipping_cost=(new_value : Stripe::CreditNoteShippingCost1 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] shipping_cost Object to be assigned

Source
status

Status of this credit note, one of issued or void. Learn more about voiding credit notes.

Source
status=(new_value : String | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] status Object to be assigned

Source
subtotal

The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding exclusive tax and invoice level discounts.

Source
subtotal=(new_value : Int64 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] subtotal Object to be assigned

Source
subtotal_excluding_tax

The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding all tax and invoice level discounts.

Source
subtotal_excluding_tax=(new_value : Int64 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] subtotal_excluding_tax Object to be assigned

Source
tax_amounts

The aggregate amounts calculated per tax rate for all line items.

Source
tax_amounts=(new_value : Array(Stripe::CreditNoteTaxAmount) | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] tax_amounts Object to be assigned

Source
total

The integer amount in cents (or local equivalent) representing the total amount of the credit note, including tax and all discount.

Source
total=(new_value : Int64 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] total Object to be assigned

Source
total_excluding_tax

The integer amount in cents (or local equivalent) representing the total amount of the credit note, excluding tax, but including discounts.

Source
total_excluding_tax=(new_value : Int64 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] total_excluding_tax Object to be assigned

Source
valid?

Check to see if the all the properties in the model are valid @return true if the model is valid

Source
voided_at

The time that the credit note was voided.

Source
voided_at=(new_value : Int64 | Nil)

Custom attribute writer method checking allowed values (enum). @param [Object] voided_at Object to be assigned

Source