Stripe Item Handling Scripts and QuickBooks

Stripe item handling scripts skip prorations, defer invoice items and split one subscription across several invoices. What each one means in QuickBooks.

Acodei Content Team · 11/26/2026 · 15 min read

By default, a Stripe subscription puts everything it bills in a cycle on one invoice: the plan, the add-ons, the metered usage and any prorations from mid-cycle changes. Your bookkeeping is built around that. One invoice per customer per cycle, one payment, one line in accounts receivable.

Stripe's item handling scripts change that, account-wide, from inside Stripe Billing. A script can stop a proration from being created at all, hold an item back so it waits for a later invoice, or split one subscription's cycle across several invoices. Each of those is a reasonable billing decision. Each one also changes how many invoices reach QuickBooks, what is on them, and what is billed but not yet invoiced at month end.

This guide covers what the three script methods do, the scripts Stripe has already written, the limits Stripe puts on them, and what each pattern means for your QuickBooks file. Start a free trial.

What item handling scripts are

Billing scripts are small TypeScript functions that run on Stripe's own infrastructure at fixed steps in the billing flow, which Stripe calls extension points. Item handling is one of them. Stripe's item handling guide says these scripts "allow you to decide how subscriptions create invoice items, when they assign them to invoices, and how they group line items onto one or more invoices."

Without a script, Stripe decides all of that from the subscription's own settings. Stripe's guide puts it this way: "Whether new invoice items or invoices are created depends on properties of the subscription like the proration_behavior." A script replaces that default at three points, each one a separate method:

MethodWhen it runsWhat it decides
beforeItemCreationBefore invoice items are createdCreate each item, or skip it entirely
filterItemsBefore invoices are createdWhich items go on this invoice. The rest wait as pending invoice items
groupItemsBefore invoices are createdHow the items are split across one or more invoices

They run in that order, and each one only sees what the previous one let through. Stripe gives the example directly: "items filtered out by filterItems don't appear in the items available to groupItems."

Each item the script sees carries the facts you need to make a decision: a type of credit or debit, an isProration flag, the servicePeriod it covers, a prorationFactor (where 1 is a full billing period and 0.5 is half of one), and the price with its product and the product's metadata. That last part matters. Scripts run at the account level, so the usual way to aim one at specific products is a metadata key on those products.

The three things a script can do to an invoice

Skip an item: beforeItemCreation

This method returns a creationStrategy for every item: invoice to create it as normal, or doNotCreate to skip it. Stripe's own example suppresses proration items for any product whose metadata says so, while every other item is invoiced as usual.

A skipped item is not deferred or hidden. It never exists. There is no invoice item, no line, and nothing waiting on the customer for later.

Hold an item back: filterItems

This method returns the items that go on the invoice being built. Stripe is explicit about the rest: "Items that you don't return are deferred, leaving them as pending invoice items for a future invoice."

Stripe's example keeps only recurring items on the subscription invoice, so one-time charges are left as pending invoice items that you can later add to a one-off invoice you create yourself. Another of its examples leaves a 0.50 USD add-on off the invoice so it rolls into a later cycle.

Split the cycle into several invoices: groupItems

This method returns groups, and "each group becomes a separate invoice." Exactly one group should set setsLatestInvoice: true. That invoice becomes the subscription's latest_invoice, the one most integrations and dashboards treat as the invoice for the cycle. Stripe caps the number of supplementary invoices at 4.

One detail is easy to miss. Stripe's reference says that if no group is set to true, "an empty invoice is created and used as the latest invoice."

The scripts Stripe already wrote

Stripe recommends starting with its own scripts before writing one. You turn them on in the Dashboard under Settings > Billing > Billing customizations, by selecting Customize next to Invoice item creation and routing. There are three, described on Stripe's invoice item creation and routing page.

