---
title: "Build a draft QuickBooks import batch (#2642)"
method: POST
path: "/accountant/companies/{customerId}/integrations/quickbooks/import-batches"
tags: ["Accountants"]
---

# Build a draft QuickBooks import batch (#2642)

`POST /accountant/companies/{customerId}/integrations/quickbooks/import-batches`

## Request

- Base URL: `https://api.medianfi.com/api/v1`
- URL: `https://api.medianfi.com/api/v1/accountant/companies/{customerId}/integrations/quickbooks/import-batches`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

`opening_balance`: one balanced brought-forward entry at the cutoff from a trial balance snapshot as of the day before the cutoff; after the opening is posted, a later snapshot builds a true-up that posts only the per-account difference. `activity`: every postable QuickBooks object from the latest completed read dated from the cutoff through `dateTo` (default today) that is not already posted, each with a default decision (post, duplicate of a native bank row, skip, or blocked with a reason). Nothing posts until the batch is approved and posted.

## Request body

- union
  - object
    - `kind` 'opening_balance', required
    - `trialBalanceSnapshotId` string, uuid, required
  - object
    - `kind` 'activity', required
    - `dateTo` string, date

## Response `201`

The draft batch

- object
  - `success` true, required
  - `data` QuickBooksImportBatch, required
    - `id` string, uuid, required
    - `companyId` string, uuid, required
    - `entityId` string, uuid, required
    - `connectionId` string, uuid, required
    - `realmId` string, required
    - `kind` 'opening_balance' | 'activity', required
    - `cutoffId` string, uuid, required
    - `sourceRunId` string, uuid, nullable, required
    - `trialBalanceSnapshotId` string, uuid, nullable, required
    - `trueUpOfBatchId` string, uuid, nullable, required
    - `dateFrom` string, date, required
    - `dateTo` string, date, required
    - `status` 'draft' | 'approved' | 'posting' | 'posted' | 'failed' | 'cancelled', required
    - `manifestSha256` string, nullable, required
    - `preparedByUserId` string, uuid, required
    - `approvedByUserId` string, uuid, nullable, required
    - `approvedAt` string, date-time, nullable, required
    - `postedByUserId` string, uuid, nullable, required
    - `postedAt` string, date-time, nullable, required
    - `cancelledByUserId` string, uuid, nullable, required
    - `cancelledAt` string, date-time, nullable, required
    - `errorCode` string, nullable, required
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required

## Other responses

- `401`: Authentication required
- `403`: Insufficient permissions or not a company member
- `404`: Resource not found
- `422`: Validation error, no cutoff, no completed QuickBooks read, wrong trial balance date, nothing to import, or too many objects

---

[API](https://skmtc.dev/medianfi/apis/median-api.md) · [All operations](https://skmtc.dev/medianfi/apis/median-api/llms.txt) · [OpenAPI document](https://skmtc.dev/medianfi/apis/median-api/revisions/20090ea32b0d?raw)
