public class CouponCreateParams extends ApiRequestParams
Modifier and Type | Class and Description |
---|---|
static class |
CouponCreateParams.Builder |
static class |
CouponCreateParams.Duration |
ApiRequestParams.EnumParam
EXTRA_PARAMS_KEY
Modifier and Type | Method and Description |
---|---|
static CouponCreateParams.Builder |
builder() |
java.lang.Long |
getAmountOff()
A positive integer representing the amount to subtract from an invoice total (required if
percent_off is not passed). |
java.lang.String |
getCurrency()
Three-letter ISO code for the currency of the
amount_off parameter (required if amount_off is passed). |
CouponCreateParams.Duration |
getDuration()
Specifies how long the discount will be in effect.
|
java.lang.Long |
getDurationInMonths()
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. |
java.util.List<java.lang.String> |
getExpand()
Specifies which fields in the response should be expanded.
|
java.util.Map<java.lang.String,java.lang.Object> |
getExtraParams()
Map of extra parameters for custom features not available in this client library.
|
java.lang.String |
getId()
Unique string of your choice that will be used to identify this coupon when applying it to a
customer.
|
java.lang.Long |
getMaxRedemptions()
A positive integer specifying the number of times the coupon can be redeemed before it's no
longer valid.
|
java.lang.Object |
getMetadata()
Set of key-value pairs that you can attach to an object.
|
java.lang.String |
getName()
Name of the coupon displayed to customers on, for instance invoices, or receipts.
|
java.math.BigDecimal |
getPercentOff()
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). |
java.lang.Long |
getRedeemBy()
Unix timestamp specifying the last time at which the coupon can be redeemed.
|
toMap
public static CouponCreateParams.Builder builder()
public java.lang.Long getAmountOff()
percent_off
is not passed).public java.lang.String getCurrency()
amount_off
parameter (required if amount_off
is passed).public CouponCreateParams.Duration getDuration()
forever
, once
, or
repeating
.public java.lang.Long getDurationInMonths()
duration
is repeating
, in which case it must be a positive
integer that specifies the number of months the discount will be in effect.public java.util.List<java.lang.String> getExpand()
public java.util.Map<java.lang.String,java.lang.Object> getExtraParams()
@SerializedName
value. Instead, each
key/value pair is serialized as if the key is a root-level field (serialized) name in this
param object. Effectively, this map is flattened to its parent instance.public java.lang.String getId()
FALL25OFF
). 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.public java.lang.Long getMaxRedemptions()
public java.lang.Object getMetadata()
metadata
.public java.lang.String getName()
id
is shown if name
is not set.public java.math.BigDecimal getPercentOff()
amount_off
is not passed).public java.lang.Long getRedeemBy()