Stripe.Resources.CreditNote (tiger_stripe v0.3.0)

Copy Markdown View Source

CreditNote

Issue a credit note to adjust an invoice's amount after the invoice is finalized.

Related guide: Credit notes

Summary

Types

discount_amounts()

@type discount_amounts() :: %{
  optional(:amount) => integer() | nil,
  optional(:discount) => String.t() | Stripe.Resources.Discount.t() | nil,
  optional(String.t()) => term()
}
  • amount - The amount, in cents (or local equivalent), of the discount.
  • discount - The discount that was applied to get this discount amount.

lines()

@type lines() :: %{
  optional(:data) => [Stripe.Resources.CreditNoteLineItem.t()] | nil,
  optional(:has_more) => boolean() | nil,
  optional(:object) => String.t() | nil,
  optional(:url) => String.t() | nil,
  optional(String.t()) => term()
}
  • data - Details about each object.
  • has_more - True if this list has another page of items after this one that can be fetched.
  • object - String representing the object's type. Objects of the same type share the same value. Always has the value list. Possible values: list.
  • url - The URL where this list can be accessed. Max length: 5000.

pretax_credit_amounts()

@type pretax_credit_amounts() :: %{
  optional(:amount) => integer() | nil,
  optional(:credit_balance_transaction) =>
    String.t() | Stripe.Resources.Billing.CreditBalanceTransaction.t() | nil,
  optional(:discount) => String.t() | Stripe.Resources.Discount.t() | nil,
  optional(:type) => String.t() | nil,
  optional(String.t()) => term()
}
  • amount - The amount, in cents (or local equivalent), of the pretax credit amount.
  • credit_balance_transaction - The credit balance transaction that was applied to get this pretax credit amount.
  • discount - The discount that was applied to get this pretax credit amount.
  • type - Type of the pretax credit amount referenced. Possible values: credit_balance_transaction, discount.

refunds()

@type refunds() :: %{
  optional(:amount_refunded) => integer() | nil,
  optional(:payment_record_refund) => refunds_payment_record_refund() | nil,
  optional(:refund) => String.t() | Stripe.Resources.Refund.t() | nil,
  optional(:type) => String.t() | nil,
  optional(String.t()) => term()
}
  • amount_refunded - Amount of the refund that applies to this credit note, in cents (or local equivalent).
  • payment_record_refund - The PaymentRecord refund details associated with this credit note refund. Nullable.
  • refund - ID of the refund.
  • type - Type of the refund, one of refund or payment_record_refund. Possible values: payment_record_refund, refund. Nullable.

refunds_payment_record_refund()

@type refunds_payment_record_refund() :: %{
  optional(:payment_record) => String.t() | nil,
  optional(:refund_group) => String.t() | nil,
  optional(String.t()) => term()
}
  • payment_record - ID of the payment record. Max length: 5000.
  • refund_group - ID of the refund group. Max length: 5000.

shipping_cost()

@type shipping_cost() :: %{
  optional(:amount_subtotal) => integer() | nil,
  optional(:amount_tax) => integer() | nil,
  optional(:amount_total) => integer() | nil,
  optional(:shipping_rate) =>
    String.t() | Stripe.Resources.ShippingRate.t() | nil,
  optional(:taxes) => [shipping_cost_taxes()] | nil,
  optional(String.t()) => term()
}
  • amount_subtotal - Total shipping cost before any taxes are applied.
  • amount_tax - Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0.
  • amount_total - Total shipping cost after taxes are applied.
  • shipping_rate - The ID of the ShippingRate for this invoice. Nullable.
  • taxes - The taxes applied to the shipping rate.

shipping_cost_taxes()

@type shipping_cost_taxes() :: %{
  optional(:amount) => integer() | nil,
  optional(:rate) => Stripe.Resources.TaxRate.t() | nil,
  optional(:taxability_reason) => String.t() | nil,
  optional(:taxable_amount) => integer() | nil,
  optional(String.t()) => term()
}
  • amount - Amount of tax applied for this rate.
  • rate
  • taxability_reason - The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. Possible values: customer_exempt, not_collecting, not_subject_to_tax, not_supported, portion_product_exempt, portion_reduced_rated, portion_standard_rated, product_exempt, product_exempt_holiday, proportionally_rated, reduced_rated, reverse_charge, standard_rated, taxable_basis_reduced, zero_rated. Nullable.
  • taxable_amount - The amount on which tax is calculated, in cents (or local equivalent). Nullable.

t()

