Package com.stripe.param
Class InvoiceItemCreateParams.Builder
java.lang.Object
com.stripe.param.InvoiceItemCreateParams.Builder
- Enclosing class:
- InvoiceItemCreateParams
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddAllDiscount
(List<InvoiceItemCreateParams.Discount> elements) Add all elements to `discounts` list.addAllExpand
(List<String> elements) Add all elements to `expand` list.addAllTaxRate
(List<String> elements) Add all elements to `taxRates` list.Add an element to `discounts` list.Add an element to `expand` list.addTaxRate
(String element) Add an element to `taxRates` list.build()
Finalize and obtain parameter instance from this builder.putAllExtraParam
(Map<String, Object> map) Add all map key/value pairs to `extraParams` map.putAllMetadata
(Map<String, String> map) Add all map key/value pairs to `metadata` map.putExtraParam
(String key, Object value) Add a key/value pair to `extraParams` map.putMetadata
(String key, String value) Add a key/value pair to `metadata` map.The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice.setCurrency
(String currency) Three-letter ISO currency code, in lowercase.setCustomer
(String customer) Required. The ID of the customer who will be billed when this invoice item is billed.setDescription
(String description) An arbitrary string which you can attach to the invoice item.setDiscountable
(Boolean discountable) Controls whether discounts apply to this invoice item.setDiscounts
(EmptyParam discounts) The coupons and promotion codes to redeem into discounts for the invoice item or invoice line item.setDiscounts
(List<InvoiceItemCreateParams.Discount> discounts) The coupons and promotion codes to redeem into discounts for the invoice item or invoice line item.setInvoice
(String invoice) The ID of an existing invoice to add this invoice item to.setMetadata
(EmptyParam metadata) Set of key-value pairs that you can attach to an object.setMetadata
(Map<String, String> metadata) Set of key-value pairs that you can attach to an object.The period associated with this invoice item.The ID of the price object.setPriceData
(InvoiceItemCreateParams.PriceData priceData) Data used to generate a new Price object inline.setQuantity
(Long quantity) Non-negative integer.setSubscription
(String subscription) The ID of a subscription to add this invoice item to.setTaxBehavior
(InvoiceItemCreateParams.TaxBehavior taxBehavior) Only required if a default tax behavior was not provided in the Stripe Tax settings.setTaxCode
(EmptyParam taxCode) A tax code ID.setTaxCode
(String taxCode) A tax code ID.setUnitAmount
(Long unitAmount) The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice.setUnitAmountDecimal
(BigDecimal unitAmountDecimal) Same asunit_amount
, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
build
Finalize and obtain parameter instance from this builder. -
setAmount
The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. Passing in a negativeamount
will reduce theamount_due
on the invoice. -
setCurrency
Three-letter ISO currency code, in lowercase. Must be a supported currency. -
setCustomer
Required. The ID of the customer who will be billed when this invoice item is billed. -
setDescription
An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. -
setDiscountable
Controls whether discounts apply to this invoice item. Defaults to false for prorations or negative invoice items, and true for all other invoice items. -
addDiscount
Add an element to `discounts` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeeInvoiceItemCreateParams.discounts
for the field documentation. -
addAllDiscount
public InvoiceItemCreateParams.Builder addAllDiscount(List<InvoiceItemCreateParams.Discount> elements) Add all elements to `discounts` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeeInvoiceItemCreateParams.discounts
for the field documentation. -
setDiscounts
The coupons and promotion codes to redeem into discounts for the invoice item or invoice line item. -
setDiscounts
public InvoiceItemCreateParams.Builder setDiscounts(List<InvoiceItemCreateParams.Discount> discounts) The coupons and promotion codes to redeem into discounts for the invoice item or invoice line item. -
addExpand
Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeeInvoiceItemCreateParams.expand
for the field documentation. -
addAllExpand
Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeeInvoiceItemCreateParams.expand
for the field documentation. -
putExtraParam
Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. SeeInvoiceItemCreateParams.extraParams
for the field documentation. -
putAllExtraParam
Add all map key/value pairs to `extraParams` map. A map is initialized for the first `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. SeeInvoiceItemCreateParams.extraParams
for the field documentation. -
setInvoice
The ID of an existing invoice to add this invoice item to. When left blank, the invoice item will be added to the next upcoming scheduled invoice. This is useful when adding invoice items in response to an invoice.created webhook. You can only add invoice items to draft invoices and there is a maximum of 250 items per invoice. -
putMetadata
Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. SeeInvoiceItemCreateParams.metadata
for the field documentation. -
putAllMetadata
Add all map key/value pairs to `metadata` map. A map is initialized for the first `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. SeeInvoiceItemCreateParams.metadata
for the field documentation. -
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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value tometadata
. -
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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value tometadata
. -
setPeriod
The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have Stripe Revenue Recognition enabled, the period will be used to recognize and defer revenue. See the Revenue Recognition documentation for details. -
setPrice
The ID of the price object. One ofprice
orprice_data
is required. -
setPriceData
-
setQuantity
Non-negative integer. The quantity of units for the invoice item. -
setSubscription
The ID of a subscription to add this invoice item to. When left blank, the invoice item is added to the next upcoming scheduled invoice. When set, scheduled invoices for subscriptions other than the specified subscription will ignore the invoice item. Use this when you want to express that an invoice item has been accrued within the context of a particular subscription. -
setTaxBehavior
public InvoiceItemCreateParams.Builder setTaxBehavior(InvoiceItemCreateParams.TaxBehavior taxBehavior) Only required if a default tax behavior was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One ofinclusive
,exclusive
, orunspecified
. Once specified as eitherinclusive
orexclusive
, it cannot be changed. -
setTaxCode
A tax code ID. -
setTaxCode
A tax code ID. -
addTaxRate
Add an element to `taxRates` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeeInvoiceItemCreateParams.taxRates
for the field documentation. -
addAllTaxRate
Add all elements to `taxRates` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeeInvoiceItemCreateParams.taxRates
for the field documentation. -
setUnitAmount
The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. Thisunit_amount
will be multiplied by the quantity to get the full amount. Passing in a negativeunit_amount
will reduce theamount_due
on the invoice. -
setUnitAmountDecimal
Same asunit_amount
, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one ofunit_amount
andunit_amount_decimal
can be set.
-