Class OrderUpdateParams.LineItem.Builder
- Enclosing class:
- OrderUpdateParams.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
(EmptyParam description) The description for the line item.setDescription
(String description) The description for the line item.setDiscounts
(EmptyParam discounts) The discounts applied to this line item.setDiscounts
(List<OrderUpdateParams.LineItem.Discount> discounts) The discounts applied to this line item.setId
(EmptyParam id) The ID of an existing line item on the order.The ID of an existing line item on the order.setPrice
(EmptyParam price) The ID of a Price to add to the Order.The ID of a Price to add to the Order.setPriceData
(OrderUpdateParams.LineItem.PriceData priceData) Data used to generate a new Price object inline.setProduct
(EmptyParam product) The ID of a Product to add to the Order.setProduct
(String product) The ID of a Product to add to the Order.setProductData
(OrderUpdateParams.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. -
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. SeeOrderUpdateParams.LineItem.discounts
for the field documentation. -
addAllDiscount
public OrderUpdateParams.LineItem.Builder addAllDiscount(List<OrderUpdateParams.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. SeeOrderUpdateParams.LineItem.discounts
for the field documentation. -
setDiscounts
The discounts applied to this line item. -
setDiscounts
public OrderUpdateParams.LineItem.Builder setDiscounts(List<OrderUpdateParams.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. SeeOrderUpdateParams.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. SeeOrderUpdateParams.LineItem.extraParams
for the field documentation. -
setId
The ID of an existing line item on the order. -
setId
The ID of an existing line item on the order. -
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. -
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 OrderUpdateParams.LineItem.Builder setPriceData(OrderUpdateParams.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. -
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 OrderUpdateParams.LineItem.Builder setProductData(OrderUpdateParams.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. SeeOrderUpdateParams.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. SeeOrderUpdateParams.LineItem.taxRates
for the field documentation. -
setTaxRates
The tax rates applied to this line item. -
setTaxRates
The tax rates applied to this line item.
-