Separate invoice for metered items. A subscription with both licensed and metered prices normally produces one invoice. This script routes items by usage type, and "the invoice with licensed items becomes the latest invoice for the subscription." Stripe's example: a 20 USD Pro Plan plus 15 USD of metered API usage becomes two invoices, 20 USD and 15 USD, instead of one for 35 USD. The script has no settings.

Skip creating a partial period proration item. You choose a product metadata key and value. For matching products, Stripe stops creating proration items that cover part of a period. The rule is precise: an item qualifies only when it is a proration and its proration factor isn't a whole number. A factor of 0.5 is skipped. Factors of 1, 2 or -1 are still invoiced. The script also skips a credit tied to a debit it suppresses in the same run. Stripe notes that this "doesn't automatically skip future credits for previously suppressed debits," so look at the next change on that subscription too.

Remove zero-quantity metered items before creation. Metered items with a quantity of exactly zero aren't created, so a customer who used nothing doesn't get a 0 USD usage line. The test is the quantity, not the amount, so a nonzero quantity that prices to zero still appears.

The limits to know first

These apply to every billing script, from Stripe's author your own scripts page, plus a few that are specific to item handling:

  • Subscriptions in flexible billing mode only. Scripts run for subscriptions using flexible billing mode (API version 2025-06-30.basil and later), plus pricing plan and license fee subscriptions. A book of older classic-mode subscriptions is unaffected.
  • Not standalone invoices. "Scripts don't affect standalone invoices that aren't associated with a subscription." Also, filterItems doesn't apply to one-off invoices created with pending_invoice_items_behavior set to include.
  • One script per extension point, account-wide. You can't run two item handling scripts at once, and "You can't apply different scripts to individual customers or subscriptions." Product metadata is how you target.
  • Checkout runs only the first method. When a Checkout Session creates a subscription, beforeItemCreation runs but filterItems and groupItems don't, "because Checkout can't defer items or split them across invoices." So the first invoice of a Checkout signup is never split, even when renewals are.
  • Previews don't show the split. groupItems "doesn't run for preview invoices." A preview of the upcoming invoice shows one invoice even when the real cycle will produce two.
  • Not for connected accounts or INR e-mandates. Scripts can't be shared to connected accounts through Stripe Connect, and invoices that need e-mandates for India off-session payments aren't supported.
  • Versions apply going forward. Switching versions changes future billing only. Invoices already processed under the old version stay as they were.

When a script fails

A billing script fails if it runs longer than 500 milliseconds, throws an exception, or returns something that breaks the validation rules (for item handling, that includes leaving out an input key or returning more than four supplementary invoices). In every case, "Stripe defaults to standard functionality for the operation that caused the failure."

For your books, that means a failed run produces the invoice you would have had without the script. If your script normally splits usage onto its own invoice, a failure gives you one combined invoice for that cycle. If it normally defers an item, the item lands on this invoice instead.

You can see failures in three places. Each subscription and invoice has an Extension runs tab under Activity. Workbench lists every run with its inputs and outputs. And Stripe emails the account when a billing script fails, at most once per extension per UTC calendar day, with the v2.extend.extension_run.failed event available for real-time alerts. If one cycle's invoice count doesn't match the pattern you expect, check those runs before you change anything in QuickBooks.

What each pattern means in QuickBooks

The common thread: a script changes which invoices exist and what sits on each one. The QuickBooks file follows the invoices, so it changes with them.

Split invoices: more documents, same revenue

Take Stripe's own example. A customer on a 20 USD licensed plan uses 15 USD of metered API calls.

Without the scriptWith Separate invoice for metered items
Invoices in Stripe1 for 35 USD2: 20 USD (latest invoice) and 15 USD
Invoices in QuickBooks12
Payments to apply12
Revenue for the cycle35 USD35 USD

