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>,StripeActiveObject,StripeObjectInterface
Invoice Items represent the component lines of an invoice. When you create an invoice item with an
invoice field, it is attached to the specified invoice and included as an invoice line item within invoice.lines.
Invoice Items can be created before you are ready to actually send the invoice. This can be particularly useful when combined with a subscription. 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 guides: Integrate with the Invoicing API, Subscription Invoices.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classFor more details about Parent, please refer to the API Reference.static classFor more details about Period, please refer to the API Reference.static classFor more details about Pricing, please refer to the API Reference.static classFor more details about ProrationDetails, please refer to the API Reference.Nested classes/interfaces inherited from class com.stripe.net.ApiResource
ApiResource.RequestMethod -
Field Summary
Fields inherited from class com.stripe.net.ApiResource
CHARSET, GSON, INTERNAL_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.The ID of the account who will be billed when this invoice item is billed.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.Get expandedmargins.Get IDs of expandablemarginsobject list.Set of key-value pairs that you can attach to an object.The amount after discounts, but before credits and taxes.String representing the object's type.The parent that generated this invoice item.The pricing information 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.The tax rates which apply to the invoice item.Get ID of expandabletestClockobject.Get expandedtestClock.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) voidsetCustomerAccount(String customerAccount) The ID of the account who will be billed when this invoice item is billed.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.voidsetMarginObjects(List<Margin> objs) voidsetMargins(List<String> ids) voidsetMetadata(Map<String, String> metadata) Set of key-value pairs that you can attach to an object.voidsetNetAmount(Long netAmount) The amount after discounts, but before credits and taxes.voidString representing the object's type.voidsetParent(InvoiceItem.Parent parent) The parent that generated this invoice item.voidsetPeriod(InvoiceItem.Period period) voidsetPricing(InvoiceItem.Pricing pricing) The pricing information of the invoice item.voidsetProration(Boolean proration) Whether the invoice item was created automatically as a proration adjustment when the customer switched plans.voidsetProrationDetails(InvoiceItem.ProrationDetails prorationDetails) voidsetQuantity(Long quantity) Quantity of units for the invoice item.voidsetResponseGetter(StripeResponseGetter responseGetter) Get expandeddiscount.voidsetTaxRates(List<TaxRate> taxRates) The tax rates which apply to the invoice item.voidsetTestClock(String id) voidsetTestClockObject(TestClock expandableObject) 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, getGlobalResponseGetter, getResponseGetter, setExpandableFieldId, setGlobalResponseGetter, urlEncode, urlEncodeIdMethods inherited from class com.stripe.model.StripeObject
deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.stripe.model.StripeActiveObject
trySetResponseGetter
-
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
-
getTestClock
Get ID of expandabletestClockobject. -
setTestClock
-
getTestClockObject
Get expandedtestClock. -
setTestClockObject
-
getDiscounts
Get IDs of expandablediscountsobject list. -
setDiscounts
-
getDiscountObjects
Get expandeddiscounts. -
setDiscountObjects
-
getMargins
Get IDs of expandablemarginsobject list. -
setMargins
-
getMarginObjects
Get expandedmargins. -
setMarginObjects
-
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
-
setResponseGetter
Get expandeddiscount.- Specified by:
setResponseGetterin interfaceStripeActiveObject- Overrides:
setResponseGetterin classApiResource- Parameters:
responseGetter- theStripeResponseGetterinstance to use for making further requests.
-
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. -
getCustomerAccount
The ID of the account who will be billed when this invoice item is billed. -
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. -
getNetAmount
The amount after discounts, but before credits and taxes. This field isnullfordiscountable=trueitems. -
getObject
String representing the object's type. Objects of the same type share the same value.Equal to
invoiceitem. -
getParent
The parent that generated this invoice item. -
getPeriod
-
getPricing
The pricing information of the invoice item. -
getProration
Whether the invoice item was created automatically as a proration adjustment when the customer switched plans. -
getProrationDetails
-
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. -
getTaxRates
The tax rates which apply to the invoice item. When set, thedefault_tax_rateson the invoice do not apply to this invoice item. -
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. -
setCustomerAccount
The ID of the account who will be billed when this invoice item is billed. -
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. -
setNetAmount
The amount after discounts, but before credits and taxes. This field isnullfordiscountable=trueitems. -
setObject
String representing the object's type. Objects of the same type share the same value.Equal to
invoiceitem. -
setParent
The parent that generated this invoice item. -
setPeriod
-
setPricing
The pricing information of the invoice item. -
setProration
Whether the invoice item was created automatically as a proration adjustment when the customer switched plans. -
setProrationDetails
-
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. -
setTaxRates
The tax rates which apply to the invoice item. When set, thedefault_tax_rateson the invoice do not apply to this invoice item. -
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>
-