Package com.stripe.param
Class InvoiceItemCreateParams.Builder
- java.lang.Object
-
- com.stripe.param.InvoiceItemCreateParams.Builder
-
- Enclosing class:
- InvoiceItemCreateParams
public static class InvoiceItemCreateParams.Builder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InvoiceItemCreateParams.Builder
addAllDiscount(java.util.List<InvoiceItemCreateParams.Discount> elements)
Add all elements to `discounts` list.InvoiceItemCreateParams.Builder
addAllExpand(java.util.List<java.lang.String> elements)
Add all elements to `expand` list.InvoiceItemCreateParams.Builder
addAllTaxRate(java.util.List<java.lang.String> elements)
Add all elements to `taxRates` list.InvoiceItemCreateParams.Builder
addDiscount(InvoiceItemCreateParams.Discount element)
Add an element to `discounts` list.InvoiceItemCreateParams.Builder
addExpand(java.lang.String element)
Add an element to `expand` list.InvoiceItemCreateParams.Builder
addTaxRate(java.lang.String element)
Add an element to `taxRates` list.InvoiceItemCreateParams
build()
Finalize and obtain parameter instance from this builder.InvoiceItemCreateParams.Builder
putAllExtraParam(java.util.Map<java.lang.String,java.lang.Object> map)
Add all map key/value pairs to `extraParams` map.InvoiceItemCreateParams.Builder
putAllMetadata(java.util.Map<java.lang.String,java.lang.String> map)
Add all map key/value pairs to `metadata` map.InvoiceItemCreateParams.Builder
putExtraParam(java.lang.String key, java.lang.Object value)
Add a key/value pair to `extraParams` map.InvoiceItemCreateParams.Builder
putMetadata(java.lang.String key, java.lang.String value)
Add a key/value pair to `metadata` map.InvoiceItemCreateParams.Builder
setAmount(java.lang.Long amount)
The integer amount in %s of the charge to be applied to the upcoming invoice.InvoiceItemCreateParams.Builder
setCurrency(java.lang.String currency)
Three-letter ISO currency code, in lowercase.InvoiceItemCreateParams.Builder
setCustomer(java.lang.String customer)
The ID of the customer who will be billed when this invoice item is billed.InvoiceItemCreateParams.Builder
setDescription(java.lang.String description)
An arbitrary string which you can attach to the invoice item.InvoiceItemCreateParams.Builder
setDiscountable(java.lang.Boolean discountable)
Controls whether discounts apply to this invoice item.InvoiceItemCreateParams.Builder
setDiscounts(EmptyParam discounts)
The coupons to redeem into discounts for the invoice item or invoice line item.InvoiceItemCreateParams.Builder
setDiscounts(java.util.List<InvoiceItemCreateParams.Discount> discounts)
The coupons to redeem into discounts for the invoice item or invoice line item.InvoiceItemCreateParams.Builder
setInvoice(java.lang.String invoice)
The ID of an existing invoice to add this invoice item to.InvoiceItemCreateParams.Builder
setMetadata(EmptyParam metadata)
Set of key-value pairs that you can attach to an object.InvoiceItemCreateParams.Builder
setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
Set of key-value pairs that you can attach to an object.InvoiceItemCreateParams.Builder
setPeriod(InvoiceItemCreateParams.Period period)
The period associated with this invoice item.InvoiceItemCreateParams.Builder
setPrice(java.lang.String price)
The ID of the price object.InvoiceItemCreateParams.Builder
setPriceData(InvoiceItemCreateParams.PriceData priceData)
Data used to generate a new Price object inline.InvoiceItemCreateParams.Builder
setQuantity(java.lang.Long quantity)
Non-negative integer.InvoiceItemCreateParams.Builder
setSubscription(java.lang.String subscription)
The ID of a subscription to add this invoice item to.InvoiceItemCreateParams.Builder
setUnitAmount(java.lang.Long unitAmount)
The integer unit amount in %s of the charge to be applied to the upcoming invoice.InvoiceItemCreateParams.Builder
setUnitAmountDecimal(java.math.BigDecimal unitAmountDecimal)
Same asunit_amount
, but accepts a decimal value in %s with at most 12 decimal places.
-
-
-
Method Detail
-
build
public InvoiceItemCreateParams build()
Finalize and obtain parameter instance from this builder.
-
setAmount
public InvoiceItemCreateParams.Builder setAmount(java.lang.Long amount)
The integer amount in %s of the charge to be applied to the upcoming invoice. Passing in a negativeamount
will reduce theamount_due
on the invoice.
-
setCurrency
public InvoiceItemCreateParams.Builder setCurrency(java.lang.String currency)
Three-letter ISO currency code, in lowercase. Must be a supported currency.
-
setCustomer
public InvoiceItemCreateParams.Builder setCustomer(java.lang.String customer)
The ID of the customer who will be billed when this invoice item is billed.
-
setDescription
public InvoiceItemCreateParams.Builder setDescription(java.lang.String description)
An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
-
setDiscountable
public InvoiceItemCreateParams.Builder setDiscountable(java.lang.Boolean discountable)
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
public InvoiceItemCreateParams.Builder addDiscount(InvoiceItemCreateParams.Discount element)
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(java.util.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
public InvoiceItemCreateParams.Builder setDiscounts(EmptyParam discounts)
The coupons to redeem into discounts for the invoice item or invoice line item.
-
setDiscounts
public InvoiceItemCreateParams.Builder setDiscounts(java.util.List<InvoiceItemCreateParams.Discount> discounts)
The coupons to redeem into discounts for the invoice item or invoice line item.
-
addExpand
public InvoiceItemCreateParams.Builder addExpand(java.lang.String element)
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
public InvoiceItemCreateParams.Builder addAllExpand(java.util.List<java.lang.String> elements)
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
public InvoiceItemCreateParams.Builder putExtraParam(java.lang.String key, java.lang.Object value)
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
public InvoiceItemCreateParams.Builder putAllExtraParam(java.util.Map<java.lang.String,java.lang.Object> map)
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
public InvoiceItemCreateParams.Builder setInvoice(java.lang.String invoice)
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
public InvoiceItemCreateParams.Builder putMetadata(java.lang.String key, java.lang.String value)
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
public InvoiceItemCreateParams.Builder putAllMetadata(java.util.Map<java.lang.String,java.lang.String> map)
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
public InvoiceItemCreateParams.Builder setMetadata(EmptyParam 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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value tometadata
.
-
setMetadata
public InvoiceItemCreateParams.Builder 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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value tometadata
.
-
setPeriod
public InvoiceItemCreateParams.Builder setPeriod(InvoiceItemCreateParams.Period period)
The period associated with this invoice item.
-
setPrice
public InvoiceItemCreateParams.Builder setPrice(java.lang.String price)
The ID of the price object.
-
setPriceData
public InvoiceItemCreateParams.Builder setPriceData(InvoiceItemCreateParams.PriceData priceData)
Data used to generate a new Price object inline.
-
setQuantity
public InvoiceItemCreateParams.Builder setQuantity(java.lang.Long quantity)
Non-negative integer. The quantity of units for the invoice item.
-
setSubscription
public InvoiceItemCreateParams.Builder setSubscription(java.lang.String subscription)
The ID of a subscription to add this invoice item to. When left blank, the invoice item will be be 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.
-
addTaxRate
public InvoiceItemCreateParams.Builder addTaxRate(java.lang.String element)
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
public InvoiceItemCreateParams.Builder addAllTaxRate(java.util.List<java.lang.String> elements)
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
public InvoiceItemCreateParams.Builder setUnitAmount(java.lang.Long unitAmount)
The integer unit amount in %s 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
public InvoiceItemCreateParams.Builder setUnitAmountDecimal(java.math.BigDecimal unitAmountDecimal)
Same asunit_amount
, but accepts a decimal value in %s with at most 12 decimal places. Only one ofunit_amount
andunit_amount_decimal
can be set.
-
-