Revenue doesn't change. The paperwork does, in four ways:

  1. Two payments, two processing fees. Each invoice is collected on its own, so each one carries its own fee. On a card rate of 2.9% + 30¢, one 35 USD charge costs 1.32 USD. A 20 USD and a 15 USD charge cost 0.88 USD and 0.74 USD, 1.62 USD together. The extra fixed fee is small per customer and adds up across a large base.
  2. Two items to chase in A/R. One invoice can be paid while the other fails. Your A/R aging will show a partly paid cycle that was never possible before.
  3. Subscription status may follow both invoices. Stripe's subscription settings decide whether only the latest invoice sets the status or all of them do. With "All invoices," Stripe says the subscription moves to past_due after an update "and stays in that state until all the invoices created from the update have been paid." Collections and A/R follow the same rule, so pick it on purpose.
  4. Usage reconciles on its own. That is usually why finance teams want the split. Usage revenue gets its own invoice and its own payment, which makes metered income easy to tie out against the meter.

If none of your groups sets the latest invoice, Stripe creates an empty invoice to hold that role. It has nothing on it, so there is nothing to record, and Acodei's Invoice Sync skips invoices with nothing on them.

Deferred items: billed later, earned now

A deferred item has a real amount and a service period, but no invoice yet. Until it lands on a finalized invoice, it isn't in QuickBooks at all. Acodei's Invoice Sync creates the QuickBooks invoice when Stripe finalizes one, so the item arrives with the invoice it lands on.

That is harmless when the item lands on next month's invoice and the amounts are small. It matters at month end on an accrual basis when the amounts are not small. A 400 USD onboarding fee for work delivered in March, held back to a manual invoice in April, is March revenue sitting outside your March books.

Two things keep this under control:

  • List pending items at close. Pending invoice items are visible on the customer in Stripe and through the API. Total the ones whose service period falls in the month you're closing.
  • Book an accrual if the total is material. Debit an unbilled receivables account and credit revenue at month end, then reverse it when the invoice lands. Smaller teams on cash basis can skip this, since cash-basis revenue follows payment anyway.

Our guide to pending_invoice_item_interval covers the opposite tool: billing pending items sooner, on their own schedule, instead of later.

Skipped items: nothing to record

When beforeItemCreation skips a proration, the customer is never billed for it and never credited. There is nothing to record in QuickBooks, and nothing is wrong. The decision was made in Stripe.

The risk is in the checks you run outside Stripe. If anyone on your team reconciles Stripe invoices against expected prorations from your app or CRM, skipped items will show up as differences. Write the rule down where the person doing the reconciliation can find it: which products carry the metadata, and that partial-period prorations on them are skipped on purpose.

Our guide to adding seats and proration_behavior covers the subscription-level setting that a script overrides line by line.

Credits that end up alone

groupItems can put a proration credit on a different invoice from the charges it offsets. A group made only of credits produces an invoice that totals below zero. Stripe's own grouping example keeps a proration credit together with a metered charge, and that is the safer pattern. If your script can produce a credit-only group, test what it produces end to end in a sandbox before you activate it in live mode.

How Acodei's Invoice Sync handles the invoices a script creates

Invoice Sync works from the invoices Stripe produces, so it follows whatever pattern your script creates.

  • One QuickBooks invoice per finalized Stripe invoice. Invoice Sync is one-way. When a Stripe invoice is finalized, Acodei creates a QuickBooks Invoice that reproduces its line items, and tax lines as your mapping settings allow. A cycle split into two invoices, each with something to bill, becomes two QuickBooks invoices.
  • Payments apply to the right invoice. When a Stripe invoice is paid, Acodei creates the payment and applies it to that invoice. This needs QuickBooks' Automatic Application setting turned on.
  • Mapping works per line. Each invoice line uses the product returned by Multiple Product Mapping if you have it enabled, or the default product if not. A usage line maps the same way whether it lands on the main invoice or a supplementary one.
  • Empty invoices are skipped. An invoice with nothing on it, like the empty latest invoice described above, doesn't reach QuickBooks.

