Class OrderCreateParams.LineItem.Builder
- Enclosing class:
- OrderCreateParams.LineItem
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdd all elements to `discounts` list.addAllTaxRate
(List<String> elements) Add all elements to `taxRates` list.Add an element to `discounts` 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.putExtraParam
(String key, Object value) Add a key/value pair to `extraParams` map.setDescription
(String description) The description for the line item.setDiscounts
(EmptyParam discounts) The discounts applied to this line item.setDiscounts
(List<OrderCreateParams.LineItem.Discount> discounts) The discounts applied to this line item.The ID of a Price to add to the Order.setPriceData
(OrderCreateParams.LineItem.PriceData priceData) Data used to generate a new Price object inline.setProduct
(String product) The ID of a Product to add to the Order.setProductData
(OrderCreateParams.LineItem.ProductData productData) Defines a Product inline and adds it to the Order.setQuantity
(Long quantity) The quantity of the line item.setTaxRates
(EmptyParam taxRates) The tax rates applied to this line item.setTaxRates
(List<String> taxRates) The tax rates applied to this line item.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
build
Finalize and obtain parameter instance from this builder. -
setDescription
The description for the line item. Will default to the name of the associated product. -
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. SeeOrderCreateParams.LineItem.discounts
for the field documentation. -
addAllDiscount
public OrderCreateParams.LineItem.Builder addAllDiscount(List<OrderCreateParams.LineItem.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. SeeOrderCreateParams.LineItem.discounts
for the field documentation. -
setDiscounts
The discounts applied to this line item. -
setDiscounts
public OrderCreateParams.LineItem.Builder setDiscounts(List<OrderCreateParams.LineItem.Discount> discounts) The discounts applied to this line item. -
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. SeeOrderCreateParams.LineItem.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. SeeOrderCreateParams.LineItem.extraParams
for the field documentation. -
setPrice
The ID of a Price to add to the Order.The
price
parameter is an alternative to using theproduct
parameter. If each of your products are sold at a single price, you can setProduct.default_price
and then pass theproduct
parameter when creating a line item. If your products are sold at several possible prices, use theprice
parameter to explicitly specify which one to use. -
setPriceData
public OrderCreateParams.LineItem.Builder setPriceData(OrderCreateParams.LineItem.PriceData priceData) Data used to generate a new Price object inline.The
price_data
parameter is an alternative to using theproduct
orprice
parameters. If you create products upfront and configure aProduct.default_price
, pass theproduct
parameter when creating a line item. If you prefer not to define products upfront, or if you charge variable prices, pass theprice_data
parameter to describe the price for this line item.Each time you pass
price_data
we create a Price for the product. This Price is hidden in both the Dashboard and API lists and cannot be reused. -
setProduct
The ID of a Product to add to the Order.The product must have a
default_price
specified. Otherwise, specify the price by passing theprice
orprice_data
parameter. -
setProductData
public OrderCreateParams.LineItem.Builder setProductData(OrderCreateParams.LineItem.ProductData productData) Defines a Product inline and adds it to the Order.product_data
is an alternative to theproduct
parameter. If you created a Product upfront, use theproduct
parameter to refer to the existing Product. But if you prefer not to create Products upfront, pass theproduct_data
parameter to define a Product inline as part of configuring the Order.product_data
automatically creates a Product, just as if you had manually created the Product. If a Product with the same ID already exists, thenproduct_data
re-uses it to avoid duplicates. -
setQuantity
The quantity of the line item. -
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. SeeOrderCreateParams.LineItem.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. SeeOrderCreateParams.LineItem.taxRates
for the field documentation. -
setTaxRates
The tax rates applied to this line item. -
setTaxRates
The tax rates applied to this line item.
-