To batch upload tax forms via API without losing pages, send each document as its own request or one combined PDF, record every file and page count in a manifest before you upload, and match each returned form back to its pages. When part of the batch fails, retry only the failed files, then total the results.
Should you batch upload tax forms via API as one file or many?
A batch upload of tax forms via API can go in as one combined PDF or as one request per document. One request per document is easier to track and retry. One combined file is what people often hand you, and it only works when the API classifies each page and splits the file into separate forms.
The choice usually follows the source. A payroll portal export, a broker download or a phone photo arrives as its own file, so sending it as its own request costs nothing extra. A client who scanned a shoebox of paper into a single 40-page PDF has already merged everything, and splitting it by hand defeats the point of automating.
Separate requests have three practical advantages. Each file gets its own job ID, so a failure touches one document, not the whole set. Your retry logic can resend one small file instead of a large one. And your records line up naturally: one upload, one row, one result.
A combined file has one advantage, and it matters: nobody has to sort the paper first. The service does the sorting by reading each page. That shifts the work from a person to the classifier, which is fine as long as you keep a record of what went in so you can check what came out.
Many teams end up with a mix. Files that arrive separately go up separately, and scanned bundles go up whole. The manifest described later in this post handles both, because it tracks pages, not just files.
Request size is the last factor. Some APIs cap the size or page count of a single upload, and a large bundle can take long enough that you will want to receive the result by webhook rather than wait. The post on async document processing API webhook patterns covers that side, and its section on idempotent file upload API calls and duplicate webhooks explains how to make retries safe.
Splitting mixed PDFs with a document classification API
A document classification API splits a mixed PDF by reading each page and deciding which form it belongs to and for which tax year. Pages that share a form type, year and issuer are grouped into one document. A packet holding two W-2s, a 1099-INT and a 1098 comes back as four separate forms, each with its own fields.
Classification has to answer two questions per page. The first is the form type: a W-2, a 1099-NEC, a 1099-DIV, a page of 1099-B transactions. The second is the tax year, since a client packet can hold last year's 1098 next to this year's. Getting the year wrong is as costly as getting the type wrong, because the box layout and labels change between revisions.
Boundaries are the harder part. A brokerage statement may run eight pages, and pages two through eight carry no form title at all. The classifier has to decide that those pages continue the statement rather than start something new. Two W-2s from the same employer, one for each of two employees, look almost identical and still need to come back as two documents.
How a model reads the title, layout and box labels to make these calls is covered in the tax form OCR category. For a batch pipeline, what matters is the output: for each detected form, the page range it came from, the type, the year and a status.
Schema Tax classifies every page by form type and tax year even when one PDF mixes several forms, then reads each form into its own schema with fixed field names. Its supported list is W-2, 1099-NEC, 1099-MISC, 1099-INT, 1099-DIV, 1099-B, 1098, 1040 and K-1, all listed in the supported forms section of the homepage. With any service, plan for pages outside its supported list: record them as unrecognized, and have your manifest treat each one as a gap to review, not a silent drop.
Tracking every page when you batch upload tax forms
Tracking every page in a tax form batch upload means writing down what you sent before you send it. A manifest lists each file, its page count, and later the form, tax year and status the API reported for each page range. When the pages in equal the pages out, nothing was lost.
Build the manifest at the moment of upload. Count pages from the file itself, not from what the user says. Give each file an ID of your own and send it with the request if the API accepts one, so the result can be matched without guessing from file names.
When results arrive, add one row per detected form. A combined file that contained four forms becomes four rows sharing one file ID, each with its page range. A file that contained one form stays one row.
A sample batch manifest
The table below is an example. The file names, page counts and results are fictional and show the kinds of outcomes a batch can produce.
| File | Pages | Detected form | Tax year | Status |
|---|---|---|---|---|
| rivera-packet.pdf | 1 | W-2 | 2026 | Done |
| rivera-packet.pdf | 2 | W-2 | 2026 | Done |
| rivera-packet.pdf | 3 | 1099-INT | 2026 | Flagged for review |
| rivera-packet.pdf | 4-5 | 1098 | 2026 | Done |
| studio-1099.jpg | 1 | 1099-NEC | 2026 | Done |
| broker-statement.pdf | 1-9 | 1099-B | 2026 | Done |
| old-scan.pdf | 1-2 | (none) | (none) | Failed: unreadable |
| misc-page.pdf | 1 | Unrecognized | 2025 | Needs a person |
Two checks fall out of this table. First, the page ranges for each file should cover every page exactly once; rivera-packet.pdf has five pages and rows covering 1, 2, 3 and 4-5. Second, every row needs a terminal status. A row still marked as processing after a long wait is a job to poll, not a result.
Keep the manifest even after the batch is done. It is the record that answers the question "did we get the second W-2?" months later.
The manifest should not hold full identifiers. If the API returns a recipient TIN, store it as returned, which is often masked. The post on what a masked SSN in API responses gives you explains how to match people to forms with only the last four digits.
What happens when part of a tax form batch upload fails?
A tax form batch upload partly fails when some files succeed and others do not: an unreadable scan, a password-protected PDF, a timeout or a rate limit. Treat each file as its own unit. Keep the successful results, mark the failed rows, fix what can be fixed, and resend only those files.
Failures come in two kinds, and they need different handling. A transient failure, such as a timeout or a server error, will likely succeed on a retry with the same file. A permanent failure, such as an image too blurred to read or a file type the service does not accept, will fail again until a person replaces the file.
Your manifest tells you which is which if you store the error with the row. Retry transient failures automatically with a delay that grows between attempts. Route permanent failures to a person with a message they can act on, such as "rescan page 2 at a higher resolution", not just "error".
Retries need idempotency. If a request timed out after the server received the file, a blind resend may create a second job and a second charge for the same pages. Send the same idempotency key on each retry of one file, if the API supports one, so the service recognizes the repeat.
Partial results inside one file are a third case. A combined PDF may come back with three forms read and one page flagged as uncertain or unrecognized. That is not a failure of the file. It is a row in the manifest that needs review, and the rest of the file's results stand.
Do not hold the whole batch until every row is green. Users and downstream systems can work with the forms that are done while the stragglers are fixed. The tax preparers category covers how firms run this kind of batch for client packets without writing code.
Rolling a batch of tax forms into one total
Rolling a batch of tax forms into one total means adding the same kind of value across every form in the batch, using fixed field names rather than box numbers. Box 1 means wages on a W-2 and interest on a 1099-INT, so a total built on box numbers mixes unlike amounts.
Field names solve this. In the IRS General Instructions for Forms W-2 and W-3, Box 1 is "Wages, tips, other compensation." In the IRS Instructions for Forms 1099-MISC and 1099-NEC, Box 1a on the 1099-NEC is "Nonemployee Compensation." In the IRS Instructions for Form 1099-INT, Box 1 on the 1099-INT is "Interest Income." Three different meanings, two of them under the same box number.
An example total
Here is a fictional batch rolled up by field. The amounts and the field names are examples only, not a published schema.
| Form | Count | Example field name | Total |
|---|---|---|---|
| W-2 | 2 | wages | $84,250.00 |
| 1099-NEC | 1 | nonemployee_compensation | $6,400.00 |
| 1099-INT | 1 | interest_income | $312.18 |
| 1098 | 1 | mortgage_interest | $9,870.44 |
Each total stays in its own line. Whether and how any of these amounts belong on a return is a question for the taxpayer, a preparer or tax software; the batch only puts the numbers in one place.
Watch for duplicates before you add. A corrected form and its original can both land in a batch, and so can the same W-2 uploaded from a portal and from a photo. A duplicate check on form type, tax year, issuer TIN and the main amount catches most of them, and the manifest shows which pages each came from.
A flagged value should block its total, not quietly enter it. If the 1099-INT row is still marked for review, the interest total is provisional until a person confirms the box.
Schema Tax turns a folder of mixed forms from mixed sources into one spreadsheet with a total; batch upload is part of the Starter plan and consolidated spreadsheets are part of Professional. If the batch feeds an app rather than a spreadsheet, the post on tax document upload for fintech apps covers the screens a user sees while it runs.