Package com.stripe.param
Class InvoiceUpcomingParams.Builder
java.lang.Object
com.stripe.param.InvoiceUpcomingParams.Builder
- Enclosing class:
- InvoiceUpcomingParams
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAllDiscount(List<InvoiceUpcomingParams.Discount> elements) Add all elements to `discounts` list.addAllExpand(List<String> elements) Add all elements to `expand` list.Add all elements to `invoiceItems` list.addAllSubscriptionDefaultTaxRate(List<String> elements) Add all elements to `subscriptionDefaultTaxRates` list.Add all elements to `subscriptionItems` list.Add an element to `discounts` list.Add an element to `expand` list.Add an element to `invoiceItems` list.addSubscriptionDefaultTaxRate(String element) Add an element to `subscriptionDefaultTaxRates` list.Add an element to `subscriptionItems` list.build()Finalize and obtain parameter instance from this builder.putAllExtraParam(Map<String, Object> map) Add all map key/value pairs to `extraParams` map.putExtraParam(String key, Object value) Add a key/value pair to `extraParams` map.setAutomaticTax(InvoiceUpcomingParams.AutomaticTax automaticTax) Settings for automatic tax lookup for this invoice preview.The code of the coupon to apply.setCurrency(String currency) The currency to preview this invoice in.setCustomer(String customer) The identifier of the customer whose upcoming invoice you'd like to retrieve.setCustomerDetails(InvoiceUpcomingParams.CustomerDetails customerDetails) Details about the customer you want to invoice or overrides for an existing customer.setDiscounts(EmptyParam discounts) The coupons to redeem into discounts for the invoice preview.setDiscounts(List<InvoiceUpcomingParams.Discount> discounts) The coupons to redeem into discounts for the invoice preview.The connected account that issues the invoice.setOnBehalfOf(EmptyParam onBehalfOf) The account (if any) for which the funds of the invoice payment are intended.setOnBehalfOf(String onBehalfOf) The account (if any) for which the funds of the invoice payment are intended.setSchedule(String schedule) The identifier of the schedule whose upcoming invoice you'd like to retrieve.setSubscription(String subscription) The identifier of the subscription for which you'd like to retrieve the upcoming invoice.setSubscriptionBillingCycleAnchor(InvoiceUpcomingParams.SubscriptionBillingCycleAnchor subscriptionBillingCycleAnchor) For new subscriptions, a future timestamp to anchor the subscription's billing cycle.setSubscriptionBillingCycleAnchor(Long subscriptionBillingCycleAnchor) For new subscriptions, a future timestamp to anchor the subscription's billing cycle.setSubscriptionCancelAt(EmptyParam subscriptionCancelAt) A timestamp at which the subscription should cancel.setSubscriptionCancelAt(Long subscriptionCancelAt) A timestamp at which the subscription should cancel.setSubscriptionCancelAtPeriodEnd(Boolean subscriptionCancelAtPeriodEnd) Boolean indicating whether this subscription should cancel at the end of the current period.setSubscriptionCancelNow(Boolean subscriptionCancelNow) This simulates the subscription being canceled or expired immediately.setSubscriptionDefaultTaxRates(EmptyParam subscriptionDefaultTaxRates) If provided, the invoice returned will preview updating or creating a subscription with these default tax rates.setSubscriptionDefaultTaxRates(List<String> subscriptionDefaultTaxRates) If provided, the invoice returned will preview updating or creating a subscription with these default tax rates.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.setSubscriptionProrationDate(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.setSubscriptionResumeAt(InvoiceUpcomingParams.SubscriptionResumeAt subscriptionResumeAt) For paused subscriptions, settingsubscription_resume_attonowwill preview the invoice that will be generated if the subscription is resumed.setSubscriptionStartDate(Long subscriptionStartDate) Date a subscription is intended to start (can be future or past).setSubscriptionTrialEnd(InvoiceUpcomingParams.SubscriptionTrialEnd subscriptionTrialEnd) If provided, the invoice returned will preview updating or creating a subscription with that trial end.setSubscriptionTrialEnd(Long subscriptionTrialEnd) If provided, the invoice returned will preview updating or creating a subscription with that trial end.setSubscriptionTrialFromPlan(Boolean subscriptionTrialFromPlan) Indicates if a plan'strial_period_daysshould be applied to the subscription.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
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
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. -
setCurrency
The currency to preview this invoice in. Defaults to that ofcustomerif not specified. -
setCustomer
The identifier of the customer whose upcoming invoice you'd like to retrieve. Ifautomatic_taxis enabled then one ofcustomer,customer_details,subscription, orschedulemust be set. -
setCustomerDetails
public InvoiceUpcomingParams.Builder setCustomerDetails(InvoiceUpcomingParams.CustomerDetails customerDetails) Details about the customer you want to invoice or overrides for an existing customer. Ifautomatic_taxis enabled then one ofcustomer,customer_details,subscription, orschedulemust be set. -
addDiscount
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
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
The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the customer or subscription. This only works for coupons directly applied to the invoice. To apply a coupon to a subscription, you must use thecouponparameter instead. Pass an empty string to avoid inheriting any discounts. To preview the upcoming invoice for a subscription that hasn't been created, usecouponinstead. -
setDiscounts
The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the customer or subscription. This only works for coupons directly applied to the invoice. To apply a coupon to a subscription, you must use thecouponparameter instead. Pass an empty string to avoid inheriting any discounts. To preview the upcoming invoice for a subscription that hasn't been created, usecouponinstead. -
addExpand
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
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
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
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
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(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. -
setIssuer
The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. -
setOnBehalfOf
The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the Invoices with Connect documentation for details. -
setOnBehalfOf
The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the Invoices with Connect documentation for details. -
setSchedule
The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. -
setSubscription
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(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
A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled usingproration_behavior. If set during a future period, this will always cause a proration for that period. -
setSubscriptionCancelAt
A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled usingproration_behavior. If set during a future period, this will always cause a proration for that period. -
setSubscriptionCancelAtPeriodEnd
public InvoiceUpcomingParams.Builder setSubscriptionCancelAtPeriodEnd(Boolean subscriptionCancelAtPeriodEnd) Boolean indicating whether this subscription should cancel at the end of the current period. -
setSubscriptionCancelNow
This simulates the subscription being canceled or expired immediately. -
addSubscriptionDefaultTaxRate
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
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(List<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(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. The default value iscreate_prorations. -
setSubscriptionProrationDate
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 within the current phase of the schedule backing this subscription, if the schedule exists. If set,subscription, and one ofsubscription_items, orsubscription_trial_endare required. Also,subscription_proration_behaviorcannot be set to 'none'. -
setSubscriptionResumeAt
public InvoiceUpcomingParams.Builder setSubscriptionResumeAt(InvoiceUpcomingParams.SubscriptionResumeAt subscriptionResumeAt) For paused subscriptions, settingsubscription_resume_attonowwill preview the invoice that will be generated if the subscription is resumed. -
setSubscriptionStartDate
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
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(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. See Using trial periods on subscriptions to learn more.
-