@type t() :: %Stripe.Resources.CreditNote{
  amount: integer(),
  amount_shipping: integer(),
  created: integer(),
  currency: String.t(),
  customer: String.t() | Stripe.Resources.Customer.t(),
  customer_account: String.t(),
  customer_balance_transaction:
    String.t() | Stripe.Resources.CustomerBalanceTransaction.t(),
  discount_amount: integer(),
  discount_amounts: [discount_amounts()],
  effective_at: integer(),
  id: String.t(),
  invoice: String.t() | Stripe.Resources.Invoice.t(),
  lines: lines(),
  livemode: boolean(),
  memo: String.t(),
  metadata: %{required(String.t()) => String.t()},
  number: String.t(),
  object: String.t(),
  out_of_band_amount: integer(),
  pdf: String.t(),
  post_payment_amount: integer(),
  pre_payment_amount: integer(),
  pretax_credit_amounts: [pretax_credit_amounts()],
  reason: String.t(),
  refunds: [refunds()],
  shipping_cost: shipping_cost(),
  status: String.t(),
  subtotal: integer(),
  subtotal_excluding_tax: integer(),
  total: integer(),
  total_excluding_tax: integer(),
  total_taxes: [total_taxes()],
  type: String.t(),
  voided_at: integer()
}
  • amount - The integer amount in cents (or local equivalent) representing the total amount of the credit note, including tax.
  • amount_shipping - This is the sum of all the shipping amounts.
  • created - Time at which the object was created. Measured in seconds since the Unix epoch. Format: Unix timestamp.
  • currency - Three-letter ISO currency code, in lowercase. Must be a supported currency. Format: ISO 4217 currency code.
  • customer - ID of the customer. Expandable.
  • customer_account - ID of the account representing the customer. Max length: 5000. Nullable.
  • customer_balance_transaction - Customer balance transaction related to this credit note. Nullable. Expandable.
  • discount_amount - The integer amount in cents (or local equivalent) representing the total amount of discount that was credited.
  • discount_amounts - The aggregate amounts calculated per discount for all line items. Expandable.
  • 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. Format: Unix timestamp. Nullable.
  • id - Unique identifier for the object. Max length: 5000.
  • invoice - ID of the invoice. Expandable.
  • lines - Line items that make up the credit note Expandable.
  • livemode - Has the value true if the object exists in live mode or the value false if the object exists in test mode.
  • memo - Customer-facing text that appears on the credit note PDF. Max length: 5000. Nullable.
  • 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. Nullable.
  • number - A unique number that identifies this particular credit note and appears on the PDF of the credit note and its associated invoice. Max length: 5000.
  • object - String representing the object's type. Objects of the same type share the same value. Possible values: credit_note.
  • out_of_band_amount - Amount that was credited outside of Stripe. Nullable.
  • pdf - The link to download the PDF of the credit note. Max length: 5000.
  • post_payment_amount - The amount of the credit note that was refunded to the customer, credited to the customer's balance, credited outside of Stripe, or any combination thereof.
  • pre_payment_amount - The amount of the credit note by which the invoice's amount_remaining and amount_due were reduced.
  • pretax_credit_amounts - The pretax credit amounts (ex: discount, credit grants, etc) for all line items. Expandable.
  • reason - Reason for issuing this credit note, one of duplicate, fraudulent, order_change, or product_unsatisfactory Possible values: duplicate, fraudulent, order_change, product_unsatisfactory. Nullable.
  • refunds - Refunds related to this credit note. Expandable.
  • shipping_cost - The details of the cost of shipping, including the ShippingRate applied to the invoice. Nullable. Expandable.
  • status - Status of this credit note, one of issued or void. Learn more about voiding credit notes. Possible values: issued, void.
  • subtotal - The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding exclusive tax and invoice level discounts.
  • 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. Nullable.
  • total - The integer amount in cents (or local equivalent) representing the total amount of the credit note, including tax and all discount.
  • total_excluding_tax - The integer amount in cents (or local equivalent) representing the total amount of the credit note, excluding tax, but including discounts. Nullable.
  • total_taxes - The aggregate tax information for all line items. Nullable. Expandable.
  • 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. Possible values: mixed, post_payment, pre_payment.
  • voided_at - The time that the credit note was voided. Format: Unix timestamp. Nullable.

total_taxes()

@type total_taxes() :: %{
  optional(:amount) => integer() | nil,
  optional(:tax_behavior) => String.t() | nil,
  optional(:tax_rate_details) => total_taxes_tax_rate_details() | nil,
  optional(:taxability_reason) => String.t() | nil,
  optional(:taxable_amount) => integer() | nil,
  optional(:type) => String.t() | nil,
  optional(String.t()) => term()
}
  • amount - The amount of the tax, in cents (or local equivalent).
  • tax_behavior - Whether this tax is inclusive or exclusive. Possible values: exclusive, inclusive.
  • tax_rate_details - Additional details about the tax rate. Only present when type is tax_rate_details. Nullable.
  • taxability_reason - The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. Possible values: customer_exempt, not_available, not_collecting, not_subject_to_tax, not_supported, portion_product_exempt, portion_reduced_rated, portion_standard_rated, product_exempt, product_exempt_holiday, proportionally_rated, reduced_rated, reverse_charge, standard_rated, taxable_basis_reduced, zero_rated.
  • taxable_amount - The amount on which tax is calculated, in cents (or local equivalent). Nullable.
  • type - The type of tax information. Possible values: tax_rate_details.

total_taxes_tax_rate_details()

@type total_taxes_tax_rate_details() :: %{
  optional(:tax_rate) => String.t() | nil,
  optional(String.t()) => term()
}
  • tax_rate - ID of the tax rate Max length: 5000.

Functions

expandable_fields()

object_name()