Package com.stripe.param
Class InvoiceUpcomingParams.Builder
- java.lang.Object
-
- com.stripe.param.InvoiceUpcomingParams.Builder
-
- Enclosing class:
- InvoiceUpcomingParams
public static class InvoiceUpcomingParams.Builder extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InvoiceUpcomingParams.BuilderaddAllDiscount(java.util.List<InvoiceUpcomingParams.Discount> elements)Add all elements to `discounts` list.InvoiceUpcomingParams.BuilderaddAllExpand(java.util.List<java.lang.String> elements)Add all elements to `expand` list.InvoiceUpcomingParams.BuilderaddAllInvoiceItem(java.util.List<InvoiceUpcomingParams.InvoiceItem> elements)Add all elements to `invoiceItems` list.InvoiceUpcomingParams.BuilderaddAllSubscriptionDefaultTaxRate(java.util.List<java.lang.String> elements)Add all elements to `subscriptionDefaultTaxRates` list.InvoiceUpcomingParams.BuilderaddAllSubscriptionItem(java.util.List<InvoiceUpcomingParams.SubscriptionItem> elements)Add all elements to `subscriptionItems` list.InvoiceUpcomingParams.BuilderaddDiscount(InvoiceUpcomingParams.Discount element)Add an element to `discounts` list.InvoiceUpcomingParams.BuilderaddExpand(java.lang.String element)Add an element to `expand` list.InvoiceUpcomingParams.BuilderaddInvoiceItem(InvoiceUpcomingParams.InvoiceItem element)Add an element to `invoiceItems` list.InvoiceUpcomingParams.BuilderaddSubscriptionDefaultTaxRate(java.lang.String element)Add an element to `subscriptionDefaultTaxRates` list.InvoiceUpcomingParams.BuilderaddSubscriptionItem(InvoiceUpcomingParams.SubscriptionItem element)Add an element to `subscriptionItems` list.InvoiceUpcomingParamsbuild()Finalize and obtain parameter instance from this builder.InvoiceUpcomingParams.BuilderputAllExtraParam(java.util.Map<java.lang.String,java.lang.Object> map)Add all map key/value pairs to `extraParams` map.InvoiceUpcomingParams.BuilderputExtraParam(java.lang.String key, java.lang.Object value)Add a key/value pair to `extraParams` map.InvoiceUpcomingParams.BuildersetAutomaticTax(InvoiceUpcomingParams.AutomaticTax automaticTax)Settings for automatic tax lookup for this invoice preview.InvoiceUpcomingParams.BuildersetCoupon(java.lang.String coupon)The code of the coupon to apply.InvoiceUpcomingParams.BuildersetCustomer(java.lang.String customer)The identifier of the customer whose upcoming invoice you'd like to retrieve.InvoiceUpcomingParams.BuildersetCustomerDetails(InvoiceUpcomingParams.CustomerDetails customerDetails)Details about the customer you want to invoice.InvoiceUpcomingParams.BuildersetDiscounts(EmptyParam discounts)The coupons to redeem into discounts for the invoice preview.InvoiceUpcomingParams.BuildersetDiscounts(java.util.List<InvoiceUpcomingParams.Discount> discounts)The coupons to redeem into discounts for the invoice preview.InvoiceUpcomingParams.BuildersetSchedule(java.lang.String schedule)The identifier of the unstarted schedule whose upcoming invoice you'd like to retrieve.InvoiceUpcomingParams.BuildersetSubscription(java.lang.String subscription)The identifier of the subscription for which you'd like to retrieve the upcoming invoice.InvoiceUpcomingParams.BuildersetSubscriptionBillingCycleAnchor(InvoiceUpcomingParams.SubscriptionBillingCycleAnchor subscriptionBillingCycleAnchor)For new subscriptions, a future timestamp to anchor the subscription's billing cycle.InvoiceUpcomingParams.BuildersetSubscriptionBillingCycleAnchor(java.lang.Long subscriptionBillingCycleAnchor)For new subscriptions, a future timestamp to anchor the subscription's billing cycle.InvoiceUpcomingParams.BuildersetSubscriptionCancelAt(EmptyParam subscriptionCancelAt)Timestamp indicating when the subscription should be scheduled to cancel.InvoiceUpcomingParams.BuildersetSubscriptionCancelAt(java.lang.Long subscriptionCancelAt)Timestamp indicating when the subscription should be scheduled to cancel.InvoiceUpcomingParams.BuildersetSubscriptionCancelAtPeriodEnd(java.lang.Boolean subscriptionCancelAtPeriodEnd)Boolean indicating whether this subscription should cancel at the end of the current period.InvoiceUpcomingParams.BuildersetSubscriptionCancelNow(java.lang.Boolean subscriptionCancelNow)This simulates the subscription being canceled or expired immediately.InvoiceUpcomingParams.BuildersetSubscriptionDefaultTaxRates(EmptyParam subscriptionDefaultTaxRates)If provided, the invoice returned will preview updating or creating a subscription with these default tax rates.InvoiceUpcomingParams.BuildersetSubscriptionDefaultTaxRates(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.BuildersetSubscriptionProrationBehavior(InvoiceUpcomingParams.SubscriptionProrationBehavior subscriptionProrationBehavior)Determines how to handle prorations when the billing cycle changes (e.g., when switching plans, resettingbilling_cycle_anchor=now, or starting a trial), or if an item'squantitychanges.InvoiceUpcomingParams.BuildersetSubscriptionProrationDate(java.lang.Long subscriptionProrationDate)If previewing an update to a subscription, and doing proration,subscription_proration_dateforces the proration to be calculated as though the update was done at the specified time.InvoiceUpcomingParams.BuildersetSubscriptionStartDate(java.lang.Long subscriptionStartDate)Date a subscription is intended to start (can be future or past).InvoiceUpcomingParams.BuildersetSubscriptionTrialEnd(InvoiceUpcomingParams.SubscriptionTrialEnd subscriptionTrialEnd)If provided, the invoice returned will preview updating or creating a subscription with that trial end.InvoiceUpcomingParams.BuildersetSubscriptionTrialEnd(java.lang.Long subscriptionTrialEnd)If provided, the invoice returned will preview updating or creating a subscription with that trial end.InvoiceUpcomingParams.BuildersetSubscriptionTrialFromPlan(java.lang.Boolean subscriptionTrialFromPlan)Indicates if a plan'strial_period_daysshould be applied to the subscription.
-
-
-
Method Detail
-
build
public InvoiceUpcomingParams build()
Finalize and obtain parameter instance from this builder.
-
setAutomaticTax
public InvoiceUpcomingParams.Builder setAutomaticTax(InvoiceUpcomingParams.AutomaticTax automaticTax)
Settings for automatic tax lookup for this invoice preview.
-
setCoupon
public InvoiceUpcomingParams.Builder setCoupon(java.lang.String coupon)
The code of the coupon to apply. Ifsubscriptionorsubscription_itemsis 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.
-
setCustomer
public InvoiceUpcomingParams.Builder setCustomer(java.lang.String customer)
The identifier of the customer whose upcoming invoice you'd like to retrieve.
-
setCustomerDetails
public InvoiceUpcomingParams.Builder setCustomerDetails(InvoiceUpcomingParams.CustomerDetails customerDetails)
Details about the customer you want to invoice.
-
addDiscount
public InvoiceUpcomingParams.Builder addDiscount(InvoiceUpcomingParams.Discount element)
Add an element to `discounts` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeeInvoiceUpcomingParams.discountsfor the field documentation.
-
addAllDiscount
public InvoiceUpcomingParams.Builder addAllDiscount(java.util.List<InvoiceUpcomingParams.Discount> elements)
Add all elements to `discounts` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeeInvoiceUpcomingParams.discountsfor the field documentation.
-
setDiscounts
public InvoiceUpcomingParams.Builder setDiscounts(EmptyParam discounts)
The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the customer or subscription. Pass an empty string to avoid inheriting any discounts. To preview the upcoming invoice for a subscription that hasn't been created, usecouponinstead.
-
setDiscounts
public InvoiceUpcomingParams.Builder setDiscounts(java.util.List<InvoiceUpcomingParams.Discount> discounts)
The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the customer or subscription. Pass an empty string to avoid inheriting any discounts. To preview the upcoming invoice for a subscription that hasn't been created, usecouponinstead.
-
addExpand
public InvoiceUpcomingParams.Builder addExpand(java.lang.String element)
Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeeInvoiceUpcomingParams.expandfor the field documentation.
-
addAllExpand
public InvoiceUpcomingParams.Builder addAllExpand(java.util.List<java.lang.String> elements)
Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeeInvoiceUpcomingParams.expandfor the field documentation.
-
putExtraParam
public InvoiceUpcomingParams.Builder putExtraParam(java.lang.String key, java.lang.Object value)
Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. SeeInvoiceUpcomingParams.extraParamsfor the field documentation.
-
putAllExtraParam
public InvoiceUpcomingParams.Builder putAllExtraParam(java.util.Map<java.lang.String,java.lang.Object> map)
Add all map key/value pairs to `extraParams` map. A map is initialized for the first `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. SeeInvoiceUpcomingParams.extraParamsfor the field documentation.
-
addInvoiceItem
public InvoiceUpcomingParams.Builder addInvoiceItem(InvoiceUpcomingParams.InvoiceItem element)
Add an element to `invoiceItems` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeeInvoiceUpcomingParams.invoiceItemsfor the field documentation.
-
addAllInvoiceItem
public InvoiceUpcomingParams.Builder addAllInvoiceItem(java.util.List<InvoiceUpcomingParams.InvoiceItem> elements)
Add all elements to `invoiceItems` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeeInvoiceUpcomingParams.invoiceItemsfor the field documentation.
-
setSchedule
public InvoiceUpcomingParams.Builder setSchedule(java.lang.String schedule)
The identifier of the unstarted schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields.
-
setSubscription
public InvoiceUpcomingParams.Builder setSubscription(java.lang.String subscription)
The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but asubscription_itemsis provided, you will preview creating a subscription with those items. If neithersubscriptionnorsubscription_itemsis provided, you will retrieve the next upcoming invoice from among the customer's subscriptions.
-
setSubscriptionBillingCycleAnchor
public InvoiceUpcomingParams.Builder setSubscriptionBillingCycleAnchor(InvoiceUpcomingParams.SubscriptionBillingCycleAnchor subscriptionBillingCycleAnchor)
For new subscriptions, a future timestamp to anchor the subscription's billing cycle. This is used to determine the date of the first full invoice, and, for plans withmonthoryearintervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set tonoworunchanged.
-
setSubscriptionBillingCycleAnchor
public InvoiceUpcomingParams.Builder setSubscriptionBillingCycleAnchor(java.lang.Long subscriptionBillingCycleAnchor)
For new subscriptions, a future timestamp to anchor the subscription's billing cycle. This is used to determine the date of the first full invoice, and, for plans withmonthoryearintervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set tonoworunchanged.
-
setSubscriptionCancelAt
public InvoiceUpcomingParams.Builder setSubscriptionCancelAt(java.lang.Long subscriptionCancelAt)
Timestamp indicating when the subscription should be scheduled to cancel. Will prorate if within the current period and prorations have been enabled usingproration_behavior.
-
setSubscriptionCancelAt
public InvoiceUpcomingParams.Builder setSubscriptionCancelAt(EmptyParam subscriptionCancelAt)
Timestamp indicating when the subscription should be scheduled to cancel. Will prorate if within the current period and prorations have been enabled usingproration_behavior.
-
setSubscriptionCancelAtPeriodEnd
public InvoiceUpcomingParams.Builder setSubscriptionCancelAtPeriodEnd(java.lang.Boolean subscriptionCancelAtPeriodEnd)
Boolean indicating whether this subscription should cancel at the end of the current period.
-
setSubscriptionCancelNow
public InvoiceUpcomingParams.Builder setSubscriptionCancelNow(java.lang.Boolean subscriptionCancelNow)
This simulates the subscription being canceled or expired immediately.
-
addSubscriptionDefaultTaxRate
public InvoiceUpcomingParams.Builder addSubscriptionDefaultTaxRate(java.lang.String element)
Add an element to `subscriptionDefaultTaxRates` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeeInvoiceUpcomingParams.subscriptionDefaultTaxRatesfor the field documentation.
-
addAllSubscriptionDefaultTaxRate
public InvoiceUpcomingParams.Builder addAllSubscriptionDefaultTaxRate(java.util.List<java.lang.String> elements)
Add all elements to `subscriptionDefaultTaxRates` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeeInvoiceUpcomingParams.subscriptionDefaultTaxRatesfor the field documentation.
-
setSubscriptionDefaultTaxRates
public InvoiceUpcomingParams.Builder setSubscriptionDefaultTaxRates(EmptyParam subscriptionDefaultTaxRates)
If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not havetax_ratesset.
-
setSubscriptionDefaultTaxRates
public 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. The default tax rates will apply to any line item that does not havetax_ratesset.
-
addSubscriptionItem
public InvoiceUpcomingParams.Builder addSubscriptionItem(InvoiceUpcomingParams.SubscriptionItem element)
Add an element to `subscriptionItems` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeeInvoiceUpcomingParams.subscriptionItemsfor the field documentation.
-
addAllSubscriptionItem
public InvoiceUpcomingParams.Builder addAllSubscriptionItem(java.util.List<InvoiceUpcomingParams.SubscriptionItem> elements)
Add all elements to `subscriptionItems` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. SeeInvoiceUpcomingParams.subscriptionItemsfor the field documentation.
-
setSubscriptionProrationBehavior
public InvoiceUpcomingParams.Builder setSubscriptionProrationBehavior(InvoiceUpcomingParams.SubscriptionProrationBehavior subscriptionProrationBehavior)
Determines how to handle prorations when the billing cycle changes (e.g., when switching plans, resettingbilling_cycle_anchor=now, or starting a trial), or if an item'squantitychanges. Valid values arecreate_prorations,none, oralways_invoice.Passing
create_prorationswill 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, passalways_invoice.Prorations can be disabled by passing
none.
-
setSubscriptionProrationDate
public InvoiceUpcomingParams.Builder setSubscriptionProrationDate(java.lang.Long subscriptionProrationDate)
If previewing an update to a subscription, and doing proration,subscription_proration_dateforces 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 ofsubscription_items, orsubscription_trial_endare required. Also,subscription_proration_behaviorcannot be set to 'none'.
-
setSubscriptionStartDate
public InvoiceUpcomingParams.Builder setSubscriptionStartDate(java.lang.Long subscriptionStartDate)
Date a subscription is intended to start (can be future or past).
-
setSubscriptionTrialEnd
public InvoiceUpcomingParams.Builder setSubscriptionTrialEnd(InvoiceUpcomingParams.SubscriptionTrialEnd subscriptionTrialEnd)
If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one ofsubscription_itemsorsubscriptionis required.
-
setSubscriptionTrialEnd
public InvoiceUpcomingParams.Builder setSubscriptionTrialEnd(java.lang.Long subscriptionTrialEnd)
If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one ofsubscription_itemsorsubscriptionis required.
-
setSubscriptionTrialFromPlan
public InvoiceUpcomingParams.Builder setSubscriptionTrialFromPlan(java.lang.Boolean subscriptionTrialFromPlan)
Indicates if a plan'strial_period_daysshould be applied to the subscription. Settingsubscription_trial_endper subscription is preferred, and this defaults tofalse. Setting this flag totruetogether withsubscription_trial_endis not allowed.
-
-