Class PromotionCodeCreateParams.Builder

    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • setCode

        public PromotionCodeCreateParams.Builder setCode​(java.lang.String code)
        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.
      • setCustomer

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

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

        public PromotionCodeCreateParams.Builder setExpiresAt​(java.lang.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​(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 PromotionCodeCreateParams.extraParams for the field documentation.
      • putAllExtraParam

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

        public PromotionCodeCreateParams.Builder setMaxRedemptions​(java.lang.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​(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 PromotionCodeCreateParams.metadata for the field documentation.
      • putAllMetadata

        public PromotionCodeCreateParams.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 PromotionCodeCreateParams.metadata for the field documentation.