Class PromotionCodeCreateParams.Builder

java.lang.Object
com.stripe.param.PromotionCodeCreateParams.Builder
Enclosing class:
PromotionCodeCreateParams

public static class PromotionCodeCreateParams.Builder extends Object
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • build

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

      public PromotionCodeCreateParams.Builder setActive(Boolean active)
      Whether the promotion code is currently active.
    • setCode

      The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for a specific customer. If left blank, we will generate one automatically.
    • setCoupon

      public PromotionCodeCreateParams.Builder setCoupon(String coupon)
      Required. The coupon for this promotion code.
    • setCustomer

      public PromotionCodeCreateParams.Builder setCustomer(String customer)
      The customer that this promotion code can be used by. If not set, the promotion code can be used by all customers.
    • addExpand

      public PromotionCodeCreateParams.Builder addExpand(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 PromotionCodeCreateParams.expand for the field documentation.
    • addAllExpand

      public PromotionCodeCreateParams.Builder addAllExpand(List<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 PromotionCodeCreateParams.expand for the field documentation.
    • setExpiresAt

      public PromotionCodeCreateParams.Builder setExpiresAt(Long expiresAt)
      The timestamp at which this promotion code will expire. If the coupon has specified a redeems_by, then this value cannot be after the coupon's redeems_by.
    • putExtraParam

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

      public PromotionCodeCreateParams.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 PromotionCodeCreateParams.extraParams for the field documentation.
    • setMaxRedemptions

      public PromotionCodeCreateParams.Builder setMaxRedemptions(Long maxRedemptions)
      A positive integer specifying the number of times the promotion code can be redeemed. If the coupon has specified a max_redemptions, then this value cannot be greater than the coupon's max_redemptions.
    • putMetadata

      public PromotionCodeCreateParams.Builder putMetadata(String key, 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 PromotionCodeCreateParams.metadata for the field documentation.
    • putAllMetadata

      public PromotionCodeCreateParams.Builder putAllMetadata(Map<String,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 PromotionCodeCreateParams.metadata for the field documentation.
    • setRestrictions

      Settings that restrict the redemption of the promotion code.