Package com.stripe.model
Class InvoiceItem
- java.lang.Object
-
- com.stripe.model.StripeObject
-
- com.stripe.net.ApiResource
-
- com.stripe.model.InvoiceItem
-
- All Implemented Interfaces:
HasId,MetadataStore<InvoiceItem>,StripeObjectInterface
public class InvoiceItem extends ApiResource implements HasId, MetadataStore<InvoiceItem>
-
-
Nested Class Summary
-
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 InvoiceItem()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(java.lang.Object other)static InvoiceItemcreate(InvoiceItemCreateParams params)Creates an item to be added to a draft invoice (up to 250 items per invoice).static InvoiceItemcreate(InvoiceItemCreateParams params, RequestOptions options)Creates an item to be added to a draft invoice (up to 250 items per invoice).static InvoiceItemcreate(java.util.Map<java.lang.String,java.lang.Object> params)Creates an item to be added to a draft invoice (up to 250 items per invoice).static InvoiceItemcreate(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Creates an item to be added to a draft invoice (up to 250 items per invoice).InvoiceItemdelete()Deletes an invoice item, removing it from an invoice.InvoiceItemdelete(RequestOptions options)Deletes an invoice item, removing it from an invoice.InvoiceItemdelete(java.util.Map<java.lang.String,java.lang.Object> params)Deletes an invoice item, removing it from an invoice.InvoiceItemdelete(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Deletes an invoice item, removing it from an invoice.booleanequals(java.lang.Object o)java.lang.LonggetAmount()Amount (in thecurrencyspecified) of the invoice item.java.lang.StringgetCurrency()Three-letter ISO currency code, in lowercase.java.lang.StringgetCustomer()Get ID of expandablecustomerobject.CustomergetCustomerObject()Get expandedcustomer.java.lang.LonggetDate()Time at which the object was created.java.lang.BooleangetDeleted()Always true for a deleted object.java.lang.StringgetDescription()An arbitrary string attached to the object.java.lang.BooleangetDiscountable()If true, discounts will apply to this invoice item.java.util.List<Discount>getDiscountObjects()Get expandeddiscounts.java.util.List<java.lang.String>getDiscounts()Get IDs of expandablediscountsobject list.java.lang.StringgetId()Unique identifier for the object.java.lang.StringgetInvoice()Get ID of expandableinvoiceobject.InvoicegetInvoiceObject()Get expandedinvoice.java.lang.BooleangetLivemode()Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.java.util.Map<java.lang.String,java.lang.String>getMetadata()Set of key-value pairs that you can attach to an object.java.lang.StringgetObject()String representing the object's type.InvoiceLineItemPeriodgetPeriod()PlangetPlan()If the invoice item is a proration, the plan of the subscription that the proration was computed for.PricegetPrice()The price of the invoice item.java.lang.BooleangetProration()Whether the invoice item was created automatically as a proration adjustment when the customer switched plans.java.lang.LonggetQuantity()Quantity of units for the invoice item.java.lang.StringgetSubscription()Get ID of expandablesubscriptionobject.java.lang.StringgetSubscriptionItem()The subscription item that this invoice item has been created for, if any.SubscriptiongetSubscriptionObject()Get expandedsubscription.java.util.List<TaxRate>getTaxRates()The tax rates which apply to the invoice item.java.lang.LonggetUnitAmount()Unit amount (in thecurrencyspecified) of the invoice item.java.math.BigDecimalgetUnitAmountDecimal()Same asunit_amount, but contains a decimal value with at most 12 decimal places.inthashCode()static InvoiceItemCollectionlist(InvoiceItemListParams params)Returns a list of your invoice items.static InvoiceItemCollectionlist(InvoiceItemListParams params, RequestOptions options)Returns a list of your invoice items.static InvoiceItemCollectionlist(java.util.Map<java.lang.String,java.lang.Object> params)Returns a list of your invoice items.static InvoiceItemCollectionlist(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Returns a list of your invoice items.static InvoiceItemretrieve(java.lang.String invoiceitem)Retrieves the invoice item with the given ID.static InvoiceItemretrieve(java.lang.String invoiceitem, RequestOptions options)Retrieves the invoice item with the given ID.static InvoiceItemretrieve(java.lang.String invoiceitem, InvoiceItemRetrieveParams params, RequestOptions options)Retrieves the invoice item with the given ID.static InvoiceItemretrieve(java.lang.String invoiceitem, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Retrieves the invoice item with the given ID.voidsetAmount(java.lang.Long amount)Amount (in thecurrencyspecified) of the invoice item.voidsetCurrency(java.lang.String currency)Three-letter ISO currency code, in lowercase.voidsetCustomer(java.lang.String id)voidsetCustomerObject(Customer expandableObject)voidsetDate(java.lang.Long date)Time at which the object was created.voidsetDeleted(java.lang.Boolean deleted)Always true for a deleted object.voidsetDescription(java.lang.String description)An arbitrary string attached to the object.voidsetDiscountable(java.lang.Boolean discountable)If true, discounts will apply to this invoice item.voidsetDiscountObjects(java.util.List<Discount> objs)voidsetDiscounts(java.util.List<java.lang.String> ids)voidsetId(java.lang.String id)Unique identifier for the object.voidsetInvoice(java.lang.String id)voidsetInvoiceObject(Invoice expandableObject)voidsetLivemode(java.lang.Boolean livemode)Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.voidsetMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)Set of key-value pairs that you can attach to an object.voidsetObject(java.lang.String object)String representing the object's type.voidsetPeriod(InvoiceLineItemPeriod period)voidsetPlan(Plan plan)If the invoice item is a proration, the plan of the subscription that the proration was computed for.voidsetPrice(Price price)The price of the invoice item.voidsetProration(java.lang.Boolean proration)Whether the invoice item was created automatically as a proration adjustment when the customer switched plans.voidsetQuantity(java.lang.Long quantity)Quantity of units for the invoice item.voidsetSubscription(java.lang.String id)voidsetSubscriptionItem(java.lang.String subscriptionItem)The subscription item that this invoice item has been created for, if any.voidsetSubscriptionObject(Subscription expandableObject)voidsetTaxRates(java.util.List<TaxRate> taxRates)The tax rates which apply to the invoice item.voidsetUnitAmount(java.lang.Long unitAmount)Unit amount (in thecurrencyspecified) of the invoice item.voidsetUnitAmountDecimal(java.math.BigDecimal unitAmountDecimal)Same asunit_amount, but contains a decimal value with at most 12 decimal places.InvoiceItemupdate(InvoiceItemUpdateParams params)Updates the amount or description of an invoice item on an upcoming invoice.InvoiceItemupdate(InvoiceItemUpdateParams params, RequestOptions options)Updates the amount or description of an invoice item on an upcoming invoice.InvoiceItemupdate(java.util.Map<java.lang.String,java.lang.Object> params)Updates the amount or description of an invoice item on an upcoming invoice.InvoiceItemupdate(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)Updates the amount or description of an invoice item on an upcoming invoice.-
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)
-
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)
-
getSubscription
public java.lang.String getSubscription()
Get ID of expandablesubscriptionobject.
-
setSubscription
public void setSubscription(java.lang.String id)
-
getSubscriptionObject
public Subscription getSubscriptionObject()
Get expandedsubscription.
-
setSubscriptionObject
public void setSubscriptionObject(Subscription expandableObject)
-
getDiscounts
public java.util.List<java.lang.String> getDiscounts()
Get IDs of expandablediscountsobject list.
-
setDiscounts
public void setDiscounts(java.util.List<java.lang.String> ids)
-
getDiscountObjects
public java.util.List<Discount> getDiscountObjects()
Get expandeddiscounts.
-
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
-
list
public static InvoiceItemCollection list(InvoiceItemListParams 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(InvoiceItemListParams 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
-
create
public static InvoiceItem create(InvoiceItemCreateParams 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(InvoiceItemCreateParams 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
-
retrieve
public static InvoiceItem retrieve(java.lang.String invoiceitem) throws StripeException
Retrieves the invoice item with the given ID.- Throws:
StripeException
-
retrieve
public static InvoiceItem retrieve(java.lang.String invoiceitem, RequestOptions options) throws StripeException
Retrieves the invoice item with the given ID.- Throws:
StripeException
-
retrieve
public static InvoiceItem retrieve(java.lang.String invoiceitem, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) throws StripeException
Retrieves the invoice item with the given ID.- Throws:
StripeException
-
retrieve
public static InvoiceItem retrieve(java.lang.String invoiceitem, InvoiceItemRetrieveParams params, RequestOptions options) throws StripeException
Retrieves the invoice item with the given ID.- 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:
updatein interfaceMetadataStore<InvoiceItem>- Throws:
StripeException
-
update
public InvoiceItem update(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options) 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:
updatein interfaceMetadataStore<InvoiceItem>- Throws:
StripeException
-
update
public InvoiceItem update(InvoiceItemUpdateParams 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.- Throws:
StripeException
-
update
public InvoiceItem update(InvoiceItemUpdateParams params, RequestOptions options) 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.- 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 thecurrencyspecified) of the invoice item. This should always be equal tounit_amount * quantity.
-
getCurrency
public java.lang.String getCurrency()
Three-letter ISO currency code, in lowercase. Must be a supported currency.
-
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 valuetrueif the object exists in live mode or the valuefalseif 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.
-
getPeriod
public InvoiceLineItemPeriod getPeriod()
-
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, thedefault_tax_rateson the invoice do not apply to this invoice item.
-
getUnitAmount
public java.lang.Long getUnitAmount()
Unit amount (in thecurrencyspecified) of the invoice item.
-
getUnitAmountDecimal
public java.math.BigDecimal getUnitAmountDecimal()
Same asunit_amount, but contains a decimal value with at most 12 decimal places.
-
setAmount
public void setAmount(java.lang.Long amount)
Amount (in thecurrencyspecified) of the invoice item. This should always be equal tounit_amount * quantity.
-
setCurrency
public void setCurrency(java.lang.String currency)
Three-letter ISO currency code, in lowercase. Must be a supported currency.
-
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 valuetrueif the object exists in live mode or the valuefalseif 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.
-
setPeriod
public void setPeriod(InvoiceLineItemPeriod period)
-
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, thedefault_tax_rateson the invoice do not apply to this invoice item.
-
setUnitAmount
public void setUnitAmount(java.lang.Long unitAmount)
Unit amount (in thecurrencyspecified) of the invoice item.
-
setUnitAmountDecimal
public void setUnitAmountDecimal(java.math.BigDecimal unitAmountDecimal)
Same asunit_amount, but contains a decimal value with at most 12 decimal places.
-
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<InvoiceItem>
-
-