public class InvoiceUpcomingParams extends ApiRequestParams
Modifier and Type | Class and Description |
---|---|
static class |
InvoiceUpcomingParams.Builder |
static class |
InvoiceUpcomingParams.Discount |
static class |
InvoiceUpcomingParams.InvoiceItem
Add all map key/value pairs to `extraParams` map.
|
static class |
InvoiceUpcomingParams.SubscriptionBillingCycleAnchor
The number of intervals between subscription billings.
|
static class |
InvoiceUpcomingParams.SubscriptionItem
Same as
unit_amount , but accepts a decimal value with at most 12 decimal places. |
static class |
InvoiceUpcomingParams.SubscriptionProrationBehavior |
static class |
InvoiceUpcomingParams.SubscriptionTrialEnd |
ApiRequestParams.EnumParam
EXTRA_PARAMS_KEY
Modifier and Type | Method and Description |
---|---|
static InvoiceUpcomingParams.Builder |
builder() |
java.lang.String |
getCoupon()
The code of the coupon to apply.
|
java.lang.String |
getCustomer()
The identifier of the customer whose upcoming invoice you'd like to retrieve.
|
java.lang.Object |
getDiscounts() |
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<InvoiceUpcomingParams.InvoiceItem> |
getInvoiceItems()
List of invoice items to add or update in the upcoming invoice preview.
|
java.lang.String |
getSchedule()
The identifier of the unstarted schedule whose upcoming invoice you'd like to retrieve.
|
java.lang.String |
getSubscription()
The identifier of the subscription for which you'd like to retrieve the upcoming invoice.
|
java.lang.Object |
getSubscriptionBillingCycleAnchor()
For new subscriptions, a future timestamp to anchor the subscription's billing cycle.
|
java.lang.Object |
getSubscriptionCancelAt()
Timestamp indicating when the subscription should be scheduled to cancel.
|
java.lang.Boolean |
getSubscriptionCancelAtPeriodEnd()
Boolean indicating whether this subscription should cancel at the end of the current period.
|
java.lang.Boolean |
getSubscriptionCancelNow()
This simulates the subscription being canceled or expired immediately.
|
java.lang.Object |
getSubscriptionDefaultTaxRates()
If provided, the invoice returned will preview updating or creating a subscription with these
default tax rates.
|
java.util.List<InvoiceUpcomingParams.SubscriptionItem> |
getSubscriptionItems()
A list of up to 20 subscription items, each with an attached price.
|
java.lang.Boolean |
getSubscriptionProrate()
This field has been renamed to
subscription_proration_behavior . |
InvoiceUpcomingParams.SubscriptionProrationBehavior |
getSubscriptionProrationBehavior()
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 |
getSubscriptionProrationDate()
If previewing an update to a subscription, and doing proration,
subscription_proration_date forces the proration to be calculated as though the update was
done at the specified time. |
java.lang.Long |
getSubscriptionStartDate()
Date a subscription is intended to start (can be future or past).
|
java.math.BigDecimal |
getSubscriptionTaxPercent()
If provided, the invoice returned will preview updating or creating a subscription with that
tax percent.
|
java.lang.Object |
getSubscriptionTrialEnd()
If provided, the invoice returned will preview updating or creating a subscription with that
trial end.
|
java.lang.Boolean |
getSubscriptionTrialFromPlan()
Indicates if a plan's
trial_period_days should be applied to the subscription. |
toMap
public static InvoiceUpcomingParams.Builder builder()
public java.lang.String getCoupon()
subscription
or subscription_items
is
provided, the invoice returned will preview updating or creating a subscription with that
coupon. Otherwise, it will preview applying that coupon to the customer for the next upcoming
invoice from among the customer's subscriptions. The invoice can be previewed without a coupon
by passing this value as an empty string.public java.lang.String getCustomer()
public java.lang.Object getDiscounts()
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<InvoiceUpcomingParams.InvoiceItem> getInvoiceItems()
public java.lang.String getSchedule()
public java.lang.String getSubscription()
subscription_items
is provided, you will preview creating a
subscription with those items. If neither subscription
nor subscription_items
is provided, you will retrieve the next upcoming invoice from among the customer's
subscriptions.public java.lang.Object getSubscriptionBillingCycleAnchor()
month
or year
intervals, the day of the month for subsequent invoices. For existing subscriptions, the value
can only be set to now
or unchanged
.public java.lang.Object getSubscriptionCancelAt()
proration_behavior
.public java.lang.Boolean getSubscriptionCancelAtPeriodEnd()
public java.lang.Boolean getSubscriptionCancelNow()
public java.lang.Object getSubscriptionDefaultTaxRates()
tax_rates
set.public java.util.List<InvoiceUpcomingParams.SubscriptionItem> getSubscriptionItems()
public java.lang.Boolean getSubscriptionProrate()
subscription_proration_behavior
. subscription_prorate=true
can be replaced with subscription_proration_behavior=create_prorations
and subscription_prorate=false
can
be replaced with subscription_proration_behavior=none
.public InvoiceUpcomingParams.SubscriptionProrationBehavior getSubscriptionProrationBehavior()
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 getSubscriptionProrationDate()
subscription_proration_date
forces the proration to be calculated as though the update was
done at the specified time. The time given must be within the current subscription period, and
cannot be before the subscription was on its current plan. If set, subscription
, and
one of subscription_items
, or subscription_trial_end
are required. Also, subscription_proration
cannot be set to false.public java.lang.Long getSubscriptionStartDate()
public java.math.BigDecimal getSubscriptionTaxPercent()
subscription_items
or subscription
is required.
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 java.lang.Object getSubscriptionTrialEnd()
subscription_items
or subscription
is required.public java.lang.Boolean getSubscriptionTrialFromPlan()
trial_period_days
should be applied to the subscription. Setting
subscription_trial_end
per subscription is preferred, and this defaults to false
. Setting this flag to true
together with subscription_trial_end
is not
allowed.