Class CouponCreateParams.Builder

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

public static class CouponCreateParams.Builder extends Object
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • build

      public CouponCreateParams build()
      Finalize and obtain parameter instance from this builder.
    • setAmountOff

      public CouponCreateParams.Builder setAmountOff(Long amountOff)
      A positive integer representing the amount to subtract from an invoice total (required if percent_off is not passed).
    • setAppliesTo

      A hash containing directions for what this Coupon will apply discounts to.
    • setCurrency

      public CouponCreateParams.Builder setCurrency(String currency)
      Three-letter ISO code for the currency of the amount_off parameter (required if amount_off is passed).
    • putCurrencyOption

      Add a key/value pair to `currencyOptions` map. A map is initialized for the first `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. See CouponCreateParams.currencyOptions for the field documentation.
    • putAllCurrencyOption

      Add all map key/value pairs to `currencyOptions` map. A map is initialized for the first `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. See CouponCreateParams.currencyOptions for the field documentation.
    • setDuration

      Specifies how long the discount will be in effect if used on a subscription. Defaults to once.
    • setDurationInMonths

      public CouponCreateParams.Builder setDurationInMonths(Long durationInMonths)
      Required only if duration is repeating, in which case it must be a positive integer that specifies the number of months the discount will be in effect.
    • addExpand

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

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

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

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

      Unique string of your choice that will be used to identify this coupon when applying it to a customer. If you don't want to specify a particular code, you can leave the ID blank and we'll generate a random code for you.
    • setMaxRedemptions

      public CouponCreateParams.Builder setMaxRedemptions(Long maxRedemptions)
      A positive integer specifying the number of times the coupon can be redeemed before it's no longer valid. For example, you might have a 50% off coupon that the first 20 readers of your blog can use.
    • putMetadata

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

      public CouponCreateParams.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 CouponCreateParams.metadata for the field documentation.
    • setMetadata

      public CouponCreateParams.Builder setMetadata(EmptyParam metadata)
      Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.
    • setMetadata

      public CouponCreateParams.Builder setMetadata(Map<String,String> metadata)
      Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.
    • setName

      public CouponCreateParams.Builder setName(String name)
      Name of the coupon displayed to customers on, for instance invoices, or receipts. By default the id is shown if name is not set.
    • setPercentOff

      public CouponCreateParams.Builder setPercentOff(BigDecimal percentOff)
      A positive float larger than 0, and smaller or equal to 100, that represents the discount the coupon will apply (required if amount_off is not passed).
    • setRedeemBy

      public CouponCreateParams.Builder setRedeemBy(Long redeemBy)
      Unix timestamp specifying the last time at which the coupon can be redeemed. After the redeem_by date, the coupon can no longer be applied to new customers.