---
title: "Prepare a draft batch that creates Median's chart of accounts in a new QuickBooks file (#2642)"
method: POST
path: "/accountant/companies/{customerId}/integrations/quickbooks/chart-push"
tags: ["Accountants"]
---

# Prepare a draft batch that creates Median's chart of accounts in a new QuickBooks file (#2642)

`POST /accountant/companies/{customerId}/integrations/quickbooks/chart-push`

## Request

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

Jacob 2026-09-28: for a client new to both Median and QuickBooks, Median's chart of accounts is mirrored into QuickBooks. Builds ONE draft write-back batch: a pending `create_account` item per Median account QuickBooks lacks (Name, AcctNum = Median code, AccountType/AccountSubType from the Median detail type; a sub-account's ParentRef is resolved from its parent's created QuickBooks Id at send time, so parents are created first), and a `blocked` item per account that is mapped instead (`QUICKBOOKS_CHART_PUSH_ALREADY_IN_QUICKBOOKS`; the mapping is recorded when the batch posts) or skipped (its reason code). Nothing is sent: the batch is approved and posted through the write-back batch routes, and each created account is read back and then recorded as a QuickBooks account mapping. Takes no body. 422 QUICKBOOKS_CHART_PUSH_ESTABLISHED_FILE when QuickBooks has transactions before the cutoff, QUICKBOOKS_CHART_PUSH_NO_INVENTORY before a completed QuickBooks read, QUICKBOOKS_CHART_PUSH_INVENTORY_UNVERIFIED when the latest completed read cannot be shown to hold every transaction (`unverifiedInventory` in the problem names the failed checks; posting an approved chart push re-applies the same rule and answers 409 with the same code), QUICKBOOKS_CHART_PUSH_NEWER_READ_UNFINISHED while a QuickBooks read started after that completed read is queued, running or failed (`newerRunStatus` in the problem; the preview still shows the file as `new` so it does not change during each read, and posting an approved chart push answers 409 with the same code until a newer read completes), QUICKBOOKS_CHART_PUSH_NOTHING_TO_CREATE when nothing is missing, QUICKBOOKS_WRITEBACK_NO_CUTOFF before a posting cutoff is set (only the preview runs without one); 409 when an account is already held by another batch.

## Request body

- object

## Response `201`

The draft batch with its items

- object
  - `success` true, required
  - `data` QuickBooksWritebackBatchDetail, required
    - `batch` QuickBooksWritebackBatch, required
      - `id` string, uuid, required
      - `companyId` string, uuid, required
      - `entityId` string, uuid, required
      - `connectionId` string, uuid, required
      - `realmId` string, required
      - `cutoffId` string, uuid, required
      - `dateFrom` string, date, nullable, required
      - `dateTo` string, date, nullable, required
      - `status` 'draft' | 'approved' | 'posting' | 'posted' | 'failed' | 'cancelled', required
      - `manifestSha256` string, required
      - `preparedByUserId` string, uuid, required
      - `preparedAt` string, date-time, required
      - `approvedByUserId` string, uuid, nullable, required
      - `approvedAt` string, date-time, nullable, required
      - `postedByUserId` string, uuid, nullable, required
      - `postingStartedAt` string, date-time, nullable, required
      - `postedAt` string, date-time, nullable, required
      - `cancelledByUserId` string, uuid, nullable, required
      - `cancelledAt` string, date-time, nullable, required
      - `errorCode` string, nullable, required
    - `items` QuickBooksWritebackItem[], required
      - `id` string, uuid, required
      - `batchId` string, uuid, required
      - `companyId` string, uuid
      - `kind` 'create_journal_entry' | 'sparse_update' | 'create_account' | 'create_transaction' | 'delete_transaction', required: create_transaction and delete_transaction are the automatic bank-feed push (#2642 phase 2)
      - `journalEntryId` string, uuid, nullable, required
      - `linkId` string, uuid, nullable, required
      - `glAccountId` string, uuid, nullable, required: The Median GL account a create_account (chart push) item creates, maps or skips; null for other kinds
      - `transactionId` string, uuid, nullable, required: The native bank-feed transaction a bank-feed push item (create_transaction, delete_transaction, or a sparse_update of a pushed object) concerns; null otherwise
      - `requestId` string, uuid, required: Intuit requestid idempotency key
      - `requestSha256` string, required
      - `payload` object, required: The exact QuickBooks request body (amounts as decimal strings; sent as JSON numbers)
      - `expected` object, required: What the read-back must show (or the block reasons of a blocked item)
      - `status` 'pending' | 'approved' | 'sending' | 'sent' | 'verified' | 'failed' | 'blocked' | 'cancelled', required
      - `blockCode` string, nullable, required
      - `qboObjectType` 'JournalEntry' | 'Purchase' | 'Deposit' | 'Account', required
      - `qboId` string, nullable, required
      - `qboSyncToken` string, nullable, required
      - `readbackSha256` string, nullable, required
      - `pushLinkId` string, uuid, nullable, required
      - `attempts` integer, required
      - `lastErrorCode` string, nullable, required
      - `preparedByUserId` string, uuid
      - `preparedAt` string, date-time
      - `approvedByUserId` string, uuid, nullable
      - `approvedAt` string, date-time, nullable
      - `sentAt` string, date-time, nullable
      - `verifiedAt` string, date-time, nullable

## Other responses

- `401`: Authentication required
- `403`: Insufficient permissions or not a company member
- `409`: An account is already held by another write-back batch (QUICKBOOKS_WRITEBACK_ALREADY_HELD)
- `422`: Established QuickBooks file, no completed QuickBooks read, nothing to create, no cutoff, or QuickBooks not connected

---

[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)
