Class InvoiceUpcomingLinesParams.Builder

java.lang.Object
com.stripe.param.InvoiceUpcomingLinesParams.Builder
Enclosing class:
InvoiceUpcomingLinesParams

public static class InvoiceUpcomingLinesParams.Builder extends Object
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • build

      Finalize and obtain parameter instance from this builder.
    • setAutomaticTax

      Settings for automatic tax lookup for this invoice preview.
    • setCoupon

      public InvoiceUpcomingLinesParams.Builder setCoupon(String coupon)
      The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use discounts instead.
    • setCurrency

      public InvoiceUpcomingLinesParams.Builder setCurrency(String currency)
      The currency to preview this invoice in. Defaults to that of customer if not specified.
    • setCustomer

      public InvoiceUpcomingLinesParams.Builder setCustomer(String customer)
      The identifier of the customer whose upcoming invoice you'd like to retrieve. If automatic_tax is enabled then one of customer, customer_details, subscription, or schedule must be set.
    • setCustomerDetails

      Details about the customer you want to invoice or overrides for an existing customer. If automatic_tax is enabled then one of customer, customer_details, subscription, or schedule 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. See InvoiceUpcomingLinesParams.discounts for 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. See InvoiceUpcomingLinesParams.discounts for the field documentation.
    • setDiscounts

      public InvoiceUpcomingLinesParams.Builder setDiscounts(EmptyParam discounts)
      The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts.
    • setDiscounts

      The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts.
    • setEndingBefore

      public InvoiceUpcomingLinesParams.Builder setEndingBefore(String endingBefore)
      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 with obj_bar, your subsequent call can include ending_before=obj_bar in order to fetch the previous page of the list.
    • addExpand

      public InvoiceUpcomingLinesParams.Builder addExpand(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. See InvoiceUpcomingLinesParams.expand for the field documentation.
    • addAllExpand

      public InvoiceUpcomingLinesParams.Builder addAllExpand(List<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. See InvoiceUpcomingLinesParams.expand for the field documentation.
    • putExtraParam

      public InvoiceUpcomingLinesParams.Builder putExtraParam(String key, 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. See InvoiceUpcomingLinesParams.extraParams for the field documentation.
    • putAllExtraParam

      public InvoiceUpcomingLinesParams.Builder putAllExtraParam(Map<String,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. See InvoiceUpcomingLinesParams.extraParams for 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. See InvoiceUpcomingLinesParams.invoiceItems for the field documentation.
    • addAllInvoiceItem

      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. See InvoiceUpcomingLinesParams.invoiceItems for 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.
    • setLimit

      public InvoiceUpcomingLinesParams.Builder setLimit(Long limit)
      A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
    • setOnBehalfOf

      public InvoiceUpcomingLinesParams.Builder setOnBehalfOf(String onBehalfOf)
      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

      public InvoiceUpcomingLinesParams.Builder setOnBehalfOf(EmptyParam onBehalfOf)
      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.
    • setPreviewMode

      Customizes the types of values to include when calculating the invoice. Defaults to next if unspecified.
    • setSchedule

      public InvoiceUpcomingLinesParams.Builder setSchedule(String schedule)
      The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields.
    • setScheduleDetails

      The schedule creation or modification params to apply as a preview. Cannot be used with subscription or subscription_ prefixed fields.
    • setStartingAfter

      public InvoiceUpcomingLinesParams.Builder setStartingAfter(String startingAfter)
      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 with obj_foo, your subsequent call can include starting_after=obj_foo in order to fetch the next page of the list.
    • setSubscription

      public InvoiceUpcomingLinesParams.Builder setSubscription(String subscription)
      The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a 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.
    • 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 with 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. This field has been deprecated and will be removed in a future API version. Use subscription_details.billing_cycle_anchor instead.
    • 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 with 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. This field has been deprecated and will be removed in a future API version. Use subscription_details.billing_cycle_anchor instead.
    • setSubscriptionCancelAt

      public InvoiceUpcomingLinesParams.Builder setSubscriptionCancelAt(Long subscriptionCancelAt)
      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 using proration_behavior. If set during a future period, this will always cause a proration for that period. This field has been deprecated and will be removed in a future API version. Use subscription_details.cancel_at instead.
    • setSubscriptionCancelAt

      public InvoiceUpcomingLinesParams.Builder setSubscriptionCancelAt(EmptyParam subscriptionCancelAt)
      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 using proration_behavior. If set during a future period, this will always cause a proration for that period. This field has been deprecated and will be removed in a future API version. Use subscription_details.cancel_at instead.
    • setSubscriptionCancelAtPeriodEnd

      public InvoiceUpcomingLinesParams.Builder setSubscriptionCancelAtPeriodEnd(Boolean subscriptionCancelAtPeriodEnd)
      Boolean indicating whether this subscription should cancel at the end of the current period. This field has been deprecated and will be removed in a future API version. Use subscription_details.cancel_at_period_end instead.
    • setSubscriptionCancelNow

      public InvoiceUpcomingLinesParams.Builder setSubscriptionCancelNow(Boolean subscriptionCancelNow)
      This simulates the subscription being canceled or expired immediately. This field has been deprecated and will be removed in a future API version. Use subscription_details.cancel_now instead.
    • addSubscriptionDefaultTaxRate

      public InvoiceUpcomingLinesParams.Builder addSubscriptionDefaultTaxRate(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. See InvoiceUpcomingLinesParams.subscriptionDefaultTaxRates for the field documentation.
    • addAllSubscriptionDefaultTaxRate

      public InvoiceUpcomingLinesParams.Builder addAllSubscriptionDefaultTaxRate(List<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. See InvoiceUpcomingLinesParams.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 have tax_rates set. This field has been deprecated and will be removed in a future API version. Use subscription_details.default_tax_rates instead.
    • 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 have tax_rates set. This field has been deprecated and will be removed in a future API version. Use subscription_details.default_tax_rates instead.
    • setSubscriptionDetails

      public InvoiceUpcomingLinesParams.Builder setSubscriptionDetails(InvoiceUpcomingLinesParams.SubscriptionDetails subscriptionDetails)
      The subscription creation or modification params to apply as a preview. Cannot be used with schedule or schedule_details fields.
    • addSubscriptionItem

      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. See InvoiceUpcomingLinesParams.subscriptionItems for the field documentation.
    • addAllSubscriptionItem

      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. See InvoiceUpcomingLinesParams.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, resetting billing_cycle_anchor=now, or starting a trial), or if an item's quantity changes. The default value is create_prorations. This field has been deprecated and will be removed in a future API version. Use subscription_details.proration_behavior instead.
    • 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 of subscription_items, or subscription_trial_end are required. Also, subscription_proration_behavior cannot be set to 'none'. This field has been deprecated and will be removed in a future API version. Use subscription_details.proration_date instead.
    • setSubscriptionResumeAt

      public InvoiceUpcomingLinesParams.Builder setSubscriptionResumeAt(InvoiceUpcomingLinesParams.SubscriptionResumeAt subscriptionResumeAt)
      For paused subscriptions, setting subscription_resume_at to now will preview the invoice that will be generated if the subscription is resumed. This field has been deprecated and will be removed in a future API version. Use subscription_details.resume_at instead.
    • setSubscriptionStartDate

      public InvoiceUpcomingLinesParams.Builder setSubscriptionStartDate(Long subscriptionStartDate)
      Date a subscription is intended to start (can be future or past). This field has been deprecated and will be removed in a future API version. Use subscription_details.start_date instead.
    • 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 of subscription_items or subscription is required. This field has been deprecated and will be removed in a future API version. Use subscription_details.trial_end instead.
    • setSubscriptionTrialEnd

      public InvoiceUpcomingLinesParams.Builder setSubscriptionTrialEnd(Long subscriptionTrialEnd)
      If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of subscription_items or subscription is required. This field has been deprecated and will be removed in a future API version. Use subscription_details.trial_end instead.
    • setSubscriptionTrialFromPlan

      public InvoiceUpcomingLinesParams.Builder setSubscriptionTrialFromPlan(Boolean subscriptionTrialFromPlan)
      Indicates if a plan's 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. See Using trial periods on subscriptions to learn more.