Package com.stripe.param
Class InvoiceUpcomingLinesParams.Builder
java.lang.Object
com.stripe.param.InvoiceUpcomingLinesParams.Builder
- Enclosing class:
- InvoiceUpcomingLinesParams
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd 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
(InvoiceUpcomingLinesParams.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
(InvoiceUpcomingLinesParams.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<InvoiceUpcomingLinesParams.Discount> discounts) The coupons to redeem into discounts for the invoice preview.setEndingBefore
(String endingBefore) A cursor for use in pagination.A limit on the number of objects to be returned.setSchedule
(String schedule) The identifier of the schedule whose upcoming invoice you'd like to retrieve.setStartingAfter
(String startingAfter) A cursor for use in pagination.setSubscription
(String subscription) The identifier of the subscription for which you'd like to retrieve the upcoming invoice.setSubscriptionBillingCycleAnchor
(InvoiceUpcomingLinesParams.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) Timestamp indicating when the subscription should be scheduled to cancel.setSubscriptionCancelAt
(Long subscriptionCancelAt) Timestamp indicating when the subscription should be scheduled to 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
(InvoiceUpcomingLinesParams.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'squantity
changes.setSubscriptionProrationDate
(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.setSubscriptionResumeAt
(InvoiceUpcomingLinesParams.SubscriptionResumeAt subscriptionResumeAt) For paused subscriptions, settingsubscription_resume_at
tonow
will 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
(InvoiceUpcomingLinesParams.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_days
should be applied to the subscription.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
build
Finalize and obtain parameter instance from this builder. -
setAutomaticTax
public InvoiceUpcomingLinesParams.Builder setAutomaticTax(InvoiceUpcomingLinesParams.AutomaticTax automaticTax) Settings for automatic tax lookup for this invoice preview. -
setCoupon
The code of the coupon to apply. Ifsubscription
orsubscription_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. -
setCurrency
The currency to preview this invoice in. Defaults to that ofcustomer
if not specified. -
setCustomer
The identifier of the customer whose upcoming invoice you'd like to retrieve. Ifautomatic_tax
is enabled then one ofcustomer
,customer_details
,subscription
, orschedule
must be set. -
setCustomerDetails
public InvoiceUpcomingLinesParams.Builder setCustomerDetails(InvoiceUpcomingLinesParams.CustomerDetails customerDetails) Details about the customer you want to invoice or overrides for an existing customer. Ifautomatic_tax
is enabled then one ofcustomer
,customer_details
,subscription
, orschedule
must 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. SeeInvoiceUpcomingLinesParams.discounts
for the field documentation. -
addAllDiscount
public InvoiceUpcomingLinesParams.Builder addAllDiscount(List<InvoiceUpcomingLinesParams.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. SeeInvoiceUpcomingLinesParams.discounts
for 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 thecoupon
parameter instead. Pass an empty string to avoid inheriting any discounts. To preview the upcoming invoice for a subscription that hasn't been created, usecoupon
instead. -
setDiscounts
public InvoiceUpcomingLinesParams.Builder setDiscounts(List<InvoiceUpcomingLinesParams.Discount> discounts) 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 thecoupon
parameter instead. Pass an empty string to avoid inheriting any discounts. To preview the upcoming invoice for a subscription that hasn't been created, usecoupon
instead. -
setEndingBefore
A cursor for use in pagination.ending_before
is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting withobj_bar
, your subsequent call can includeending_before=obj_bar
in order to fetch the previous page of the list. -
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. SeeInvoiceUpcomingLinesParams.expand
for 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. SeeInvoiceUpcomingLinesParams.expand
for 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. SeeInvoiceUpcomingLinesParams.extraParams
for 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. SeeInvoiceUpcomingLinesParams.extraParams
for the field documentation. -
addInvoiceItem
public InvoiceUpcomingLinesParams.Builder addInvoiceItem(InvoiceUpcomingLinesParams.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. SeeInvoiceUpcomingLinesParams.invoiceItems
for the field documentation. -
addAllInvoiceItem
public InvoiceUpcomingLinesParams.Builder addAllInvoiceItem(List<InvoiceUpcomingLinesParams.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. SeeInvoiceUpcomingLinesParams.invoiceItems
for the field documentation. -
setLimit
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. -
setSchedule
The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. -
setStartingAfter
A cursor for use in pagination.starting_after
is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending withobj_foo
, your subsequent call can includestarting_after=obj_foo
in order to fetch the next page of the list. -
setSubscription
The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but asubscription_items
is provided, you will preview creating a subscription with those items. If neithersubscription
norsubscription_items
is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. -
setSubscriptionBillingCycleAnchor
public InvoiceUpcomingLinesParams.Builder setSubscriptionBillingCycleAnchor(InvoiceUpcomingLinesParams.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 withmonth
oryear
intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set tonow
orunchanged
. -
setSubscriptionBillingCycleAnchor
public InvoiceUpcomingLinesParams.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 withmonth
oryear
intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set tonow
orunchanged
. -
setSubscriptionCancelAt
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
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 InvoiceUpcomingLinesParams.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. SeeInvoiceUpcomingLinesParams.subscriptionDefaultTaxRates
for 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. SeeInvoiceUpcomingLinesParams.subscriptionDefaultTaxRates
for the field documentation. -
setSubscriptionDefaultTaxRates
public InvoiceUpcomingLinesParams.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_rates
set. -
setSubscriptionDefaultTaxRates
public InvoiceUpcomingLinesParams.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_rates
set. -
addSubscriptionItem
public InvoiceUpcomingLinesParams.Builder addSubscriptionItem(InvoiceUpcomingLinesParams.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. SeeInvoiceUpcomingLinesParams.subscriptionItems
for the field documentation. -
addAllSubscriptionItem
public InvoiceUpcomingLinesParams.Builder addAllSubscriptionItem(List<InvoiceUpcomingLinesParams.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. SeeInvoiceUpcomingLinesParams.subscriptionItems
for the field documentation. -
setSubscriptionProrationBehavior
public InvoiceUpcomingLinesParams.Builder setSubscriptionProrationBehavior(InvoiceUpcomingLinesParams.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'squantity
changes. The default value iscreate_prorations
. -
setSubscriptionProrationDate
public InvoiceUpcomingLinesParams.Builder setSubscriptionProrationDate(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. 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_end
are required. Also,subscription_proration_behavior
cannot be set to 'none'. -
setSubscriptionResumeAt
public InvoiceUpcomingLinesParams.Builder setSubscriptionResumeAt(InvoiceUpcomingLinesParams.SubscriptionResumeAt subscriptionResumeAt) For paused subscriptions, settingsubscription_resume_at
tonow
will 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 InvoiceUpcomingLinesParams.Builder setSubscriptionTrialEnd(InvoiceUpcomingLinesParams.SubscriptionTrialEnd subscriptionTrialEnd) If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one ofsubscription_items
orsubscription
is required. -
setSubscriptionTrialEnd
If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one ofsubscription_items
orsubscription
is required. -
setSubscriptionTrialFromPlan
public InvoiceUpcomingLinesParams.Builder setSubscriptionTrialFromPlan(Boolean subscriptionTrialFromPlan) Indicates if a plan'strial_period_days
should be applied to the subscription. Settingsubscription_trial_end
per subscription is preferred, and this defaults tofalse
. Setting this flag totrue
together withsubscription_trial_end
is not allowed. See Using trial periods on subscriptions to learn more.
-