Class InvoiceItemCreateParams.Builder

  • Enclosing class:
    InvoiceItemCreateParams

    public static class InvoiceItemCreateParams.Builder
    extends java.lang.Object
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • setAmount

        public InvoiceItemCreateParams.Builder setAmount​(java.lang.Long amount)
        The integer amount in %s of the charge to be applied to the upcoming invoice. Passing in a negative amount will reduce the amount_due on the invoice.
      • setCustomer

        public InvoiceItemCreateParams.Builder setCustomer​(java.lang.String customer)
        The ID of the customer who will be billed when this invoice item is billed.
      • setDescription

        public InvoiceItemCreateParams.Builder setDescription​(java.lang.String description)
        An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
      • setDiscountable

        public InvoiceItemCreateParams.Builder setDiscountable​(java.lang.Boolean discountable)
        Controls whether discounts apply to this invoice item. Defaults to false for prorations or negative invoice items, and true for all other invoice items.
      • addExpand

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

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

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

        public InvoiceItemCreateParams.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. See InvoiceItemCreateParams.extraParams for the field documentation.
      • setInvoice

        public InvoiceItemCreateParams.Builder setInvoice​(java.lang.String invoice)
        The ID of an existing invoice to add this invoice item to. When left blank, the invoice item will be added to the next upcoming scheduled invoice. This is useful when adding invoice items in response to an invoice.created webhook. You can only add invoice items to draft invoices and there is a maximum of 250 items per invoice.
      • putMetadata

        public InvoiceItemCreateParams.Builder putMetadata​(java.lang.String key,
                                                           java.lang.String value)
        Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. See InvoiceItemCreateParams.metadata for the field documentation.
      • putAllMetadata

        public InvoiceItemCreateParams.Builder putAllMetadata​(java.util.Map<java.lang.String,​java.lang.String> map)
        Add all map key/value pairs to `metadata` map. A map is initialized for the first `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. See InvoiceItemCreateParams.metadata for the field documentation.
      • setMetadata

        public InvoiceItemCreateParams.Builder setMetadata​(EmptyParam metadata)
        Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.
      • setMetadata

        public InvoiceItemCreateParams.Builder setMetadata​(java.util.Map<java.lang.String,​java.lang.String> metadata)
        Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata.
      • setQuantity

        public InvoiceItemCreateParams.Builder setQuantity​(java.lang.Long quantity)
        Non-negative integer. The quantity of units for the invoice item.
      • setSubscription

        public InvoiceItemCreateParams.Builder setSubscription​(java.lang.String subscription)
        The ID of a subscription to add this invoice item to. When left blank, the invoice item will be be added to the next upcoming scheduled invoice. When set, scheduled invoices for subscriptions other than the specified subscription will ignore the invoice item. Use this when you want to express that an invoice item has been accrued within the context of a particular subscription.
      • addTaxRate

        public InvoiceItemCreateParams.Builder addTaxRate​(java.lang.String element)
        Add an element to `taxRates` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. See InvoiceItemCreateParams.taxRates for the field documentation.
      • addAllTaxRate

        public InvoiceItemCreateParams.Builder addAllTaxRate​(java.util.List<java.lang.String> elements)
        Add all elements to `taxRates` list. A list is initialized for the first `add/addAll` call, and subsequent calls adds additional elements to the original list. See InvoiceItemCreateParams.taxRates for the field documentation.
      • setUnitAmount

        public InvoiceItemCreateParams.Builder setUnitAmount​(java.lang.Long unitAmount)
        The integer unit amount in %s of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. Passing in a negative unit_amount will reduce the amount_due on the invoice.
      • setUnitAmountDecimal

        public InvoiceItemCreateParams.Builder setUnitAmountDecimal​(java.math.BigDecimal unitAmountDecimal)
        Same as unit_amount, but accepts a decimal value in %s with at most 12 decimal places. Only one of unit_amount and unit_amount_decimal can be set.