Class InvoiceCreatePreviewParams.Builder

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

public static class InvoiceCreatePreviewParams.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 InvoiceCreatePreviewParams.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 InvoiceCreatePreviewParams.Builder setCurrency(String currency)
      The currency to preview this invoice in. Defaults to that of customer if not specified.
    • setCustomer

      public InvoiceCreatePreviewParams.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 InvoiceCreatePreviewParams.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 InvoiceCreatePreviewParams.discounts for the field documentation.
    • setDiscounts

      public InvoiceCreatePreviewParams.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.
    • addExpand

      public InvoiceCreatePreviewParams.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 InvoiceCreatePreviewParams.expand for the field documentation.
    • addAllExpand

      public InvoiceCreatePreviewParams.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 InvoiceCreatePreviewParams.expand for the field documentation.
    • putExtraParam

      public InvoiceCreatePreviewParams.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 InvoiceCreatePreviewParams.extraParams for the field documentation.
    • putAllExtraParam

      public InvoiceCreatePreviewParams.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 InvoiceCreatePreviewParams.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 InvoiceCreatePreviewParams.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 InvoiceCreatePreviewParams.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.
    • setOnBehalfOf

      public InvoiceCreatePreviewParams.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 InvoiceCreatePreviewParams.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.
    • setSchedule

      public InvoiceCreatePreviewParams.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.
    • setSubscription

      public InvoiceCreatePreviewParams.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.
    • setSubscriptionDetails

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