Class OrderCreateParams.LineItem.Builder
- Enclosing class:
- OrderCreateParams.LineItem
-
Constructor Summary
Constructors -
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.discountsfor 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.discountsfor 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.extraParamsfor 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.extraParamsfor the field documentation. -
setPrice
The ID of a Price to add to the Order.The
priceparameter is an alternative to using theproductparameter. If each of your products are sold at a single price, you can setProduct.default_priceand then pass theproductparameter when creating a line item. If your products are sold at several possible prices, use thepriceparameter 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_dataparameter is an alternative to using theproductorpriceparameters. If you create a Product upfront and configure aProduct.default_price, pass theproductparameter when creating a line item. If you prefer not to define Products upfront, or if you charge variable prices, pass theprice_dataparameter to describe the price for this line item.Each time you pass
price_datawe 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_pricespecified. Otherwise, specify the price by passing thepriceorprice_dataparameter. -
setProductData
public OrderCreateParams.LineItem.Builder setProductData(OrderCreateParams.LineItem.ProductData productData) Defines a Product inline and adds it to the Order.product_datais an alternative to theproductparameter. If you created a Product upfront, use theproductparameter to refer to the existing Product. But if you prefer not to create Products upfront, pass theproduct_dataparameter to define a Product inline as part of configuring the Order.product_dataautomatically creates a Product, just as if you had manually created the Product. If a Product with the same ID already exists, thenproduct_datare-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.taxRatesfor 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.taxRatesfor the field documentation. -
setTaxRates
The tax rates applied to this line item. -
setTaxRates
The tax rates applied to this line item.
-