public class SubscriptionUpdateParams extends ApiRequestParams
Modifier and Type | Class and Description |
---|---|
static class |
SubscriptionUpdateParams.AddInvoiceItem |
static class |
SubscriptionUpdateParams.BillingCycleAnchor
Add all map key/value pairs to `extraParams` map.
|
static class |
SubscriptionUpdateParams.BillingThresholds
Same as
unit_amount , but accepts a decimal value with at most 12 decimal places. |
static class |
SubscriptionUpdateParams.Builder |
static class |
SubscriptionUpdateParams.CollectionMethod |
static class |
SubscriptionUpdateParams.Item
Indicates if the
billing_cycle_anchor should be reset when a threshold is reached. |
static class |
SubscriptionUpdateParams.PauseCollection
The number of intervals between subscription billings.
|
static class |
SubscriptionUpdateParams.PaymentBehavior |
static class |
SubscriptionUpdateParams.PendingInvoiceItemInterval |
static class |
SubscriptionUpdateParams.ProrationBehavior |
static class |
SubscriptionUpdateParams.TransferData |
static class |
SubscriptionUpdateParams.TrialEnd |
ApiRequestParams.EnumParam
EXTRA_PARAMS_KEY
Modifier and Type | Method and Description |
---|---|
static SubscriptionUpdateParams.Builder |
builder() |
java.util.List<SubscriptionUpdateParams.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.
|
SubscriptionUpdateParams.BillingCycleAnchor |
getBillingCycleAnchor()
Either
now or unchanged . |
java.lang.Object |
getBillingThresholds()
Define thresholds at which an invoice will be sent, and the subscription advanced to a new
billing period.
|
java.lang.Object |
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.
|
SubscriptionUpdateParams.CollectionMethod |
getCollectionMethod()
Either
charge_automatically , or send_invoice . |
java.lang.Object |
getCoupon()
The code of the coupon to apply to this subscription.
|
java.lang.Long |
getDaysUntilDue()
Number of days a customer has to pay invoices generated by this subscription.
|
java.lang.Object |
getDefaultPaymentMethod()
ID of the default payment method for the subscription.
|
java.lang.Object |
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<SubscriptionUpdateParams.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.
|
java.lang.Object |
getPauseCollection()
If specified, payment collection for this subscription will be paused.
|
SubscriptionUpdateParams.PaymentBehavior |
getPaymentBehavior()
Use
allow_incomplete to transition the subscription to status=past_due if a
payment is required but cannot be paid. |
java.lang.Object |
getPendingInvoiceItemInterval()
Specifies an interval for how often to bill for any pending invoice items.
|
java.lang.Object |
getPromotionCode()
The promotion code to apply to this subscription.
|
SubscriptionUpdateParams.ProrationBehavior |
getProrationBehavior()
Determines how to handle prorations when the
billing cycle changes (e.g., when switching plans, resetting
billing_cycle_anchor=now ,
or starting a trial), or if an item's quantity changes. |
java.lang.Long |
getProrationDate()
If set, the proration will be calculated as though the subscription was updated at the given
time.
|
java.lang.Object |
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. |
toMap
public static SubscriptionUpdateParams.Builder builder()
public java.util.List<SubscriptionUpdateParams.AddInvoiceItem> getAddInvoiceItems()
public java.math.BigDecimal getApplicationFeePercent()
public SubscriptionUpdateParams.BillingCycleAnchor getBillingCycleAnchor()
now
or unchanged
. Setting the value to now
resets the
subscription's billing cycle anchor to the current time. For more information, see the billing
cycle documentation.public java.lang.Object getBillingThresholds()
public java.lang.Object getCancelAt()
proration_behavior
. If set during a future period, this will always cause a proration for that
period.public java.lang.Boolean getCancelAtPeriodEnd()
public SubscriptionUpdateParams.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.Object getCoupon()
public java.lang.Long getDaysUntilDue()
collection_method
is set to send_invoice
.public java.lang.Object getDefaultPaymentMethod()
public java.lang.Object getDefaultSource()
public java.lang.Object getDefaultTaxRates()
tax_rates
set. Invoices created will have their default_tax_rates
populated from the
subscription. Pass an empty string to remove previously-defined tax rates.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<SubscriptionUpdateParams.Item> getItems()
public java.lang.Object getMetadata()
metadata
.public java.lang.Boolean getOffSession()
public java.lang.Object getPauseCollection()
public SubscriptionUpdateParams.PaymentBehavior getPaymentBehavior()
allow_incomplete
to transition the subscription to status=past_due
if a
payment is required but cannot be paid. This 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 pending_if_incomplete
to update the subscription using pending updates. When
you use pending_if_incomplete
you can only pass the parameters supported
by pending updates.
Use error_if_incomplete
if you want Stripe to return an HTTP 402 status code if a
subscription's 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
update the 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.
public java.lang.Object getPendingInvoiceItemInterval()
public java.lang.Object getPromotionCode()
public SubscriptionUpdateParams.ProrationBehavior getProrationBehavior()
billing_cycle_anchor=now
,
or starting a trial), or if an item's quantity
changes. Valid values are create_prorations
, none
, or always_invoice
.
Passing create_prorations
will cause proration invoice items to be created when
applicable. These proration items will only be invoiced immediately under certain
conditions. In order to always invoice immediately for prorations, pass always_invoice
.
Prorations can be disabled by passing none
.
public java.lang.Long getProrationDate()
public java.lang.Object 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.