Class InvoiceLineItem

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

public class InvoiceLineItem extends ApiResource implements HasId, MetadataStore<InvoiceLineItem>
Invoice Line Items represent the individual lines within an invoice and only exist within the context of an invoice.

Each line item is backed by either an invoice item or a subscription item.

  • Constructor Details

    • InvoiceLineItem

      public InvoiceLineItem()
  • Method Details

    • getSubscription

      public String getSubscription()
      Get ID of expandable subscription object.
    • setSubscription

      public void setSubscription(String id)
    • getSubscriptionObject

      public Subscription getSubscriptionObject()
      Get expanded subscription.
    • setSubscriptionObject

      public void setSubscriptionObject(Subscription expandableObject)
    • getDiscounts

      public List<String> getDiscounts()
      Get IDs of expandable discounts object list.
    • setDiscounts

      public void setDiscounts(List<String> ids)
    • getDiscountObjects

      public List<Discount> getDiscountObjects()
      Get expanded discounts.
    • setDiscountObjects

      public void setDiscountObjects(List<Discount> objs)
    • update

      public InvoiceLineItem update(Map<String,Object> params) throws StripeException
      Updates an invoice’s line item. Some fields, such as tax_amounts, only live on the invoice line item, so they can only be updated through this endpoint. Other fields, such as amount, live on both the invoice item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well. Updating an invoice’s line item is only possible before the invoice is finalized.
      Specified by:
      update in interface MetadataStore<InvoiceLineItem>
      Throws:
      StripeException
    • update

      public InvoiceLineItem update(Map<String,Object> params, RequestOptions options) throws StripeException
      Updates an invoice’s line item. Some fields, such as tax_amounts, only live on the invoice line item, so they can only be updated through this endpoint. Other fields, such as amount, live on both the invoice item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well. Updating an invoice’s line item is only possible before the invoice is finalized.
      Specified by:
      update in interface MetadataStore<InvoiceLineItem>
      Throws:
      StripeException
    • update

      Updates an invoice’s line item. Some fields, such as tax_amounts, only live on the invoice line item, so they can only be updated through this endpoint. Other fields, such as amount, live on both the invoice item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well. Updating an invoice’s line item is only possible before the invoice is finalized.
      Throws:
      StripeException
    • update

      Updates an invoice’s line item. Some fields, such as tax_amounts, only live on the invoice line item, so they can only be updated through this endpoint. Other fields, such as amount, live on both the invoice item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well. Updating an invoice’s line item is only possible before the invoice is finalized.
      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 amount, in cents (or local equivalent).
    • 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.
    • getDiscountAmounts

      public List<InvoiceLineItem.DiscountAmount> getDiscountAmounts()
      The amount of discount calculated per discount for this line item.
    • getDiscountable

      public Boolean getDiscountable()
      If true, discounts will apply to this line item. Always false for prorations.
    • getInvoice

      public String getInvoice()
      The ID of the invoice that contains this line item.
    • 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 line_item.

    • getParent

      public InvoiceLineItem.Parent getParent()
      The parent that generated this invoice.
    • getPeriod

      public InvoiceLineItem.Period getPeriod()
    • getPretaxCreditAmounts

      public List<InvoiceLineItem.PretaxCreditAmount> getPretaxCreditAmounts()
      Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this line item.
    • getPricing

      public InvoiceLineItem.Pricing getPricing()
      The pricing information of the line item.
    • getQuantity

      public Long getQuantity()
      The quantity of the subscription, if the line item is a subscription or a proration.
    • getTaxes

      public List<InvoiceLineItem.Tax> getTaxes()
      The tax information of the line item.
    • setAmount

      public void setAmount(Long amount)
      The amount, in cents (or local equivalent).
    • 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.
    • setDiscountAmounts

      public void setDiscountAmounts(List<InvoiceLineItem.DiscountAmount> discountAmounts)
      The amount of discount calculated per discount for this line item.
    • setDiscountable

      public void setDiscountable(Boolean discountable)
      If true, discounts will apply to this line item. Always false for prorations.
    • setId

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

      public void setInvoice(String invoice)
      The ID of the invoice that contains this line item.
    • 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. Note that for line items with type=subscription, metadata reflects the current metadata from the subscription associated with the line item, unless the invoice line was directly updated with different metadata after creation.
    • setObject

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

      Equal to line_item.

    • setParent

      public void setParent(InvoiceLineItem.Parent parent)
      The parent that generated this invoice.
    • setPeriod

      public void setPeriod(InvoiceLineItem.Period period)
    • setPretaxCreditAmounts

      public void setPretaxCreditAmounts(List<InvoiceLineItem.PretaxCreditAmount> pretaxCreditAmounts)
      Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this line item.
    • setPricing

      public void setPricing(InvoiceLineItem.Pricing pricing)
      The pricing information of the line item.
    • setQuantity

      public void setQuantity(Long quantity)
      The quantity of the subscription, if the line item is a subscription or a proration.
    • setTaxes

      public void setTaxes(List<InvoiceLineItem.Tax> taxes)
      The tax information of the line item.
    • 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. Note that for line items with type=subscription, metadata reflects the current metadata from the subscription associated with the line item, unless the invoice line was directly updated with different metadata after creation.
      Specified by:
      getMetadata in interface MetadataStore<InvoiceLineItem>