Class PriceCreateParams.Builder

  • Enclosing class:
    PriceCreateParams

    public static class PriceCreateParams.Builder
    extends java.lang.Object
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • build

        public PriceCreateParams build()
        Finalize and obtain parameter instance from this builder.
      • setActive

        public PriceCreateParams.Builder setActive​(java.lang.Boolean active)
        Whether the price can be used for new purchases. Defaults to true.
      • setBillingScheme

        public PriceCreateParams.Builder setBillingScheme​(PriceCreateParams.BillingScheme billingScheme)
        Describes how to compute the price per period. Either per_unit or tiered. per_unit indicates that the fixed amount (specified in unit_amount or unit_amount_decimal) will be charged per unit in quantity (for prices with usage_type=licensed), or per unit of total usage (for prices with usage_type=metered). tiered indicates that the unit pricing will be computed using a tiering strategy as defined using the tiers and tiers_mode attributes.
      • addExpand

        public PriceCreateParams.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. See PriceCreateParams.expand for the field documentation.
      • addAllExpand

        public PriceCreateParams.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. See PriceCreateParams.expand for the field documentation.
      • putExtraParam

        public PriceCreateParams.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. See PriceCreateParams.extraParams for the field documentation.
      • putAllExtraParam

        public PriceCreateParams.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. See PriceCreateParams.extraParams for the field documentation.
      • setLookupKey

        public PriceCreateParams.Builder setLookupKey​(java.lang.String lookupKey)
        A lookup key used to retrieve prices dynamically from a static string.
      • putMetadata

        public PriceCreateParams.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. See PriceCreateParams.metadata for the field documentation.
      • putAllMetadata

        public PriceCreateParams.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. See PriceCreateParams.metadata for the field documentation.
      • setNickname

        public PriceCreateParams.Builder setNickname​(java.lang.String nickname)
        A brief description of the price, hidden from customers.
      • setProduct

        public PriceCreateParams.Builder setProduct​(java.lang.String product)
        The ID of the product that this price will belong to.
      • setTaxBehavior

        public PriceCreateParams.Builder setTaxBehavior​(PriceCreateParams.TaxBehavior taxBehavior)
        Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of inclusive, exclusive, or unspecified. Once specified as either inclusive or exclusive, it cannot be changed.
      • setTiersMode

        public PriceCreateParams.Builder setTiersMode​(PriceCreateParams.TiersMode tiersMode)
        Defines if the tiering price should be graduated or volume based. In volume-based tiering, the maximum quantity within a period determines the per unit price, in graduated tiering pricing can successively change as the quantity grows.
      • setTransferLookupKey

        public PriceCreateParams.Builder setTransferLookupKey​(java.lang.Boolean transferLookupKey)
        If set to true, will atomically remove the lookup key from the existing price, and assign it to this price.
      • setUnitAmount

        public PriceCreateParams.Builder setUnitAmount​(java.lang.Long unitAmount)
        A positive integer in %s (or 0 for a free price) representing how much to charge.
      • setUnitAmountDecimal

        public PriceCreateParams.Builder setUnitAmountDecimal​(java.math.BigDecimal unitAmountDecimal)
        Same as unit_amount, but accepts a decimal value in %s with at most 12 decimal places. Only one of unit_amount and unit_amount_decimal can be set.