public class SubscriptionCreateParams extends ApiRequestParams
Modifier and Type | Class and Description |
---|---|
static class |
SubscriptionCreateParams.AddInvoiceItem |
static class |
SubscriptionCreateParams.BillingThresholds
Same as
unit_amount , but accepts a decimal value with at most 12 decimal places. |
static class |
SubscriptionCreateParams.Builder |
static class |
SubscriptionCreateParams.CollectionMethod
Add all map key/value pairs to `extraParams` map.
|
static class |
SubscriptionCreateParams.Item
Indicates if the
billing_cycle_anchor should be reset when a threshold is reached. |
static class |
SubscriptionCreateParams.PaymentBehavior |
static class |
SubscriptionCreateParams.PendingInvoiceItemInterval
The number of intervals between subscription billings.
|
static class |
SubscriptionCreateParams.ProrationBehavior |
static class |
SubscriptionCreateParams.TransferData |
static class |
SubscriptionCreateParams.TrialEnd |
ApiRequestParams.EnumParam
EXTRA_PARAMS_KEY
Modifier and Type | Method and Description |
---|---|
static SubscriptionCreateParams.Builder |
builder() |
java.util.List<SubscriptionCreateParams.AddInvoiceItem> |
getAddInvoiceItems()
A list of prices and quantities that will generate invoice items appended to the first invoice
for this subscription.
|
java.math.BigDecimal |
getApplicationFeePercent()
A non-negative decimal between 0 and 100, with at most two decimal places.
|
java.lang.Long |
getBackdateStartDate()
For new subscriptions, a past timestamp to backdate the subscription's start date to.
|
java.lang.Long |
getBillingCycleAnchor()
A future timestamp to anchor the subscription's billing cycle.
|
java.lang.Object |
getBillingThresholds()
Define thresholds at which an invoice will be sent, and the subscription advanced to a new
billing period.
|
java.lang.Long |
getCancelAt()
A timestamp at which the subscription should cancel.
|
java.lang.Boolean |
getCancelAtPeriodEnd()
Boolean indicating whether this subscription should cancel at the end of the current period.
|
SubscriptionCreateParams.CollectionMethod |
getCollectionMethod()
Either
charge_automatically , or send_invoice . |
java.lang.String |
getCoupon()
The code of the coupon to apply to this subscription.
|
java.lang.String |
getCustomer()
The identifier of the customer to subscribe.
|
java.lang.Long |
getDaysUntilDue()
Number of days a customer has to pay invoices generated by this subscription.
|
java.lang.String |
getDefaultPaymentMethod()
ID of the default payment method for the subscription.
|
java.lang.String |
getDefaultSource()
ID of the default payment source for the subscription.
|
java.lang.Object |
getDefaultTaxRates()
The tax rates that will apply to any subscription item that does not have
tax_rates
set. |
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.util.List<SubscriptionCreateParams.Item> |
getItems()
A list of up to 20 subscription items, each with an attached price.
|
java.lang.Object |
getMetadata()
Set of key-value pairs that you can attach
to an object.
|
java.lang.Boolean |
getOffSession()
Indicates if a customer is on or off-session while an invoice payment is attempted.
|
SubscriptionCreateParams.PaymentBehavior |
getPaymentBehavior()
Use
allow_incomplete to create subscriptions with status=incomplete if the
first invoice cannot be paid. |
java.lang.Object |
getPendingInvoiceItemInterval()
Specifies an interval for how often to bill for any pending invoice items.
|
java.lang.String |
getPromotionCode()
The API ID of a promotion code to apply to this subscription.
|
java.lang.Boolean |
getProrate()
This field has been renamed to
proration_behavior . |
SubscriptionCreateParams.ProrationBehavior |
getProrationBehavior()
Determines how to handle prorations resulting
from the
billing_cycle_anchor . |
java.lang.Object |
getTaxPercent()
A non-negative decimal (with at most four decimal places) between 0 and 100.
|
SubscriptionCreateParams.TransferData |
getTransferData()
If specified, the funds from the subscription's invoices will be transferred to the destination
and the ID of the resulting transfers will be found on the resulting charges.
|
java.lang.Object |
getTrialEnd()
Unix timestamp representing the end of the trial period the customer will get before being
charged for the first time.
|
java.lang.Boolean |
getTrialFromPlan()
Indicates if a plan's
trial_period_days should be applied to the subscription. |
java.lang.Long |
getTrialPeriodDays()
Integer representing the number of trial period days before the customer is charged for the
first time.
|
toMap
public static SubscriptionCreateParams.Builder builder()
public java.util.List<SubscriptionCreateParams.AddInvoiceItem> getAddInvoiceItems()
public java.math.BigDecimal getApplicationFeePercent()
public java.lang.Long getBackdateStartDate()
public java.lang.Long getBillingCycleAnchor()
month
or year
intervals, the day of the month for subsequent invoices.public java.lang.Object getBillingThresholds()
public java.lang.Long getCancelAt()
proration_behavior
. If set during a future period, this will always cause a proration for that
period.public java.lang.Boolean getCancelAtPeriodEnd()
public SubscriptionCreateParams.CollectionMethod getCollectionMethod()
charge_automatically
, or send_invoice
. When charging automatically,
Stripe will attempt to pay this subscription at the end of the cycle using the default source
attached to the customer. When sending an invoice, Stripe will email your customer an invoice
with payment instructions. Defaults to charge_automatically
.public java.lang.String getCoupon()
public java.lang.String getCustomer()
public java.lang.Long getDaysUntilDue()
collection_method
is set to send_invoice
.public java.lang.String getDefaultPaymentMethod()
public java.lang.String getDefaultSource()
public java.lang.Object getDefaultTaxRates()
tax_rates
set. Invoices created will have their default_tax_rates
populated from the
subscription.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.util.List<SubscriptionCreateParams.Item> getItems()
public java.lang.Object getMetadata()
metadata
.public java.lang.Boolean getOffSession()
public SubscriptionCreateParams.PaymentBehavior getPaymentBehavior()
allow_incomplete
to create subscriptions with status=incomplete
if the
first invoice cannot be paid. Creating subscriptions with this status allows you to manage
scenarios where additional user actions are needed to pay a subscription's invoice. For
example, SCA regulation may require 3DS authentication to complete payment. See the SCA Migration
Guide for Billing to learn more. This is the default behavior.
Use error_if_incomplete
if you want Stripe to return an HTTP 402 status code if a
subscription's first invoice cannot be paid. For example, if a payment method requires 3DS
authentication due to SCA regulation and further user action is needed, this parameter does not
create a subscription and returns an error instead. This was the default behavior for API
versions prior to 2019-03-14. See the changelog to learn more.
pending_if_incomplete
is only used with updates and cannot be passed when creating a
subscription.
public java.lang.Object getPendingInvoiceItemInterval()
public java.lang.String getPromotionCode()
public java.lang.Boolean getProrate()
proration_behavior
. prorate=true
can be replaced
with proration_behavior=create_prorations
and prorate=false
can be replaced
with proration_behavior=none
.public SubscriptionCreateParams.ProrationBehavior getProrationBehavior()
billing_cycle_anchor
. Valid values are create_prorations
or none
.
Passing create_prorations
will cause proration invoice items to be created when
applicable. Prorations can be disabled by passing none
. If no value is passed, the
default is create_prorations
.
public java.lang.Object getTaxPercent()
tax_percent
of 20.0
will charge $12 per invoice. To unset a previously-set
value, pass an empty string. This field has been deprecated and will be removed in a future API
version, for further information view the migration docs for tax_rates
.public SubscriptionCreateParams.TransferData getTransferData()
public java.lang.Object getTrialEnd()
now
can be provided to end the
customer's trial immediately. Can be at most two years from billing_cycle_anchor
.public java.lang.Boolean getTrialFromPlan()
trial_period_days
should be applied to the subscription. Setting
trial_end
per subscription is preferred, and this defaults to false
. Setting
this flag to true
together with trial_end
is not allowed.public java.lang.Long getTrialPeriodDays()