Class CreditNote

All Implemented Interfaces:
HasId, MetadataStore<CreditNote>, StripeActiveObject, StripeObjectInterface

public class CreditNote extends ApiResource implements HasId, MetadataStore<CreditNote>
Issue a credit note to adjust an invoice's amount after the invoice is finalized.

Related guide: Credit notes

  • Constructor Details

    • CreditNote

      public CreditNote()
  • Method Details

    • getCustomer

      public String getCustomer()
      Get ID of expandable customer object.
    • setCustomer

      public void setCustomer(String id)
    • getCustomerObject

      public Customer getCustomerObject()
      Get expanded customer.
    • setCustomerObject

      public void setCustomerObject(Customer expandableObject)
    • getCustomerBalanceTransaction

      public String getCustomerBalanceTransaction()
      Get ID of expandable customerBalanceTransaction object.
    • setCustomerBalanceTransaction

      public void setCustomerBalanceTransaction(String id)
    • getCustomerBalanceTransactionObject

      public CustomerBalanceTransaction getCustomerBalanceTransactionObject()
      Get expanded customerBalanceTransaction.
    • setCustomerBalanceTransactionObject

      public void setCustomerBalanceTransactionObject(CustomerBalanceTransaction expandableObject)
    • getInvoice

      public String getInvoice()
      Get ID of expandable invoice object.
    • setInvoice

      public void setInvoice(String id)
    • getInvoiceObject

      public Invoice getInvoiceObject()
      Get expanded invoice.
    • setInvoiceObject

      public void setInvoiceObject(Invoice expandableObject)
    • getRefund

      public String getRefund()
      Get ID of expandable refund object.
    • setRefund

      public void setRefund(String id)
    • getRefundObject

      public Refund getRefundObject()
      Get expanded refund.
    • setRefundObject

      public void setRefundObject(Refund expandableObject)
    • create

      public static CreditNote create(Map<String,Object> params) throws StripeException
      Issue a credit note to adjust the amount of a finalized invoice. For a status=open invoice, a credit note reduces its amount_due. For a status=paid invoice, a credit note does not affect its amount_due. Instead, it can result in any combination of the following:

      • Refund: create a new refund (using refund_amount) or link an existing refund (using refund).
      • 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).

      For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total.

      You may issue multiple credit notes for an invoice. Each credit note will increment the invoice’s pre_payment_credit_notes_amount or post_payment_credit_notes_amount depending on its status at the time of credit note creation.

      Throws:
      StripeException
    • create

      public static CreditNote create(Map<String,Object> params, RequestOptions options) throws StripeException
      Issue a credit note to adjust the amount of a finalized invoice. For a status=open invoice, a credit note reduces its amount_due. For a status=paid invoice, a credit note does not affect its amount_due. Instead, it can result in any combination of the following:

      • Refund: create a new refund (using refund_amount) or link an existing refund (using refund).
      • 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).

      For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total.

      You may issue multiple credit notes for an invoice. Each credit note will increment the invoice’s pre_payment_credit_notes_amount or post_payment_credit_notes_amount depending on its status at the time of credit note creation.

      Throws:
      StripeException
    • create

      public static CreditNote create(CreditNoteCreateParams params) throws StripeException
      Issue a credit note to adjust the amount of a finalized invoice. For a status=open invoice, a credit note reduces its amount_due. For a status=paid invoice, a credit note does not affect its amount_due. Instead, it can result in any combination of the following:

      • Refund: create a new refund (using refund_amount) or link an existing refund (using refund).
      • 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).

      For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total.

      You may issue multiple credit notes for an invoice. Each credit note will increment the invoice’s pre_payment_credit_notes_amount or post_payment_credit_notes_amount depending on its status at the time of credit note creation.

      Throws:
      StripeException
    • create

      public static CreditNote create(CreditNoteCreateParams params, RequestOptions options) throws StripeException
      Issue a credit note to adjust the amount of a finalized invoice. For a status=open invoice, a credit note reduces its amount_due. For a status=paid invoice, a credit note does not affect its amount_due. Instead, it can result in any combination of the following:

      • Refund: create a new refund (using refund_amount) or link an existing refund (using refund).
      • 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).

      For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total.

      You may issue multiple credit notes for an invoice. Each credit note will increment the invoice’s pre_payment_credit_notes_amount or post_payment_credit_notes_amount depending on its status at the time of credit note creation.

      Throws:
      StripeException
    • list

      public static CreditNoteCollection list(Map<String,Object> params) throws StripeException
      Returns a list of credit notes.
      Throws:
      StripeException
    • list

      public static CreditNoteCollection list(Map<String,Object> params, RequestOptions options) throws StripeException
      Returns a list of credit notes.
      Throws:
      StripeException
    • list

      public static CreditNoteCollection list(CreditNoteListParams params) throws StripeException
      Returns a list of credit notes.
      Throws:
      StripeException
    • list

      public static CreditNoteCollection list(CreditNoteListParams params, RequestOptions options) throws StripeException
      Returns a list of credit notes.
      Throws:
      StripeException
    • preview

      public static CreditNote preview(Map<String,Object> params) throws StripeException
      Get a preview of a credit note without creating it.
      Throws:
      StripeException
    • preview

      public static CreditNote preview(Map<String,Object> params, RequestOptions options) throws StripeException
      Get a preview of a credit note without creating it.
      Throws:
      StripeException
    • preview

      public static CreditNote preview(CreditNotePreviewParams params) throws StripeException
      Get a preview of a credit note without creating it.
      Throws:
      StripeException
    • preview

      public static CreditNote preview(CreditNotePreviewParams params, RequestOptions options) throws StripeException
      Get a preview of a credit note without creating it.
      Throws:
      StripeException
    • retrieve

      public static CreditNote retrieve(String id) throws StripeException
      Retrieves the credit note object with the given identifier.
      Throws:
      StripeException
    • retrieve

      public static CreditNote retrieve(String id, RequestOptions options) throws StripeException
      Retrieves the credit note object with the given identifier.
      Throws:
      StripeException
    • retrieve

      public static CreditNote retrieve(String id, Map<String,Object> params, RequestOptions options) throws StripeException
      Retrieves the credit note object with the given identifier.
      Throws:
      StripeException
    • retrieve

      public static CreditNote retrieve(String id, CreditNoteRetrieveParams params, RequestOptions options) throws StripeException
      Retrieves the credit note object with the given identifier.
      Throws:
      StripeException
    • update

      public CreditNote update(Map<String,Object> params) throws StripeException
      Updates an existing credit note.
      Specified by:
      update in interface MetadataStore<CreditNote>
      Throws:
      StripeException
    • update

      public CreditNote update(Map<String,Object> params, RequestOptions options) throws StripeException
      Updates an existing credit note.
      Specified by:
      update in interface MetadataStore<CreditNote>
      Throws:
      StripeException
    • update

      public CreditNote update(CreditNoteUpdateParams params) throws StripeException
      Updates an existing credit note.
      Throws:
      StripeException
    • update

      public CreditNote update(CreditNoteUpdateParams params, RequestOptions options) throws StripeException
      Updates an existing credit note.
      Throws:
      StripeException
    • voidCreditNote

      public CreditNote voidCreditNote() throws StripeException
      Marks a credit note as void. Learn more about voiding credit notes.
      Throws:
      StripeException
    • voidCreditNote

      public CreditNote voidCreditNote(RequestOptions options) throws StripeException
      Marks a credit note as void. Learn more about voiding credit notes.
      Throws:
      StripeException
    • voidCreditNote

      public CreditNote voidCreditNote(Map<String,Object> params) throws StripeException
      Marks a credit note as void. Learn more about voiding credit notes.
      Throws:
      StripeException
    • voidCreditNote

      public CreditNote voidCreditNote(Map<String,Object> params, RequestOptions options) throws StripeException
      Marks a credit note as void. Learn more about voiding credit notes.
      Throws:
      StripeException
    • voidCreditNote

      public CreditNote voidCreditNote(CreditNoteVoidCreditNoteParams params) throws StripeException
      Marks a credit note as void. Learn more about voiding credit notes.
      Throws:
      StripeException
    • voidCreditNote

      public CreditNote voidCreditNote(CreditNoteVoidCreditNoteParams params, RequestOptions options) throws StripeException
      Marks a credit note as void. Learn more about voiding credit notes.
      Throws:
      StripeException
    • setResponseGetter

      public void setResponseGetter(StripeResponseGetter responseGetter)
      Description copied from interface: StripeActiveObject
      Method is used by the containing object or StripeResponseGetter implementations to set the StripeResponseGetter instance used to make further requests.
      Specified by:
      setResponseGetter in interface StripeActiveObject
      Overrides:
      setResponseGetter in class ApiResource
      Parameters:
      responseGetter - the StripeResponseGetter instance to use for making further requests.
    • getAmount

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

      public Long getAmountShipping()
      This is the sum of all the shipping amounts.
    • getCreated

      public Long getCreated()
      Time at which the object was created. Measured in seconds since the Unix epoch.
    • getCurrency

      public String getCurrency()
      Three-letter ISO currency code, in lowercase. Must be a supported currency.
    • getDiscountAmount

      public Long getDiscountAmount()
      The integer amount in cents (or local equivalent) representing the total amount of discount that was credited.
    • getDiscountAmounts

      public List<CreditNote.DiscountAmount> getDiscountAmounts()
      The aggregate amounts calculated per discount for all line items.
    • getEffectiveAt

      public Long getEffectiveAt()
      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.
    • getLines

      public CreditNoteLineItemCollection getLines()
      Line items that make up the credit note.
    • getLivemode

      public Boolean getLivemode()
      Has the value true if the object exists in live mode or the value false if the object exists in test mode.
    • getMemo

      public String getMemo()
      Customer-facing text that appears on the credit note PDF.
    • getNumber

      public String getNumber()
      A unique number that identifies this particular credit note and appears on the PDF of the credit note and its associated invoice.
    • getObject

      public String getObject()
      String representing the object's type. Objects of the same type share the same value.

      Equal to credit_note.

    • getOutOfBandAmount

      public Long getOutOfBandAmount()
      Amount that was credited outside of Stripe.
    • getPdf

      public String getPdf()
      The link to download the PDF of the credit note.
    • getReason

      public String getReason()
      Reason for issuing this credit note, one of duplicate, fraudulent, order_change, or product_unsatisfactory.
    • getShippingCost

      public CreditNote.ShippingCost getShippingCost()
      The details of the cost of shipping, including the ShippingRate applied to the invoice.
    • getStatus

      public String getStatus()
      Status of this credit note, one of issued or void. Learn more about voiding credit notes.
    • getSubtotal

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

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

      public List<CreditNote.TaxAmount> getTaxAmounts()
      The aggregate amounts calculated per tax rate for all line items.
    • getTotal

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

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

      public String getType()
      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.
    • getVoidedAt

      public Long getVoidedAt()
      The time that the credit note was voided.
    • setAmount

      public void setAmount(Long amount)
      The integer amount in cents (or local equivalent) representing the total amount of the credit note, including tax.
    • setAmountShipping

      public void setAmountShipping(Long amountShipping)
      This is the sum of all the shipping amounts.
    • setCreated

      public void setCreated(Long created)
      Time at which the object was created. Measured in seconds since the Unix epoch.
    • setCurrency

      public void setCurrency(String currency)
      Three-letter ISO currency code, in lowercase. Must be a supported currency.
    • setDiscountAmount

      public void setDiscountAmount(Long discountAmount)
      The integer amount in cents (or local equivalent) representing the total amount of discount that was credited.
    • setDiscountAmounts

      public void setDiscountAmounts(List<CreditNote.DiscountAmount> discountAmounts)
      The aggregate amounts calculated per discount for all line items.
    • setEffectiveAt

      public void setEffectiveAt(Long effectiveAt)
      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.
    • setId

      public void setId(String id)
      Unique identifier for the object.
    • setLines

      public void setLines(CreditNoteLineItemCollection lines)
      Line items that make up the credit note.
    • setLivemode

      public void setLivemode(Boolean livemode)
      Has the value true if the object exists in live mode or the value false if the object exists in test mode.
    • setMemo

      public void setMemo(String memo)
      Customer-facing text that appears on the credit note PDF.
    • setMetadata

      public void setMetadata(Map<String,String> 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.
    • setNumber

      public void setNumber(String number)
      A unique number that identifies this particular credit note and appears on the PDF of the credit note and its associated invoice.
    • setObject

      public void setObject(String object)
      String representing the object's type. Objects of the same type share the same value.

      Equal to credit_note.

    • setOutOfBandAmount

      public void setOutOfBandAmount(Long outOfBandAmount)
      Amount that was credited outside of Stripe.
    • setPdf

      public void setPdf(String pdf)
      The link to download the PDF of the credit note.
    • setReason

      public void setReason(String reason)
      Reason for issuing this credit note, one of duplicate, fraudulent, order_change, or product_unsatisfactory.
    • setShippingCost

      public void setShippingCost(CreditNote.ShippingCost shippingCost)
      The details of the cost of shipping, including the ShippingRate applied to the invoice.
    • setStatus

      public void setStatus(String status)
      Status of this credit note, one of issued or void. Learn more about voiding credit notes.
    • setSubtotal

      public void setSubtotal(Long subtotal)
      The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding exclusive tax and invoice level discounts.
    • setSubtotalExcludingTax

      public void setSubtotalExcludingTax(Long subtotalExcludingTax)
      The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding all tax and invoice level discounts.
    • setTaxAmounts

      public void setTaxAmounts(List<CreditNote.TaxAmount> taxAmounts)
      The aggregate amounts calculated per tax rate for all line items.
    • setTotal

      public void setTotal(Long total)
      The integer amount in cents (or local equivalent) representing the total amount of the credit note, including tax and all discount.
    • setTotalExcludingTax

      public void setTotalExcludingTax(Long totalExcludingTax)
      The integer amount in cents (or local equivalent) representing the total amount of the credit note, excluding tax, but including discounts.
    • setType

      public void setType(String 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.
    • setVoidedAt

      public void setVoidedAt(Long voidedAt)
      The time that the credit note was voided.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getId

      public String getId()
      Unique identifier for the object.
      Specified by:
      getId in interface HasId
    • getMetadata

      public Map<String,String> getMetadata()
      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.
      Specified by:
      getMetadata in interface MetadataStore<CreditNote>