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
Sometimes you want to add a charge or credit to a customer, but actually charge or credit the
customer's card only at the end of a regular billing cycle. This is useful for combining several
charges (to minimize per-transaction fees), or for having Stripe tabulate your usage-based
billing totals.
Related guide: Subscription Invoices.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.stripe.net.ApiResource
ApiResource.RequestMethod -
Field Summary
Fields inherited from class com.stripe.net.ApiResource
CHARSET, GSONFields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanstatic 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 InvoiceItemCreates an item to be added to a draft invoice (up to 250 items per invoice).static InvoiceItemcreate(Map<String, Object> params, RequestOptions options) Creates an item to be added to a draft invoice (up to 250 items per invoice).delete()Deletes an invoice item, removing it from an invoice.delete(RequestOptions options) Deletes an invoice item, removing it from an invoice.Deletes an invoice item, removing it from an invoice.delete(Map<String, Object> params, RequestOptions options) Deletes an invoice item, removing it from an invoice.booleanAmount (in thecurrencyspecified) of the invoice item.Three-letter ISO currency code, in lowercase.Get ID of expandablecustomerobject.Get expandedcustomer.getDate()Time at which the object was created.Always true for a deleted object.An arbitrary string attached to the object.If true, discounts will apply to this invoice item.Get expandeddiscounts.Get IDs of expandablediscountsobject list.getId()Unique identifier for the object.Get ID of expandableinvoiceobject.Get expandedinvoice.Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.Set of key-value pairs that you can attach to an object.String representing the object's type.getPlan()If the invoice item is a proration, the plan of the subscription that the proration was computed for.getPrice()The price of the invoice item.Whether the invoice item was created automatically as a proration adjustment when the customer switched plans.Quantity of units for the invoice item.Get ID of expandablesubscriptionobject.The subscription item that this invoice item has been created for, if any.Get expandedsubscription.The tax rates which apply to the invoice item.Get ID of expandabletestClockobject.Get expandedtestClock.Unit amount (in thecurrencyspecified) of the invoice item.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 InvoiceItemCollectionReturns a list of your invoice items.static InvoiceItemCollectionlist(Map<String, Object> params, RequestOptions options) Returns a list of your invoice items.static InvoiceItemRetrieves the invoice item with the given ID.static InvoiceItemretrieve(String invoiceitem, RequestOptions options) Retrieves the invoice item with the given ID.static InvoiceItemretrieve(String invoiceitem, InvoiceItemRetrieveParams params, RequestOptions options) Retrieves the invoice item with the given ID.static InvoiceItemRetrieves the invoice item with the given ID.voidAmount (in thecurrencyspecified) of the invoice item.voidsetCurrency(String currency) Three-letter ISO currency code, in lowercase.voidsetCustomer(String id) voidsetCustomerObject(Customer expandableObject) voidTime at which the object was created.voidsetDeleted(Boolean deleted) Always true for a deleted object.voidsetDescription(String description) An arbitrary string attached to the object.voidsetDiscountable(Boolean discountable) If true, discounts will apply to this invoice item.voidsetDiscountObjects(List<Discount> objs) voidsetDiscounts(List<String> ids) voidUnique identifier for the object.voidsetInvoice(String id) voidsetInvoiceObject(Invoice expandableObject) voidsetLivemode(Boolean livemode) Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.voidsetMetadata(Map<String, String> metadata) Set of key-value pairs that you can attach to an object.voidString representing the object's type.voidsetPeriod(InvoiceItem.Period period) voidIf the invoice item is a proration, the plan of the subscription that the proration was computed for.voidThe price of the invoice item.voidsetProration(Boolean proration) Whether the invoice item was created automatically as a proration adjustment when the customer switched plans.voidsetQuantity(Long quantity) Quantity of units for the invoice item.voidvoidsetSubscriptionItem(String subscriptionItem) The subscription item that this invoice item has been created for, if any.voidsetSubscriptionObject(Subscription expandableObject) voidsetTaxRates(List<TaxRate> taxRates) The tax rates which apply to the invoice item.voidsetTestClock(String id) voidsetTestClockObject(TestClock expandableObject) voidsetUnitAmount(Long unitAmount) Unit amount (in thecurrencyspecified) of the invoice item.voidsetUnitAmountDecimal(BigDecimal unitAmountDecimal) Same asunit_amount, but contains a decimal value with at most 12 decimal places.update(InvoiceItemUpdateParams params) Updates the amount or description of an invoice item on an upcoming invoice.update(InvoiceItemUpdateParams params, RequestOptions options) Updates the amount or description of an invoice item on an upcoming invoice.Updates the amount or description of an invoice item on an upcoming invoice.update(Map<String, 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, urlEncodeIdMethods inherited from class com.stripe.model.StripeObject
equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toString
-
Constructor Details
-
InvoiceItem
public InvoiceItem()
-
-
Method Details
-
getCustomer
Get ID of expandablecustomerobject. -
setCustomer
-
getCustomerObject
Get expandedcustomer. -
setCustomerObject
-
getInvoice
Get ID of expandableinvoiceobject. -
setInvoice
-
getInvoiceObject
Get expandedinvoice. -
setInvoiceObject
-
getSubscription
Get ID of expandablesubscriptionobject. -
setSubscription
-
getSubscriptionObject
Get expandedsubscription. -
setSubscriptionObject
-
getTestClock
Get ID of expandabletestClockobject. -
setTestClock
-
getTestClockObject
Get expandedtestClock. -
setTestClockObject
-
getDiscounts
Get IDs of expandablediscountsobject list. -
setDiscounts
-
getDiscountObjects
Get expandeddiscounts. -
setDiscountObjects
-
create
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(Map<String, Object> params, RequestOptions options) throws StripeExceptionCreates 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
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
-
delete
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
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
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
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
-
list
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(Map<String, Object> params, RequestOptions options) throws StripeExceptionReturns 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
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
-
retrieve
Retrieves the invoice item with the given ID.- Throws:
StripeException
-
retrieve
public static InvoiceItem retrieve(String invoiceitem, RequestOptions options) throws StripeException Retrieves the invoice item with the given ID.- Throws:
StripeException
-
retrieve
public static InvoiceItem retrieve(String invoiceitem, Map<String, Object> params, RequestOptions options) throws StripeExceptionRetrieves the invoice item with the given ID.- Throws:
StripeException
-
retrieve
public static InvoiceItem retrieve(String invoiceitem, InvoiceItemRetrieveParams params, RequestOptions options) throws StripeException Retrieves the invoice item with the given ID.- Throws:
StripeException
-
update
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
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
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
-
getAmount
Amount (in thecurrencyspecified) of the invoice item. This should always be equal tounit_amount * quantity. -
getCurrency
Three-letter ISO currency code, in lowercase. Must be a supported currency. -
getDate
Time at which the object was created. Measured in seconds since the Unix epoch. -
getDeleted
Always true for a deleted object. -
getDescription
An arbitrary string attached to the object. Often useful for displaying to users. -
getDiscountable
If true, discounts will apply to this invoice item. Always false for prorations. -
getLivemode
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode. -
getObject
String representing the object's type. Objects of the same type share the same value.Equal to
invoiceitem. -
getPeriod
-
getPlan
If the invoice item is a proration, the plan of the subscription that the proration was computed for. -
getPrice
The price of the invoice item. -
getProration
Whether the invoice item was created automatically as a proration adjustment when the customer switched plans. -
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
The subscription item that this invoice item has been created for, if any. -
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
Unit amount (in thecurrencyspecified) of the invoice item. -
getUnitAmountDecimal
Same asunit_amount, but contains a decimal value with at most 12 decimal places. -
setAmount
Amount (in thecurrencyspecified) of the invoice item. This should always be equal tounit_amount * quantity. -
setCurrency
Three-letter ISO currency code, in lowercase. Must be a supported currency. -
setDate
Time at which the object was created. Measured in seconds since the Unix epoch. -
setDeleted
Always true for a deleted object. -
setDescription
An arbitrary string attached to the object. Often useful for displaying to users. -
setDiscountable
If true, discounts will apply to this invoice item. Always false for prorations. -
setId
Unique identifier for the object. -
setLivemode
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode. -
setMetadata
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
String representing the object's type. Objects of the same type share the same value.Equal to
invoiceitem. -
setPeriod
-
setPlan
If the invoice item is a proration, the plan of the subscription that the proration was computed for. -
setPrice
The price of the invoice item. -
setProration
Whether the invoice item was created automatically as a proration adjustment when the customer switched plans. -
setQuantity
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
The subscription item that this invoice item has been created for, if any. -
setTaxRates
The tax rates which apply to the invoice item. When set, thedefault_tax_rateson the invoice do not apply to this invoice item. -
setUnitAmount
Unit amount (in thecurrencyspecified) of the invoice item. -
setUnitAmountDecimal
Same asunit_amount, but contains a decimal value with at most 12 decimal places. -
equals
-
canEqual
-
hashCode
public int hashCode() -
getId
Unique identifier for the object. -
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>
-