Glossary

Stripe Quantity Transformation (transform_quantity)

Stripe quantity transformation is a setting on a per-unit Price, transform_quantity, that divides the quantity you report by a fixed number and rounds the result up or down before Stripe multiplies it by the unit price, so you can report 7 users and bill for 2 packs of 5.

Also called: transform_quantity, package pricing, divide_by

14-day free trial · card required · cancel anytime

Definition

Quantity transformation separates what you count from what you charge for. You keep reporting the natural number, such as the users on an account or the emails sent this month, and Stripe converts it into billing units before pricing it.

Stripe describes the problem it solves with a productivity suite that “charges 10 USD for every 5 users (or portion thereof).” Without transformation, that business would have to raise the subscription item quantity by 1 for every 5 users and keep that arithmetic in its own code. With transform_quantity, Stripe says, “you can instruct Stripe to transform the quantity before applying the per unit cost.”

The setting lives on the Price, not on the subscription. Every subscription on that Price gets the same transformation, which makes it a pricing decision rather than a per-customer one.

Key points

  • +Set on the Price object as transform_quantity, with two fields: divide_by (the pack size) and round (up or down).
  • +Stripe’s API reference: it applies “a transformation to the reported usage or set quantity before computing the amount billed.”
  • +Works only with billing_scheme set to per_unit. Stripe states it is incompatible with tiered pricing and cannot be combined with tiers.
  • +round up charges for a partial pack: 6 users at 10 USD per 5 users bills 2 packs, 20 USD.
  • +round down charges only for full packs: Stripe’s example bills 0.10 USD for every full 1,000 emails.
  • +On metered prices the transformation runs on the period’s usage at the end of the billing period.
  • +The quantity you report and the number of packs you are billed for are different numbers, by design.

How divide_by and round work

Stripe’s quantities guide creates the example Price with transform_quantity divide_by set to 5 and round set to up, at a unit amount of 10 USD a month. In its words, “The Stripe billing system divides the quantity by 5 and rounds up before calculating by the unit cost.”

Run a few seat counts through it and the pattern is easy to see. 1 to 5 users bill as 1 pack, 10 USD. 6 to 10 users bill as 2 packs, 20 USD. 11 users bill as 3 packs, 30 USD. The customer pays for capacity in blocks of 5: the 11th user adds a full 10 USD, and users 12 to 15 then cost nothing extra.

Rounding down is the opposite promise: the customer pays only for complete blocks. Stripe gives the case “where you don’t want to charge for a portion of usage, like charging for every full gigabyte of usage of a broadband internet service.” A partial block is free until it fills up.

Per-unit only: why it can’t be combined with tiers

Quantity transformation is a per-unit feature. Stripe’s quantities guide states: “You can only use transform_quantity with billing_scheme=per_unit. It’s incompatible with tiered pricing.” The Price object reference says the same thing more briefly: it “Cannot be combined with tiers.”

The practical consequence is that you choose one shape per Price. Blocks of 5 users at a flat rate per block is transformation. A lower rate per user once an account passes 50 users is tiered pricing. If you want both, they have to live on separate Prices or be modeled another way.

When you read a Price in the API, the field tells you which kind you are looking at. transform_quantity is null on an ordinary per-unit Price. When it is set, the unit_amount is the price of one pack, not one user.

Quantity transformation on metered prices

The same setting works with usage-based billing. Stripe says the transformation “applies to prices with recurring[usage_type]=metered at the end of a billing period in the same way it applies to quantity for prices with recurring[usage_type]=licensed.”

Stripe’s example is a marketing email service: a metered Price with divide_by set to 1000, round set to down and a unit amount of 0.10 USD, so “usage can be reported per email and you can bill the customer 0.10 USD for every 1000 emails they send.”

Work it through for one month. A customer who sends 2,499 emails is billed for 2 blocks, 0.20 USD. The 499 emails beyond the second full block are not charged that month, because the transformation rounds down on the period’s total. Usage is reported one email at a time, and the rounding happens once, at the end.

The reported quantity and the billed units are different numbers

This is the part that confuses people reading invoices and reports. With transformation on, two quantities describe the same subscription: the one you set or report (7 users), and the number of packs Stripe actually priced (2).

