New Decimal Quantity Support
Stripe has introduced support for decimal quantities when creating or updating Invoice Items and Invoice Line Items. The new quantity_decimal parameter accepts string values in decimal format with up to 12 decimal places of precision, enabling more granular billing scenarios.
Use Cases
This enhancement unlocks several billing patterns previously constrained by integer-only quantities:
- Accrued usage billing: Invoice for partial units of consumption during billing periods
- Fractional service hours: Bill customers for hourly services with minute-level granularity (e.g., 2.5 hours)
- Partial product units: Charge for fractional quantities of physical or digital products
- Pro-rated billing: Handle mid-cycle adjustments with decimal precision
Migration Path
The existing quantity parameter is now deprecated and will be removed in a future API version. Stripe recommends migrating to quantity_decimal for all new integrations.
Backward compatibility: Existing integrations using quantity will continue to work without changes. When you set quantity_decimal, the legacy quantity field is automatically populated with the integer truncation of that value (e.g., 5.7 becomes 5). A single request can only set one parameter—not both.
Implementation
To upgrade, update your SDK to the latest version for API version 2026-03-25.dahlia, then migrate calls from quantity to quantity_decimal. Test your integration in the Stripe dashboard before rolling out to production. SDKs are available for Ruby, Python, PHP, Java, Node.js, Go, and .NET.