sincecutoff.com
← all changes

Stripe Invoice Items and Invoice Line Items accept decimal quantities

Introduced 2026-03-25 · score 0.96

HOW TO USE IT

When creating or updating an Invoice Item or updating an invoice line item with fractional units, set `quantity_decimal` to a non-negative decimal string with up to 12 decimal places. Use only `quantity_decimal`; a request cannot set both it and `quantity`.

curl https://api.stripe.com/v1/invoiceitems -u "<YOUR_SECRET_KEY>" -H "Stripe-Version: 2026-03-25.dahlia" -d customer=<CUSTOMER_ID> -d "pricing[price]=<PRICE_ID>" -d quantity_decimal="5.7"
curl https://api.stripe.com/v1/invoiceitems/<INVOICEITEM_ID> -u "<YOUR_SECRET_KEY>" -H "Stripe-Version: 2026-03-25.dahlia" -d quantity_decimal="5.7"
curl -X POST https://api.stripe.com/v1/invoices/<INVOICE_ID>/lines/<LINE_ITEM_ID> -u "<YOUR_SECRET_KEY>" -H "Stripe-Version: 2026-03-25.dahlia" -d quantity_decimal="5.7"

WHY THIS HELPS

When implementing invoice creation or updates that need fractional quantities, use decimal quantities for Invoice Items or Invoice Line Items.

REQUIREMENTS AND LIMITATIONS

  • quantity_decimal: Non-negative decimal quantity string with at most 12 decimal places; use it for decimal precision.
  • quantity: Non-negative integer quantity; deprecated in favor of `quantity_decimal`. A request may set either `quantity` or `quantity_decimal`, but not both.
  • customer: Customer ID to bill for the Invoice Item.
  • pricing[price]: Price ID used to price the Invoice Item.
  • invoice (required): Invoice ID for the invoice line item update endpoint.
  • line_item_id (required): Invoice line item ID for the invoice line item update endpoint.
  • Prerequisite: Authenticate with a Stripe secret key. Creating an Invoice Item requires a customer and a price; the docs list creating those objects as setup. Invoice Items can only be added to draft invoices. Updates to Invoice Items are only possible before the attached invoice is closed; invoice line item updates are only possible before the invoice is finalized.
  • `quantity_decimal` accepts string values in decimal format, with up to 12 decimal places of precision.
  • A single request can set either `quantity` or `quantity_decimal`, but not both.
  • Setting `quantity_decimal` also sets `quantity` to the same value truncated to an integer.
  • `quantity` remains available for existing integrations but is deprecated, does not support decimal values, and will be removed in a future breaking API version.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card