Create an invoice item

Changed on

Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is specified, the item will be on the next invoice created for the customer specified.

post/v1/invoiceitems

Request

  • Base URL: https://api.stripe.com
  • URL: https://api.stripe.com/v1/invoiceitems
  • Auth: one of:
    • HTTP basic
    • HTTP bearer

Request body application/x-www-form-urlencoded

amountinteger

The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. Passing in a negative amount will reduce the amount_due on the invoice.

currencystring currency

Three-letter ISO currency code, in lowercase. Must be a supported currency.

customerstring

The ID of the customer to bill for this invoice item.

customer_accountstring

The ID of the account representing the customer to bill for this invoice item.

descriptionstring

An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.

discountableboolean

Controls whether discounts apply to this invoice item. Defaults to false for prorations or negative invoice items, and true for all other invoice items.

expandstring[]

Specifies which fields in the response should be expanded.

invoicestring

The ID of an existing invoice to add this invoice item to. For subscription invoices, when left blank, the invoice item will be added to the next upcoming scheduled invoice. For standalone invoices, the invoice item won't be automatically added unless you pass pending_invoice_item_behavior: 'include' when creating the 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.

quantityinteger

Non-negative integer. The quantity of units for the invoice item. Use quantity_decimal instead to provide decimal precision. This field will be deprecated in favor of quantity_decimal in a future version.

quantity_decimalstring decimal

Non-negative decimal with at most 12 decimal places. The quantity of units for the invoice item.

subscriptionstring

The ID of a subscription to add this invoice item to. When left blank, the invoice item is 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.

tax_behavior'exclusive' | 'inclusive' | 'unspecified'

Only required if a default tax behavior was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of inclusive, exclusive, or unspecified. Once specified as either inclusive or exclusive, it cannot be changed.

tax_ratesstring[]

The tax rates which apply to the invoice item. When set, the default_tax_rates on the invoice do not apply to this invoice item.

unit_amount_decimalstring decimal

The decimal unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount_decimal will be multiplied by the quantity to get the full amount. Passing in a negative unit_amount_decimal will reduce the amount_due on the invoice. Accepts at most 12 decimal places.

Response

Successful response.

amountinteger required

Amount (in the currency specified) of the invoice item. This should always be equal to unit_amount * quantity.

currencystring currency required

Three-letter ISO currency code, in lowercase. Must be a supported currency.

customer_accountstring nullable

The ID of the account to bill for this invoice item.

dateinteger required

Time at which the object was created. Measured in seconds since the Unix epoch.

descriptionstring nullable

An arbitrary string attached to the object. Often useful for displaying to users.

discountableboolean required

If true, discounts will apply to this invoice item. Always false for prorations.

frozen_fieldsstring[]

Array of field names that can't be modified. Attempting to update a frozen field returns an error.

idstring required

Unique identifier for the object.

livemodeboolean required

If the object exists in live mode, the value is true. If the object exists in test mode, the value is false.

metadataobject nullable

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.

net_amountinteger

The amount after discounts, but before credits and taxes. This field is null for discountable=true items.

object'invoiceitem' required

String representing the object's type. Objects of the same type share the same value.

prorationboolean required

Whether the invoice item was created automatically as a proration adjustment when the customer switched plans.

quantityinteger required

Quantity of units for the invoice item in integer format, with any decimal precision truncated. For the item's full-precision decimal quantity, use quantity_decimal. This field will be deprecated in favor of quantity_decimal in a future version. If the invoice item is a proration, the quantity of the subscription that the proration was computed for.

quantity_decimalstring decimal required

Non-negative decimal with at most 12 decimal places. The quantity of units for the invoice item.

Changes

    • warning

      added the new final_payment_failure enum value to the //////// response property for the response status

    • warning

      added the new first_payment_failure enum value to the //////// response property for the response status

    • info

      added the optional property ///// to the response with the status

Some revisions have not been checked yet.