Decimal pricing
Decimal pricing lets you set usage add-on prices with up to nine decimal places — so businesses charging fractions of a cent per unit can bill accurately without rounding errors at the unit level.
Definition
Decimal pricing is a pricing method for businesses that need non-integer unit prices. Instead of rounding prices to the nearest cent at configuration time, you define a precise per-unit cost — up to nine decimal places — and Recurly calculates the invoice total by multiplying usage by that unit price, rounding only the final line item to the currency's supported precision. For example, a video streaming company charging $0.005 per GB sets that exact price, and the total is computed correctly regardless of how much data a customer consumes.
Key benefits
Key details
Plans and subscriptions
Decimal pricing is applied through usage add-ons, created via the Admin Console, the V3 API (2021-02-25), or the V2 API.
When setting pricing via the API, use the unit_amount_decimal field. Decimal pricing supports up to nine decimal places across fixed, tiered, volume, and stairstep pricing models. When unit_amount_decimal is provided, unit_amount is automatically set to null. A plan's predefined prices are used by default when creating a subscription, but you can override them per subscription as needed.
Invoices
Invoice line item totals are rounded to the decimal precision supported by the currency. The unit_amount_decimal value is displayed on the invoice. In API responses, the decimal price is stored in unit_amount_decimal — unit_amount will be null.
Refunds
Recurly limits refunds to the invoice amount to prevent over-refunding. Line-item refunds are recommended for clarity on which products are being refunded. For open-amount refunds with decimal pricing, Recurly rounds the amount and refundable quantity to stay within the remaining refundable amount — this may cause minor per-unit discrepancies, but prevents over-refunding.
Emails
The unit_amount_decimal value is automatically mapped to the unit_amount parameter in email templates. If your templates already display invoice line items, they'll work correctly with decimal pricing without any changes.
Exports
The following exports include a unit_amount_decimal column when decimal pricing is in use:
- Subscription Add-Ons
- Subscription Add-Ons History
- Subscription Add-Ons Usage
Webhooks
Subscription notifications include a unit_amount_in_decimal_cents value when decimal pricing is active. The unit_amount field will be null in these cases.
Set up decimal pricing
If your Recurly site was created on or before May 7, 2018, you must enable Credit Invoices and Only Bill What Changed before using decimal pricing. Both settings are available on the Invoice Settings page.
Integration support
| Integration | Decimal support |
| Xero | Supports up to four decimal places for unit price. Prices may round to two decimal places in Xero's display, but the line item total charge is always correct. |
| QuickBooks Online | Supports up to seven decimal places. The line item total charge is always correct, though the displayed unit price is limited by QuickBooks Online's precision. |
| NetSuite | Does not currently support decimal pricing. Contact [email protected] if this is a requirement for your business. |
Updated about 1 hour ago