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 boolean
canEqual(java.lang.Object other)
static InvoiceItem
create(InvoiceItemCreateParams params)
Creates an item to be added to a draft invoice (up to 250 items per invoice).static InvoiceItem
create(InvoiceItemCreateParams params, RequestOptions options)
Creates an item to be added to a draft invoice (up to 250 items per invoice).static InvoiceItem
create(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 InvoiceItem
create(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).InvoiceItem
delete()
Deletes an invoice item, removing it from an invoice.InvoiceItem
delete(RequestOptions options)
Deletes an invoice item, removing it from an invoice.InvoiceItem
delete(java.util.Map<java.lang.String,java.lang.Object> params)
Deletes an invoice item, removing it from an invoice.InvoiceItem
delete(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)
Deletes an invoice item, removing it from an invoice.boolean
equals(java.lang.Object o)
java.lang.Long
getAmount()
Amount (in thecurrency
specified) of the invoice item.java.lang.String
getCurrency()
Three-letter ISO currency code, in lowercase.java.lang.String
getCustomer()
Get ID of expandablecustomer
object.Customer
getCustomerObject()
Get expandedcustomer
.java.lang.Long
getDate()
Time at which the object was created.java.lang.Boolean
getDeleted()
Always true for a deleted object.java.lang.String
getDescription()
An arbitrary string attached to the object.java.lang.Boolean
getDiscountable()
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 expandablediscounts
object list.java.lang.String
getId()
Unique identifier for the object.java.lang.String
getInvoice()
Get ID of expandableinvoice
object.Invoice
getInvoiceObject()
Get expandedinvoice
.java.lang.Boolean
getLivemode()
Has the valuetrue
if the object exists in live mode or the valuefalse
if 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.String
getObject()
String representing the object's type.InvoiceLineItemPeriod
getPeriod()
Plan
getPlan()
If the invoice item is a proration, the plan of the subscription that the proration was computed for.Price
getPrice()
The price of the invoice item.java.lang.Boolean
getProration()
Whether the invoice item was created automatically as a proration adjustment when the customer switched plans.java.lang.Long
getQuantity()
Quantity of units for the invoice item.java.lang.String
getSubscription()
Get ID of expandablesubscription
object.java.lang.String
getSubscriptionItem()
The subscription item that this invoice item has been created for, if any.Subscription
getSubscriptionObject()
Get expandedsubscription
.java.util.List<TaxRate>
getTaxRates()
The tax rates which apply to the invoice item.java.lang.Long
getUnitAmount()
Unit amount (in thecurrency
specified) of the invoice item.java.math.BigDecimal
getUnitAmountDecimal()
Same asunit_amount
, but contains a decimal value with at most 12 decimal places.int
hashCode()
static InvoiceItemCollection
list(InvoiceItemListParams params)
Returns a list of your invoice items.static InvoiceItemCollection
list(InvoiceItemListParams params, RequestOptions options)
Returns a list of your invoice items.static InvoiceItemCollection
list(java.util.Map<java.lang.String,java.lang.Object> params)
Returns a list of your invoice items.static InvoiceItemCollection
list(java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)
Returns a list of your invoice items.static InvoiceItem
retrieve(java.lang.String invoiceitem)
Retrieves the invoice item with the given ID.static InvoiceItem
retrieve(java.lang.String invoiceitem, RequestOptions options)
Retrieves the invoice item with the given ID.static InvoiceItem
retrieve(java.lang.String invoiceitem, InvoiceItemRetrieveParams params, RequestOptions options)
Retrieves the invoice item with the given ID.static InvoiceItem
retrieve(java.lang.String invoiceitem, java.util.Map<java.lang.String,java.lang.Object> params, RequestOptions options)
Retrieves the invoice item with the given ID.void
setAmount(java.lang.Long amount)
Amount (in thecurrency
specified) of the invoice item.void
setCurrency(java.lang.String currency)
Three-letter ISO currency code, in lowercase.void
setCustomer(java.lang.String id)
void
setCustomerObject(Customer expandableObject)
void
setDate(java.lang.Long date)
Time at which the object was created.void
setDeleted(java.lang.Boolean deleted)
Always true for a deleted object.void
setDescription(java.lang.String description)
An arbitrary string attached to the object.void
setDiscountable(java.lang.Boolean discountable)
If true, discounts will apply to this invoice item.void
setDiscountObjects(java.util.List<Discount> objs)
void
setDiscounts(java.util.List<java.lang.String> ids)
void
setId(java.lang.String id)
Unique identifier for the object.void
setInvoice(java.lang.String id)
void
setInvoiceObject(Invoice expandableObject)
void
setLivemode(java.lang.Boolean livemode)
Has the valuetrue
if the object exists in live mode or the valuefalse
if the object exists in test mode.void
setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
Set of key-value pairs that you can attach to an object.void
setObject(java.lang.String object)
String representing the object's type.void
setPeriod(InvoiceLineItemPeriod period)
void
setPlan(Plan plan)
If the invoice item is a proration, the plan of the subscription that the proration was computed for.void
setPrice(Price price)
The price of the invoice item.void
setProration(java.lang.Boolean proration)
Whether the invoice item was created automatically as a proration adjustment when the customer switched plans.void
setQuantity(java.lang.Long quantity)
Quantity of units for the invoice item.void
setSubscription(java.lang.String id)
void
setSubscriptionItem(java.lang.String subscriptionItem)
The subscription item that this invoice item has been created for, if any.void
setSubscriptionObject(Subscription expandableObject)
void
setTaxRates(java.util.List<TaxRate> taxRates)
The tax rates which apply to the invoice item.void
setUnitAmount(java.lang.Long unitAmount)
Unit amount (in thecurrency
specified) of the invoice item.void
setUnitAmountDecimal(java.math.BigDecimal unitAmountDecimal)
Same asunit_amount
, but contains a decimal value with at most 12 decimal places.InvoiceItem
update(InvoiceItemUpdateParams params)
Updates the amount or description of an invoice item on an upcoming invoice.InvoiceItem
update(InvoiceItemUpdateParams params, RequestOptions options)
Updates the amount or description of an invoice item on an upcoming invoice.InvoiceItem
update(java.util.Map<java.lang.String,java.lang.Object> params)
Updates the amount or description of an invoice item on an upcoming invoice.InvoiceItem
update(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, requestSearchResult, requestSearchResult, requestStream, requestStream, 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 expandablecustomer
object.
-
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 expandableinvoice
object.
-
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 expandablesubscription
object.
-
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 expandablediscounts
object 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:
update
in 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:
update
in 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 thecurrency
specified) 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 valuetrue
if the object exists in live mode or the valuefalse
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
.
-
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_rates
on the invoice do not apply to this invoice item.
-
getUnitAmount
public java.lang.Long getUnitAmount()
Unit amount (in thecurrency
specified) 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 thecurrency
specified) 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 valuetrue
if the object exists in live mode or the valuefalse
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
.
-
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_rates
on the invoice do not apply to this invoice item.
-
setUnitAmount
public void setUnitAmount(java.lang.Long unitAmount)
Unit amount (in thecurrency
specified) 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:
equals
in classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in 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:
getMetadata
in interfaceMetadataStore<InvoiceItem>
-
-