Class CreditNote
- java.lang.Object
-
- com.stripe.model.StripeObject
-
- com.stripe.net.ApiResource
-
- com.stripe.model.CreditNote
-
- All Implemented Interfaces:
HasId,MetadataStore<CreditNote>,StripeObjectInterface
public class CreditNote extends ApiResource implements HasId, MetadataStore<CreditNote>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCreditNote.DiscountAmountstatic classCreditNote.TaxAmount-
Nested classes/interfaces inherited from class com.stripe.net.ApiResource
ApiResource.RequestMethod
-
-
Field Summary
-
Fields inherited from class com.stripe.net.ApiResource
CHARSET, GSON
-
Fields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON
-
-
Constructor Summary
Constructors Constructor Description CreditNote()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(java.lang.Object other)static CreditNotecreate(CreditNoteCreateParams params)Issue a credit note to adjust the amount of a finalized invoice.static CreditNotecreate(CreditNoteCreateParams params, RequestOptions options)Issue a credit note to adjust the amount of a finalized invoice.static CreditNotecreate(java.util.Map<java.lang.String,java.lang.Object> params)Issue a credit note to adjust the amount of a finalized invoice.static CreditNotecreate(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Issue a credit note to adjust the amount of a finalized invoice.booleanequals(java.lang.Object o)java.lang.LonggetAmount()The integer amount in %s representing the total amount of the credit note, including tax.java.lang.LonggetCreated()Time at which the object was created.java.lang.StringgetCurrency()Three-letter ISO currency code, in lowercase.java.lang.StringgetCustomer()Get ID of expandablecustomerobject.java.lang.StringgetCustomerBalanceTransaction()Get ID of expandablecustomerBalanceTransactionobject.CustomerBalanceTransactiongetCustomerBalanceTransactionObject()Get expandedcustomerBalanceTransaction.CustomergetCustomerObject()Get expandedcustomer.java.lang.LonggetDiscountAmount()The integer amount in %s representing the total amount of discount that was credited.java.util.List<CreditNote.DiscountAmount>getDiscountAmounts()The aggregate amounts calculated per discount for all line items.java.lang.StringgetId()Unique identifier for the object.java.lang.StringgetInvoice()Get ID of expandableinvoiceobject.InvoicegetInvoiceObject()Get expandedinvoice.CreditNoteLineItemCollectiongetLines()Line items that make up the credit note.java.lang.BooleangetLivemode()Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.java.lang.StringgetMemo()Customer-facing text that appears on the credit note PDF.java.util.Map<java.lang.String,java.lang.String>getMetadata()Set of key-value pairs that you can attach to an object.java.lang.StringgetNumber()A unique number that identifies this particular credit note and appears on the PDF of the credit note and its associated invoice.java.lang.StringgetObject()String representing the object's type.java.lang.LonggetOutOfBandAmount()Amount that was credited outside of Stripe.java.lang.StringgetPdf()The link to download the PDF of the credit note.java.lang.StringgetReason()Reason for issuing this credit note, one ofduplicate,fraudulent,order_change, orproduct_unsatisfactory.java.lang.StringgetRefund()Get ID of expandablerefundobject.RefundgetRefundObject()Get expandedrefund.java.lang.StringgetStatus()Status of this credit note, one ofissuedorvoid.java.lang.LonggetSubtotal()The integer amount in %s representing the amount of the credit note, excluding tax and invoice level discounts.java.util.List<CreditNote.TaxAmount>getTaxAmounts()The aggregate amounts calculated per tax rate for all line items.java.lang.LonggetTotal()The integer amount in %s representing the total amount of the credit note, including tax and all discount.java.lang.StringgetType()Type of this credit note, one ofpre_paymentorpost_payment.java.lang.LonggetVoidedAt()The time that the credit note was voided.inthashCode()static CreditNoteCollectionlist(CreditNoteListParams params)Returns a list of credit notes.static CreditNoteCollectionlist(CreditNoteListParams params, RequestOptions options)Returns a list of credit notes.static CreditNoteCollectionlist(java.util.Map<java.lang.String,java.lang.Object> params)Returns a list of credit notes.static CreditNoteCollectionlist(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Returns a list of credit notes.static CreditNotepreview(CreditNotePreviewParams params)Get a preview of a credit note without creating it.static CreditNotepreview(CreditNotePreviewParams params, RequestOptions options)Get a preview of a credit note without creating it.static CreditNotepreview(java.util.Map<java.lang.String,java.lang.Object> params)Get a preview of a credit note without creating it.static CreditNotepreview(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Get a preview of a credit note without creating it.static CreditNoteretrieve(java.lang.String id)Retrieves the credit note object with the given identifier.static CreditNoteretrieve(java.lang.String id, RequestOptions options)Retrieves the credit note object with the given identifier.static CreditNoteretrieve(java.lang.String id, CreditNoteRetrieveParams params, RequestOptions options)Retrieves the credit note object with the given identifier.static CreditNoteretrieve(java.lang.String id, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Retrieves the credit note object with the given identifier.voidsetAmount(java.lang.Long amount)The integer amount in %s representing the total amount of the credit note, including tax.voidsetCreated(java.lang.Long created)Time at which the object was created.voidsetCurrency(java.lang.String currency)Three-letter ISO currency code, in lowercase.voidsetCustomer(java.lang.String id)voidsetCustomerBalanceTransaction(java.lang.String id)voidsetCustomerBalanceTransactionObject(CustomerBalanceTransaction expandableObject)voidsetCustomerObject(Customer expandableObject)voidsetDiscountAmount(java.lang.Long discountAmount)The integer amount in %s representing the total amount of discount that was credited.voidsetDiscountAmounts(java.util.List<CreditNote.DiscountAmount> discountAmounts)The aggregate amounts calculated per discount for all line items.voidsetId(java.lang.String id)Unique identifier for the object.voidsetInvoice(java.lang.String id)voidsetInvoiceObject(Invoice expandableObject)voidsetLines(CreditNoteLineItemCollection lines)Line items that make up the credit note.voidsetLivemode(java.lang.Boolean livemode)Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.voidsetMemo(java.lang.String memo)Customer-facing text that appears on the credit note PDF.voidsetMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)Set of key-value pairs that you can attach to an object.voidsetNumber(java.lang.String number)A unique number that identifies this particular credit note and appears on the PDF of the credit note and its associated invoice.voidsetObject(java.lang.String object)String representing the object's type.voidsetOutOfBandAmount(java.lang.Long outOfBandAmount)Amount that was credited outside of Stripe.voidsetPdf(java.lang.String pdf)The link to download the PDF of the credit note.voidsetReason(java.lang.String reason)Reason for issuing this credit note, one ofduplicate,fraudulent,order_change, orproduct_unsatisfactory.voidsetRefund(java.lang.String id)voidsetRefundObject(Refund expandableObject)voidsetStatus(java.lang.String status)Status of this credit note, one ofissuedorvoid.voidsetSubtotal(java.lang.Long subtotal)The integer amount in %s representing the amount of the credit note, excluding tax and invoice level discounts.voidsetTaxAmounts(java.util.List<CreditNote.TaxAmount> taxAmounts)The aggregate amounts calculated per tax rate for all line items.voidsetTotal(java.lang.Long total)The integer amount in %s representing the total amount of the credit note, including tax and all discount.voidsetType(java.lang.String type)Type of this credit note, one ofpre_paymentorpost_payment.voidsetVoidedAt(java.lang.Long voidedAt)The time that the credit note was voided.CreditNoteupdate(CreditNoteUpdateParams params)Updates an existing credit note.CreditNoteupdate(CreditNoteUpdateParams params, RequestOptions options)Updates an existing credit note.CreditNoteupdate(java.util.Map<java.lang.String,java.lang.Object> params)Updates an existing credit note.CreditNoteupdate(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Updates an existing credit note.CreditNotevoidCreditNote()Marks a credit note as void.CreditNotevoidCreditNote(RequestOptions options)Marks a credit note as void.CreditNotevoidCreditNote(CreditNoteVoidCreditNoteParams params)Marks a credit note as void.CreditNotevoidCreditNote(CreditNoteVoidCreditNoteParams params, RequestOptions options)Marks a credit note as void.CreditNotevoidCreditNote(java.util.Map<java.lang.String,java.lang.Object> params)Marks a credit note as void.CreditNotevoidCreditNote(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Marks a credit note as void.-
Methods inherited from class com.stripe.net.ApiResource
checkNullTypedParams, classUrl, classUrl, instanceUrl, instanceUrl, request, request, requestCollection, requestCollection, setExpandableFieldId, setStripeResponseGetter, singleClassUrl, singleClassUrl, subresourceUrl, urlEncode, urlEncodeId
-
Methods inherited from class com.stripe.model.StripeObject
equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toString
-
-
-
-
Method Detail
-
getCustomer
public java.lang.String getCustomer()
Get ID of expandablecustomerobject.
-
setCustomer
public void setCustomer(java.lang.String id)
-
getCustomerObject
public Customer getCustomerObject()
Get expandedcustomer.
-
setCustomerObject
public void setCustomerObject(Customer expandableObject)
-
getCustomerBalanceTransaction
public java.lang.String getCustomerBalanceTransaction()
Get ID of expandablecustomerBalanceTransactionobject.
-
setCustomerBalanceTransaction
public void setCustomerBalanceTransaction(java.lang.String id)
-
getCustomerBalanceTransactionObject
public CustomerBalanceTransaction getCustomerBalanceTransactionObject()
Get expandedcustomerBalanceTransaction.
-
setCustomerBalanceTransactionObject
public void setCustomerBalanceTransactionObject(CustomerBalanceTransaction expandableObject)
-
getInvoice
public java.lang.String getInvoice()
Get ID of expandableinvoiceobject.
-
setInvoice
public void setInvoice(java.lang.String id)
-
getInvoiceObject
public Invoice getInvoiceObject()
Get expandedinvoice.
-
setInvoiceObject
public void setInvoiceObject(Invoice expandableObject)
-
getRefund
public java.lang.String getRefund()
Get ID of expandablerefundobject.
-
setRefund
public void setRefund(java.lang.String id)
-
getRefundObject
public Refund getRefundObject()
Get expandedrefund.
-
setRefundObject
public void setRefundObject(Refund expandableObject)
-
create
public static CreditNote create(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Issue a credit note to adjust the amount of a finalized invoice. For astatus=openinvoice, a credit note reduces itsamount_due. For astatus=paidinvoice, a credit note does not affect itsamount_due. Instead, it can result in any combination of the following:- Refund: create a new refund (using
refund_amount) or link an existing refund (usingrefund). - 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_amountorpost_payment_credit_notes_amountdepending on itsstatusat the time of credit note creation.- Throws:
StripeException
- Refund: create a new refund (using
-
create
public static CreditNote create(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Issue a credit note to adjust the amount of a finalized invoice. For astatus=openinvoice, a credit note reduces itsamount_due. For astatus=paidinvoice, a credit note does not affect itsamount_due. Instead, it can result in any combination of the following:- Refund: create a new refund (using
refund_amount) or link an existing refund (usingrefund). - 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_amountorpost_payment_credit_notes_amountdepending on itsstatusat the time of credit note creation.- Throws:
StripeException
- Refund: create a new refund (using
-
create
public static CreditNote create(CreditNoteCreateParams params) throws StripeException
Issue a credit note to adjust the amount of a finalized invoice. For astatus=openinvoice, a credit note reduces itsamount_due. For astatus=paidinvoice, a credit note does not affect itsamount_due. Instead, it can result in any combination of the following:- Refund: create a new refund (using
refund_amount) or link an existing refund (usingrefund). - 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_amountorpost_payment_credit_notes_amountdepending on itsstatusat the time of credit note creation.- Throws:
StripeException
- Refund: create a new refund (using
-
create
public static CreditNote create(CreditNoteCreateParams params, RequestOptions options) throws StripeException
Issue a credit note to adjust the amount of a finalized invoice. For astatus=openinvoice, a credit note reduces itsamount_due. For astatus=paidinvoice, a credit note does not affect itsamount_due. Instead, it can result in any combination of the following:- Refund: create a new refund (using
refund_amount) or link an existing refund (usingrefund). - 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_amountorpost_payment_credit_notes_amountdepending on itsstatusat the time of credit note creation.- Throws:
StripeException
- Refund: create a new refund (using
-
preview
public static CreditNote preview(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Get a preview of a credit note without creating it.- Throws:
StripeException
-
preview
public static CreditNote preview(java.util.Map<java.lang.String,java.lang.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(java.lang.String id) throws StripeException
Retrieves the credit note object with the given identifier.- Throws:
StripeException
-
retrieve
public static CreditNote retrieve(java.lang.String id, RequestOptions options) throws StripeException
Retrieves the credit note object with the given identifier.- Throws:
StripeException
-
retrieve
public static CreditNote retrieve(java.lang.String id, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Retrieves the credit note object with the given identifier.- Throws:
StripeException
-
retrieve
public static CreditNote retrieve(java.lang.String id, CreditNoteRetrieveParams params, RequestOptions options) throws StripeException
Retrieves the credit note object with the given identifier.- Throws:
StripeException
-
list
public static CreditNoteCollection list(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Returns a list of credit notes.- Throws:
StripeException
-
list
public static CreditNoteCollection list(java.util.Map<java.lang.String,java.lang.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
-
update
public CreditNote update(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Updates an existing credit note.- Specified by:
updatein interfaceMetadataStore<CreditNote>- Throws:
StripeException
-
update
public CreditNote update(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Updates an existing credit note.- Specified by:
updatein interfaceMetadataStore<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(java.util.Map<java.lang.String,java.lang.Object> params) throws StripeException
Marks a credit note as void. Learn more about voiding credit notes.- Throws:
StripeException
-
voidCreditNote
public CreditNote voidCreditNote(java.util.Map<java.lang.String,java.lang.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
-
getAmount
public java.lang.Long getAmount()
The integer amount in %s representing the total amount of the credit note, including tax.
-
getCreated
public java.lang.Long getCreated()
Time at which the object was created. Measured in seconds since the Unix epoch.
-
getCurrency
public java.lang.String getCurrency()
Three-letter ISO currency code, in lowercase. Must be a supported currency.
-
getDiscountAmount
public java.lang.Long getDiscountAmount()
The integer amount in %s representing the total amount of discount that was credited.
-
getDiscountAmounts
public java.util.List<CreditNote.DiscountAmount> getDiscountAmounts()
The aggregate amounts calculated per discount for all line items.
-
getLines
public CreditNoteLineItemCollection getLines()
Line items that make up the credit note.
-
getLivemode
public java.lang.Boolean getLivemode()
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.
-
getMemo
public java.lang.String getMemo()
Customer-facing text that appears on the credit note PDF.
-
getNumber
public java.lang.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 java.lang.String getObject()
String representing the object's type. Objects of the same type share the same value.Equal to
credit_note.
-
getOutOfBandAmount
public java.lang.Long getOutOfBandAmount()
Amount that was credited outside of Stripe.
-
getPdf
public java.lang.String getPdf()
The link to download the PDF of the credit note.
-
getReason
public java.lang.String getReason()
Reason for issuing this credit note, one ofduplicate,fraudulent,order_change, orproduct_unsatisfactory.
-
getStatus
public java.lang.String getStatus()
-
getSubtotal
public java.lang.Long getSubtotal()
The integer amount in %s representing the amount of the credit note, excluding tax and invoice level discounts.
-
getTaxAmounts
public java.util.List<CreditNote.TaxAmount> getTaxAmounts()
The aggregate amounts calculated per tax rate for all line items.
-
getTotal
public java.lang.Long getTotal()
The integer amount in %s representing the total amount of the credit note, including tax and all discount.
-
getType
public java.lang.String getType()
Type of this credit note, one ofpre_paymentorpost_payment. Apre_paymentcredit note means it was issued when the invoice was open. Apost_paymentcredit note means it was issued when the invoice was paid.
-
getVoidedAt
public java.lang.Long getVoidedAt()
The time that the credit note was voided.
-
setAmount
public void setAmount(java.lang.Long amount)
The integer amount in %s representing the total amount of the credit note, including tax.
-
setCreated
public void setCreated(java.lang.Long created)
Time at which the object was created. Measured in seconds since the Unix epoch.
-
setCurrency
public void setCurrency(java.lang.String currency)
Three-letter ISO currency code, in lowercase. Must be a supported currency.
-
setDiscountAmount
public void setDiscountAmount(java.lang.Long discountAmount)
The integer amount in %s representing the total amount of discount that was credited.
-
setDiscountAmounts
public void setDiscountAmounts(java.util.List<CreditNote.DiscountAmount> discountAmounts)
The aggregate amounts calculated per discount for all line items.
-
setId
public void setId(java.lang.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(java.lang.Boolean livemode)
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.
-
setMemo
public void setMemo(java.lang.String memo)
Customer-facing text that appears on the credit note PDF.
-
setMetadata
public void setMetadata(java.util.Map<java.lang.String,java.lang.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(java.lang.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(java.lang.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(java.lang.Long outOfBandAmount)
Amount that was credited outside of Stripe.
-
setPdf
public void setPdf(java.lang.String pdf)
The link to download the PDF of the credit note.
-
setReason
public void setReason(java.lang.String reason)
Reason for issuing this credit note, one ofduplicate,fraudulent,order_change, orproduct_unsatisfactory.
-
setStatus
public void setStatus(java.lang.String status)
-
setSubtotal
public void setSubtotal(java.lang.Long subtotal)
The integer amount in %s representing the amount of the credit note, excluding tax and invoice level discounts.
-
setTaxAmounts
public void setTaxAmounts(java.util.List<CreditNote.TaxAmount> taxAmounts)
The aggregate amounts calculated per tax rate for all line items.
-
setTotal
public void setTotal(java.lang.Long total)
The integer amount in %s representing the total amount of the credit note, including tax and all discount.
-
setType
public void setType(java.lang.String type)
Type of this credit note, one ofpre_paymentorpost_payment. Apre_paymentcredit note means it was issued when the invoice was open. Apost_paymentcredit note means it was issued when the invoice was paid.
-
setVoidedAt
public void setVoidedAt(java.lang.Long voidedAt)
The time that the credit note was voided.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getId
public java.lang.String getId()
Unique identifier for the object.
-
getMetadata
public java.util.Map<java.lang.String,java.lang.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:
getMetadatain interfaceMetadataStore<CreditNote>
-
-