Class InvoiceItem

    • Constructor Detail

      • InvoiceItem

        public InvoiceItem()
    • Method Detail

      • getCustomer

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

        public void setCustomer​(java.lang.String id)
      • getCustomerObject

        public Customer getCustomerObject()
        Get expanded customer.
      • setCustomerObject

        public void setCustomerObject​(Customer expandableObject)
      • getInvoice

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

        public void setInvoice​(java.lang.String id)
      • getInvoiceObject

        public Invoice getInvoiceObject()
        Get expanded invoice.
      • setInvoiceObject

        public void setInvoiceObject​(Invoice expandableObject)
      • getSubscription

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

        public void setSubscription​(java.lang.String id)
      • getSubscriptionObject

        public Subscription getSubscriptionObject()
        Get expanded subscription.
      • setSubscriptionObject

        public void setSubscriptionObject​(Subscription expandableObject)
      • getDiscounts

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

        public void setDiscounts​(java.util.List<java.lang.String> ids)
      • getDiscountObjects

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

        public void setDiscountObjects​(java.util.List<Discount> objs)
      • list

        public static InvoiceItemCollection list​(java.util.Map<java.lang.String,​java.lang.Object> params)
                                          throws StripeException
        Returns a list of your invoice items. Invoice items are returned sorted by creation date, with the most recently created invoice items appearing first.
        Throws:
        StripeException
      • list

        public static InvoiceItemCollection list​(java.util.Map<java.lang.String,​java.lang.Object> params,
                                                 RequestOptions options)
                                          throws StripeException
        Returns a list of your invoice items. Invoice items are returned sorted by creation date, with the most recently created invoice items appearing first.
        Throws:
        StripeException
      • create

        public static InvoiceItem create​(java.util.Map<java.lang.String,​java.lang.Object> params)
                                  throws StripeException
        Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is specified, the item will be on the next invoice created for the customer specified.
        Throws:
        StripeException
      • create

        public static InvoiceItem create​(java.util.Map<java.lang.String,​java.lang.Object> params,
                                         RequestOptions options)
                                  throws StripeException
        Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is specified, the item will be on the next invoice created for the customer specified.
        Throws:
        StripeException
      • update

        public InvoiceItem update​(java.util.Map<java.lang.String,​java.lang.Object> params)
                           throws StripeException
        Updates the amount or description of an invoice item on an upcoming invoice. Updating an invoice item is only possible before the invoice it’s attached to is closed.
        Specified by:
        update in interface MetadataStore<InvoiceItem>
        Throws:
        StripeException
      • delete

        public InvoiceItem delete()
                           throws StripeException
        Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they’re not attached to invoices, or if it’s attached to a draft invoice.
        Throws:
        StripeException
      • delete

        public InvoiceItem delete​(RequestOptions options)
                           throws StripeException
        Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they’re not attached to invoices, or if it’s attached to a draft invoice.
        Throws:
        StripeException
      • delete

        public InvoiceItem delete​(java.util.Map<java.lang.String,​java.lang.Object> params)
                           throws StripeException
        Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they’re not attached to invoices, or if it’s attached to a draft invoice.
        Throws:
        StripeException
      • delete

        public InvoiceItem delete​(java.util.Map<java.lang.String,​java.lang.Object> params,
                                  RequestOptions options)
                           throws StripeException
        Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they’re not attached to invoices, or if it’s attached to a draft invoice.
        Throws:
        StripeException
      • getAmount

        public java.lang.Long getAmount()
        Amount (in the currency specified) of the invoice item. This should always be equal to unit_amount * quantity.
      • getDate

        public java.lang.Long getDate()
        Time at which the object was created. Measured in seconds since the Unix epoch.
      • getDeleted

        public java.lang.Boolean getDeleted()
        Always true for a deleted object.
      • getDescription

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

        public java.lang.Boolean getDiscountable()
        If true, discounts will apply to this invoice item. Always false for prorations.
      • getLivemode

        public java.lang.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 java.lang.String getObject()
        String representing the object's type. Objects of the same type share the same value.

        Equal to invoiceitem.

      • getPlan

        public Plan getPlan()
        If the invoice item is a proration, the plan of the subscription that the proration was computed for.
      • getPrice

        public Price getPrice()
        The price of the invoice item.
      • getProration

        public java.lang.Boolean getProration()
        Whether the invoice item was created automatically as a proration adjustment when the customer switched plans.
      • getQuantity

        public java.lang.Long getQuantity()
        Quantity of units for the invoice item. If the invoice item is a proration, the quantity of the subscription that the proration was computed for.
      • getSubscriptionItem

        public java.lang.String getSubscriptionItem()
        The subscription item that this invoice item has been created for, if any.
      • getTaxRates

        public java.util.List<TaxRate> getTaxRates()
        The tax rates which apply to the invoice item. When set, the default_tax_rates on the invoice do not apply to this invoice item.
      • getUnitAmount

        public java.lang.Long getUnitAmount()
        Unit amount (in the currency specified) of the invoice item.
      • getUnitAmountDecimal

        public java.math.BigDecimal getUnitAmountDecimal()
        Same as unit_amount, but contains a decimal value with at most 12 decimal places.
      • setAmount

        public void setAmount​(java.lang.Long amount)
        Amount (in the currency specified) of the invoice item. This should always be equal to unit_amount * quantity.
      • setDate

        public void setDate​(java.lang.Long date)
        Time at which the object was created. Measured in seconds since the Unix epoch.
      • setDeleted

        public void setDeleted​(java.lang.Boolean deleted)
        Always true for a deleted object.
      • setDescription

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

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

        public void setId​(java.lang.String id)
        Unique identifier for the object.
      • setLivemode

        public void setLivemode​(java.lang.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​(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.
      • 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 invoiceitem.

      • setPlan

        public void setPlan​(Plan plan)
        If the invoice item is a proration, the plan of the subscription that the proration was computed for.
      • setPrice

        public void setPrice​(Price price)
        The price of the invoice item.
      • setProration

        public void setProration​(java.lang.Boolean proration)
        Whether the invoice item was created automatically as a proration adjustment when the customer switched plans.
      • setQuantity

        public void setQuantity​(java.lang.Long quantity)
        Quantity of units for the invoice item. If the invoice item is a proration, the quantity of the subscription that the proration was computed for.
      • setSubscriptionItem

        public void setSubscriptionItem​(java.lang.String subscriptionItem)
        The subscription item that this invoice item has been created for, if any.
      • setTaxRates

        public void setTaxRates​(java.util.List<TaxRate> taxRates)
        The tax rates which apply to the invoice item. When set, the default_tax_rates on the invoice do not apply to this invoice item.
      • setUnitAmount

        public void setUnitAmount​(java.lang.Long unitAmount)
        Unit amount (in the currency specified) of the invoice item.
      • setUnitAmountDecimal

        public void setUnitAmountDecimal​(java.math.BigDecimal unitAmountDecimal)
        Same as unit_amount, but contains a decimal value with at most 12 decimal places.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • canEqual

        protected boolean canEqual​(java.lang.Object other)
      • hashCode

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

        public java.lang.String getId()
        Unique identifier for the object.
        Specified by:
        getId in interface HasId
      • 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:
        getMetadata in interface MetadataStore<InvoiceItem>