Class OrderCreateParams.LineItem.Builder

java.lang.Object
com.stripe.param.OrderCreateParams.LineItem.Builder
Enclosing class:
OrderCreateParams.LineItem

public static class OrderCreateParams.LineItem.Builder extends Object
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • build

      Finalize and obtain parameter instance from this builder.
    • setDescription

      public OrderCreateParams.LineItem.Builder setDescription(String description)
      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. See OrderCreateParams.LineItem.discounts for the field documentation.
    • addAllDiscount

      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. See OrderCreateParams.LineItem.discounts for the field documentation.
    • setDiscounts

      public OrderCreateParams.LineItem.Builder setDiscounts(EmptyParam discounts)
      The discounts applied to this line item.
    • setDiscounts

      The discounts applied to this line item.
    • putExtraParam

      public OrderCreateParams.LineItem.Builder putExtraParam(String key, 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. See OrderCreateParams.LineItem.extraParams for the field documentation.
    • putAllExtraParam

      public OrderCreateParams.LineItem.Builder putAllExtraParam(Map<String,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. See OrderCreateParams.LineItem.extraParams for the field documentation.
    • setPrice

      public OrderCreateParams.LineItem.Builder setPrice(String price)
      The ID of a Price to add to the Order.

      The price parameter is an alternative to using the product parameter. If each of your products are sold at a single price, you can set Product.default_price and then pass the product parameter when creating a line item. If your products are sold at several possible prices, use the price parameter to explicitly specify which one to use.

    • setPriceData

      Data used to generate a new Price object inline.

      The price_data parameter is an alternative to using the product or price parameters. If you create products upfront and configure a Product.default_price, pass the product parameter when creating a line item. If you prefer not to define products upfront, or if you charge variable prices, pass the price_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

      public OrderCreateParams.LineItem.Builder setProduct(String product)
      The ID of a Product to add to the Order.

      The product must have a default_price specified. Otherwise, specify the price by passing the price or price_data parameter.

    • setProductData

      Defines a Product inline and adds it to the Order.

      product_data is an alternative to the product parameter. If you created a Product upfront, use the product parameter to refer to the existing Product. But if you prefer not to create Products upfront, pass the product_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, then product_data re-uses it to avoid duplicates.

    • setQuantity

      public OrderCreateParams.LineItem.Builder setQuantity(Long quantity)
      The quantity of the line item.
    • addTaxRate

      public OrderCreateParams.LineItem.Builder addTaxRate(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. See OrderCreateParams.LineItem.taxRates for the field documentation.
    • addAllTaxRate

      public OrderCreateParams.LineItem.Builder addAllTaxRate(List<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. See OrderCreateParams.LineItem.taxRates for the field documentation.
    • setTaxRates

      public OrderCreateParams.LineItem.Builder setTaxRates(EmptyParam taxRates)
      The tax rates applied to this line item.
    • setTaxRates

      public OrderCreateParams.LineItem.Builder setTaxRates(List<String> taxRates)
      The tax rates applied to this line item.