Stripe’s invoice line item reference defines the quantity on a subscription line as “the quantity of the subscription that the proration was computed for.” Read literally, that is the quantity you set on the subscription, not the number of packs. Before building reporting on top of either number, open one of your own finalized invoices for a transformed Price and check which quantity the line shows next to which amount.

Neither number is wrong. The users figure is the right one for headcount and product analytics. The pack count and the amount are the right ones for revenue. Problems start when a report treats one as the other.

When quantity transformation is the right choice

It fits any price where you sell capacity in fixed blocks but count in single units: seats sold in packs, storage sold per full gigabyte, messages sold per thousand. Your application reports the real count and never has to compute pack math or remember which way to round.

It is less suited to prices that change rate with volume, which is what tiers are for, and to anything where the customer expects to see their own unit count multiplied by a visible per-unit price.

Because the transformation belongs to the Price, changing it later means creating a new Price, and Stripe does not let you change a price’s amount in the API either. Moving existing subscribers to a new pack size is a price migration, with the same timing and proration choices as any other price change.

What a transformed Price looks like in QuickBooks with Acodei

Acodei’s Invoice Sync, a paid-plan feature, creates a QuickBooks invoice when a Stripe invoice is finalized and reproduces every line item as your mapping settings allow. Each line uses the product returned by Multiple Product Mapping if it is enabled, and the default product otherwise. The line amount is the amount Stripe billed for the packs.

The quantity on the QuickBooks line depends on a setting. By default, Acodei writes a hard-coded quantity of 1 per line. With Quantity Tracking on, it pushes the Stripe line quantity instead. Quantity Tracking is off by default, requires enablement on Acodei’s side, and is not available with inclusive tax.

So if you rely on the QuickBooks quantity column for a transformed Price, turn on Quantity Tracking and confirm on one synced invoice which Stripe quantity it carries, as described above.

Want to see this on your own Stripe data?

Start a free trial

14-day free trial · card required · cancel anytime

Frequently asked questions

What is transform_quantity in Stripe?

It is a setting on a per-unit Price that tells Stripe to divide the reported quantity by a fixed number (divide_by) and round the result up or down (round) before multiplying by the unit price. It lets you report a natural count, such as users or emails, and bill in packs, such as 10 USD for every 5 users.

Can I use transform_quantity with tiered pricing?

No. Stripe states that transform_quantity only works with billing_scheme set to per_unit and is incompatible with tiered pricing. The Price reference says it cannot be combined with tiers. If you need volume discounts and pack-based billing together, model them on separate Prices.

Does transform_quantity round up or down?

Either, and you choose. With round set to up, a partial pack is charged in full, so 6 users at 10 USD per 5 users bills 20 USD. With round set to down, only complete packs are charged, which Stripe suggests for cases like billing for every full gigabyte.

Does quantity transformation work with metered billing?

Yes. Stripe says it applies to metered prices at the end of a billing period in the same way it applies to quantity on licensed prices. Stripe’s example bills 0.10 USD for every 1,000 emails sent, with usage reported per email and rounding down on the period’s total.

What quantity reaches QuickBooks for a transformed Stripe price?

With Acodei, the QuickBooks line carries a quantity of 1 by default. With Quantity Tracking turned on, which is off by default and needs enablement, the line carries the Stripe line quantity, and the amount is what Stripe billed. Check one synced invoice to confirm which Stripe quantity appears for your Price.

What customers say about running Stripe through Acodei

Stripe Verified Partner BadgeIntuit QuickBooks
★★★★★
“If you're testing out all the different Stripe/QuickBooks integration apps right now, let me save you some time. This one is the best one by far.”
RyanOwner at Indie Music Academy
★★★★★
“Works well and is really helpful for massive transactions. The support is really fast and helpful. 100% recommended.”
AndresCo-founder and CEO at Kanguro Collections and Reinsurance

Related reading

More glossary terms

See the full glossary

Ready to try Acodei?

Connect Stripe to QuickBooks Online in minutes and let the fees, refunds, and payouts land where your accountant expects them.

14-day free trial · card required · cancel anytime