A checklist before you activate an item handling script

  1. Check billing mode. List which subscriptions are in flexible billing mode. Only those, plus pricing plan and license fee subscriptions, are affected.
  2. Tag the products. If the script uses metadata, add the key to every product it should touch, and to no others. Keys must match exactly.
  3. Choose the status rule. Decide whether only the latest invoice or every invoice sets subscription status, before splitting anything.
  4. Run a full cycle in a sandbox. Include an upgrade, a downgrade, a cancellation and a Checkout signup. Count the invoices each one produces.
  5. Don't trust the preview. The upcoming invoice preview won't show a groupItems split. Compare against real invoices.
  6. Plan for deferred items at close. If filterItems holds anything back, add "total pending invoice items" to your month-end checklist.
  7. Set up failure alerts. Make sure someone receives the extension run failure email, or subscribe to the failure event.

Frequently asked questions

What is a Stripe item handling script?

It is a billing script that controls how a subscription's charges become invoices. It has three methods: beforeItemCreation decides whether each item is created at all, filterItems decides which items go on this invoice and defers the rest, and groupItems splits items across several invoices. Stripe has written three ready-made scripts, and you can write your own in TypeScript.

Can Stripe put metered usage on a separate invoice from the subscription fee?

Yes. Stripe's Separate invoice for metered items script routes metered items to their own invoice, and the licensed items' invoice becomes the subscription's latest invoice. A 20 USD plan with 15 USD of usage becomes two invoices instead of one 35 USD invoice. In QuickBooks that means two invoices and two payments for the same 35 USD of revenue.

Can I turn off prorations for only some products in Stripe?

Yes, with a script in flexible billing mode. Stripe's Skip creating a partial period proration item script skips partial-period proration items for products that carry a metadata key and value you choose. Prorations with a whole-number factor are still invoiced, and other products are prorated as usual.

Why does the Stripe upcoming invoice preview not match the invoices I get?

If an item handling script splits invoices, the preview won't show it, because Stripe says groupItems doesn't run for preview invoices. The preview shows the items together on one invoice. The actual cycle creates the separate invoices your script defines.

What happens if my Stripe item handling script fails?

Stripe uses its standard behavior for that operation. A run fails if it takes longer than 500 milliseconds, throws an error or returns an invalid result. You get the invoice you would have had without the script, so a cycle that is normally split may arrive as one invoice. Check the Extension runs tab on the subscription.

Does a deferred Stripe invoice item show up in QuickBooks?

Not until it lands on an invoice. A pending invoice item has an amount but no invoice, so there is nothing to record until the invoice that includes it is finalized. If you close on an accrual basis and the deferred amount is material, accrue it as unbilled revenue at month end.

The short version

Stripe's item handling scripts decide whether subscription items are created, which invoice they go on, and how many invoices a cycle produces. Stripe ships three: separate invoices for metered usage, skipped partial-period prorations for chosen products, and no zero-quantity usage lines. You can also write your own. They only touch subscriptions in flexible billing mode, run account-wide, don't split Checkout's first invoice or previews, and fall back to Stripe's default on failure. In QuickBooks, a split cycle means more invoices and more payments for the same revenue, a deferred item is unbilled revenue until it lands, and a skipped item is simply never billed. See also our guides to adding seats and proration behavior, billing pending items between renewals, Stripe usage billing and price changes, and the Stripe proration and billing meter glossary entries. Start a free trial to see how Acodei brings your Stripe invoices into QuickBooks.

Share

Automate your Stripe to QuickBooks sync

Save hours every month. Acodei automatically syncs your Stripe transactions, invoices, and payouts to QuickBooks Online.

14-day free trial · card required · cancel anytime

How Acodei handles this in your stack

Stripe QuickBooks Integration

See how Acodei syncs Stripe payments, fees, refunds, invoices, and payouts into QuickBooks Online automatically.

Or go straight to a capability

Get more operational finance guides like this one

We will only send high-value product and finance content.