public static class InvoiceUpcomingParams.Builder
extends java.lang.Object
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
InvoiceUpcomingParams.Builder |
addAllExpand(java.util.List<java.lang.String> elements)
Add all elements to `expand` list.
|
InvoiceUpcomingParams.Builder |
addAllInvoiceItem(java.util.List<InvoiceUpcomingParams.InvoiceItem> elements)
Add all elements to `invoiceItems` list.
|
InvoiceUpcomingParams.Builder |
addAllSubscriptionDefaultTaxRate(java.util.List<java.lang.String> elements)
Add all elements to `subscriptionDefaultTaxRates` list.
|
InvoiceUpcomingParams.Builder |
addAllSubscriptionItem(java.util.List<InvoiceUpcomingParams.SubscriptionItem> elements)
Add all elements to `subscriptionItems` list.
|
InvoiceUpcomingParams.Builder |
addExpand(java.lang.String element)
Add an element to `expand` list.
|
InvoiceUpcomingParams.Builder |
addInvoiceItem(InvoiceUpcomingParams.InvoiceItem element)
Add an element to `invoiceItems` list.
|
InvoiceUpcomingParams.Builder |
addSubscriptionDefaultTaxRate(java.lang.String element)
Add an element to `subscriptionDefaultTaxRates` list.
|
InvoiceUpcomingParams.Builder |
addSubscriptionItem(InvoiceUpcomingParams.SubscriptionItem element)
Add an element to `subscriptionItems` list.
|
InvoiceUpcomingParams |
build()
Finalize and obtain parameter instance from this builder.
|
InvoiceUpcomingParams.Builder |
putAllExtraParam(java.util.Map<java.lang.String,java.lang.Object> map)
Add all map key/value pairs to `extraParams` map.
|
InvoiceUpcomingParams.Builder |
putExtraParam(java.lang.String key,
java.lang.Object value)
Add a key/value pair to `extraParams` map.
|
InvoiceUpcomingParams.Builder |
setCoupon(java.lang.String coupon)
The code of the coupon to apply.
|
InvoiceUpcomingParams.Builder |
setCustomer(java.lang.String customer)
The identifier of the customer whose upcoming invoice you'd like to retrieve.
|
InvoiceUpcomingParams.Builder |
setSchedule(java.lang.String schedule)
The identifier of the unstarted schedule whose upcoming invoice you'd like to retrieve.
|
InvoiceUpcomingParams.Builder |
setSubscription(java.lang.String subscription)
The identifier of the subscription for which you'd like to retrieve the upcoming invoice.
|
InvoiceUpcomingParams.Builder |
setSubscriptionBillingCycleAnchor(InvoiceUpcomingParams.SubscriptionBillingCycleAnchor subscriptionBillingCycleAnchor)
For new subscriptions, a future timestamp to anchor the subscription's billing cycle.
|
InvoiceUpcomingParams.Builder |
setSubscriptionBillingCycleAnchor(java.lang.Long subscriptionBillingCycleAnchor)
For new subscriptions, a future timestamp to anchor the subscription's billing cycle.
|
InvoiceUpcomingParams.Builder |
setSubscriptionCancelAt(EmptyParam subscriptionCancelAt)
Timestamp indicating when the subscription should be scheduled to cancel.
|
InvoiceUpcomingParams.Builder |
setSubscriptionCancelAt(java.lang.Long subscriptionCancelAt)
Timestamp indicating when the subscription should be scheduled to cancel.
|
InvoiceUpcomingParams.Builder |
setSubscriptionCancelAtPeriodEnd(java.lang.Boolean subscriptionCancelAtPeriodEnd)
Boolean indicating whether this subscription should cancel at the end of the current period.
|
InvoiceUpcomingParams.Builder |
setSubscriptionCancelNow(java.lang.Boolean subscriptionCancelNow)
This simulates the subscription being canceled or expired immediately.
|
InvoiceUpcomingParams.Builder |
setSubscriptionDefaultTaxRates(EmptyParam subscriptionDefaultTaxRates)
If provided, the invoice returned will preview updating or creating a subscription with these
default tax rates.
|
InvoiceUpcomingParams.Builder |
setSubscriptionDefaultTaxRates(java.util.List<java.lang.String> subscriptionDefaultTaxRates)
If provided, the invoice returned will preview updating or creating a subscription with these
default tax rates.
|
InvoiceUpcomingParams.Builder |
setSubscriptionProrate(java.lang.Boolean subscriptionProrate)
If previewing an update to a subscription, this decides whether the preview will show the
result of applying prorations or not.
|
InvoiceUpcomingParams.Builder |
setSubscriptionProrationBehavior(InvoiceUpcomingParams.SubscriptionProrationBehavior subscriptionProrationBehavior)
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. |
InvoiceUpcomingParams.Builder |
setSubscriptionProrationDate(java.lang.Long subscriptionProrationDate)
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. |
InvoiceUpcomingParams.Builder |
setSubscriptionStartDate(java.lang.Long subscriptionStartDate)
Date a subscription is intended to start (can be future or past).
|
InvoiceUpcomingParams.Builder |
setSubscriptionTaxPercent(java.math.BigDecimal subscriptionTaxPercent)
If provided, the invoice returned will preview updating or creating a subscription with that
tax percent.
|
InvoiceUpcomingParams.Builder |
setSubscriptionTrialEnd(InvoiceUpcomingParams.SubscriptionTrialEnd subscriptionTrialEnd)
If provided, the invoice returned will preview updating or creating a subscription with that
trial end.
|
InvoiceUpcomingParams.Builder |
setSubscriptionTrialEnd(java.lang.Long subscriptionTrialEnd)
If provided, the invoice returned will preview updating or creating a subscription with that
trial end.
|
InvoiceUpcomingParams.Builder |
setSubscriptionTrialFromPlan(java.lang.Boolean subscriptionTrialFromPlan)
Indicates if a plan's
trial_period_days should be applied to the subscription. |
public InvoiceUpcomingParams build()
public InvoiceUpcomingParams.Builder setCoupon(java.lang.String coupon)
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 InvoiceUpcomingParams.Builder setCustomer(java.lang.String customer)
public InvoiceUpcomingParams.Builder addExpand(java.lang.String element)
InvoiceUpcomingParams.expand
for the field documentation.public InvoiceUpcomingParams.Builder addAllExpand(java.util.List<java.lang.String> elements)
InvoiceUpcomingParams.expand
for the field documentation.public InvoiceUpcomingParams.Builder putExtraParam(java.lang.String key, java.lang.Object value)
InvoiceUpcomingParams.extraParams
for the field documentation.public InvoiceUpcomingParams.Builder putAllExtraParam(java.util.Map<java.lang.String,java.lang.Object> map)
InvoiceUpcomingParams.extraParams
for the field documentation.public InvoiceUpcomingParams.Builder addInvoiceItem(InvoiceUpcomingParams.InvoiceItem element)
InvoiceUpcomingParams.invoiceItems
for the field documentation.public InvoiceUpcomingParams.Builder addAllInvoiceItem(java.util.List<InvoiceUpcomingParams.InvoiceItem> elements)
InvoiceUpcomingParams.invoiceItems
for the field documentation.public InvoiceUpcomingParams.Builder setSchedule(java.lang.String schedule)
public InvoiceUpcomingParams.Builder setSubscription(java.lang.String subscription)
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 InvoiceUpcomingParams.Builder setSubscriptionBillingCycleAnchor(InvoiceUpcomingParams.SubscriptionBillingCycleAnchor subscriptionBillingCycleAnchor)
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 InvoiceUpcomingParams.Builder setSubscriptionBillingCycleAnchor(java.lang.Long subscriptionBillingCycleAnchor)
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 InvoiceUpcomingParams.Builder setSubscriptionCancelAt(java.lang.Long subscriptionCancelAt)
proration_behavior
.`public InvoiceUpcomingParams.Builder setSubscriptionCancelAt(EmptyParam subscriptionCancelAt)
proration_behavior
.`public InvoiceUpcomingParams.Builder setSubscriptionCancelAtPeriodEnd(java.lang.Boolean subscriptionCancelAtPeriodEnd)
public InvoiceUpcomingParams.Builder setSubscriptionCancelNow(java.lang.Boolean subscriptionCancelNow)
public InvoiceUpcomingParams.Builder addSubscriptionDefaultTaxRate(java.lang.String element)
InvoiceUpcomingParams.subscriptionDefaultTaxRates
for the field documentation.public InvoiceUpcomingParams.Builder addAllSubscriptionDefaultTaxRate(java.util.List<java.lang.String> elements)
InvoiceUpcomingParams.subscriptionDefaultTaxRates
for the field documentation.public InvoiceUpcomingParams.Builder setSubscriptionDefaultTaxRates(EmptyParam subscriptionDefaultTaxRates)
tax_rates
set.public InvoiceUpcomingParams.Builder setSubscriptionDefaultTaxRates(java.util.List<java.lang.String> subscriptionDefaultTaxRates)
tax_rates
set.public InvoiceUpcomingParams.Builder addSubscriptionItem(InvoiceUpcomingParams.SubscriptionItem element)
InvoiceUpcomingParams.subscriptionItems
for the field documentation.public InvoiceUpcomingParams.Builder addAllSubscriptionItem(java.util.List<InvoiceUpcomingParams.SubscriptionItem> elements)
InvoiceUpcomingParams.subscriptionItems
for the field documentation.public InvoiceUpcomingParams.Builder setSubscriptionProrate(java.lang.Boolean subscriptionProrate)
subscription_items
or subscription
, and one of subscription_items
or subscription_trial_end
are
required.public InvoiceUpcomingParams.Builder setSubscriptionProrationBehavior(InvoiceUpcomingParams.SubscriptionProrationBehavior subscriptionProrationBehavior)
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 InvoiceUpcomingParams.Builder setSubscriptionProrationDate(java.lang.Long subscriptionProrationDate)
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 InvoiceUpcomingParams.Builder setSubscriptionStartDate(java.lang.Long subscriptionStartDate)
public InvoiceUpcomingParams.Builder setSubscriptionTaxPercent(java.math.BigDecimal subscriptionTaxPercent)
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 InvoiceUpcomingParams.Builder setSubscriptionTrialEnd(InvoiceUpcomingParams.SubscriptionTrialEnd subscriptionTrialEnd)
subscription_items
or subscription
is required.public InvoiceUpcomingParams.Builder setSubscriptionTrialEnd(java.lang.Long subscriptionTrialEnd)
subscription_items
or subscription
is required.public InvoiceUpcomingParams.Builder setSubscriptionTrialFromPlan(java.lang.Boolean subscriptionTrialFromPlan)
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.