Class CustomerBalanceTransaction

All Implemented Interfaces:
HasId, MetadataStore<CustomerBalanceTransaction>, StripeObjectInterface

public class CustomerBalanceTransaction extends ApiResource implements HasId, MetadataStore<CustomerBalanceTransaction>
Each customer has a balance value, which denotes a debit or credit that's automatically applied to their next invoice upon finalization. You may modify the value directly by using the update customer API, or by creating a Customer Balance Transaction, which increments or decrements the customer's balance by the specified amount.

Related guide: Customer Balance to learn more.

  • Constructor Details

    • CustomerBalanceTransaction

      public CustomerBalanceTransaction()
  • Method Details

    • getCreditNote

      public String getCreditNote()
      Get ID of expandable creditNote object.
    • setCreditNote

      public void setCreditNote(String id)
    • getCreditNoteObject

      public CreditNote getCreditNoteObject()
      Get expanded creditNote.
    • setCreditNoteObject

      public void setCreditNoteObject(CreditNote expandableObject)
    • 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)
    • 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)
    • update

      Most credit balance transaction fields are immutable, but you may update its description and metadata.
      Specified by:
      update in interface MetadataStore<CustomerBalanceTransaction>
      Throws:
      StripeException
    • update

      public CustomerBalanceTransaction update(Map<String,Object> params, RequestOptions options) throws StripeException
      Most credit balance transaction fields are immutable, but you may update its description and metadata.
      Specified by:
      update in interface MetadataStore<CustomerBalanceTransaction>
      Throws:
      StripeException
    • update

      Most credit balance transaction fields are immutable, but you may update its description and metadata.
      Throws:
      StripeException
    • update

      Most credit balance transaction fields are immutable, but you may update its description and metadata.
      Throws:
      StripeException
    • getAmount

      public Long getAmount()
      The amount of the transaction. A negative value is a credit for the customer's balance, and a positive value is a debit to the customer's balance.
    • 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.
    • getDescription

      public String getDescription()
      An arbitrary string attached to the object. Often useful for displaying to users.
    • getEndingBalance

      public Long getEndingBalance()
      The customer's balance after the transaction was applied. A negative value decreases the amount due on the customer's next invoice. A positive value increases the amount due on the customer's next invoice.
    • 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.
    • getObject

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

      Equal to customer_balance_transaction.

    • getType

      public String getType()
      Transaction type: adjustment, applied_to_invoice, credit_note, initial, invoice_overpaid, invoice_too_large, invoice_too_small, unspent_receiver_credit, or unapplied_from_invoice. See the Customer Balance page to learn more about transaction types.

      One of adjustment, applied_to_invoice, credit_note, initial, invoice_overpaid, invoice_too_large, invoice_too_small, migration, unapplied_from_invoice, or unspent_receiver_credit.

    • setAmount

      public void setAmount(Long amount)
      The amount of the transaction. A negative value is a credit for the customer's balance, and a positive value is a debit to the customer's balance.
    • 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.
    • setDescription

      public void setDescription(String description)
      An arbitrary string attached to the object. Often useful for displaying to users.
    • setEndingBalance

      public void setEndingBalance(Long endingBalance)
      The customer's balance after the transaction was applied. A negative value decreases the amount due on the customer's next invoice. A positive value increases the amount due on the customer's next invoice.
    • setId

      public void setId(String id)
      Unique identifier for the object.
    • 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.
    • 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.
    • setObject

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

      Equal to customer_balance_transaction.

    • setType

      public void setType(String type)
      Transaction type: adjustment, applied_to_invoice, credit_note, initial, invoice_overpaid, invoice_too_large, invoice_too_small, unspent_receiver_credit, or unapplied_from_invoice. See the Customer Balance page to learn more about transaction types.

      One of adjustment, applied_to_invoice, credit_note, initial, invoice_overpaid, invoice_too_large, invoice_too_small, migration, unapplied_from_invoice, or unspent_receiver_credit.

    • 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<CustomerBalanceTransaction>