Accountants

Prepare a draft batch that creates one Median account in a new or established QuickBooks file (#3605)

Changed on

Builds ONE draft write-back batch holding a single pending create_account item (purpose single_account_create) for the named Median account, after the same judgement as the GET preview. Unlike the chart push it runs in an established QuickBooks file. Nothing is sent: the batch is approved and posted through the write-back batch routes with its manifestSha256; the created account is read back and then recorded as the QuickBooks account mapping of the Median account. A Bank or Credit Card mapping is recorded with cash source quickbooks, so a journal entry with a line on that account stays blocked (QUICKBOOKS_WRITEBACK_CASH_FROM_QUICKBOOKS_FEED) until the mapping is re-approved through account-mappings with cash source median. A Bank or Credit Card account is refused here, as in the preview, when its GL account cannot back its QuickBooks reconciliation account (BUSINESS_RULE_VIOLATION, the check verify runs before mapping). Before an approved single-account create is sent, posting repeats that Bank/Card check; a refusal leaves the batch approved and sends nothing. If the GL account or its bank row changes after that check or an earlier send and verify then refuses, QuickBooks already has the account: the item stays sent and the batch posting, which cannot be cancelled, and account-mappings refuses the same pair; fix the GL account or its bank row, then post the same batch again (QuickBooks is not sent a second create). 422 QUICKBOOKS_ACCOUNT_CREATE_NOT_FOUND, QUICKBOOKS_ACCOUNT_CREATE_REFUSED (reason in the problem; an account another batch holds is refused here), BUSINESS_RULE_VIOLATION (a Bank or Credit Card account, above), QUICKBOOKS_CHART_PUSH_NO_INVENTORY, QUICKBOOKS_CHART_PUSH_NEWER_READ_UNFINISHED while a newer QuickBooks read is queued, running or failed (newerRunStatus in the problem), QUICKBOOKS_WRITEBACK_NO_CUTOFF, QUICKBOOKS_LEDGER_NOT_CONNECTED. 409 QUICKBOOKS_WRITER_WINDOW_HELD while another QuickBooks write or read holds the company's writer window (retry), QUICKBOOKS_BATCH_AUTHORITY_CHANGED when the mappings or cutoff changed during preparation, QUICKBOOKS_WRITEBACK_ALREADY_HELD when a concurrent prepare took the account first.

post/accountant/companies/{customerId}/integrations/quickbooks/writebacks/account-create

Request

  • Base URL
    https://api.medianfi.com/api/v1
  • Auth
    • HTTP bearer
    • or API key in header X-API-Key

Path parameters

customerId, string uuid required

Request body

object required
glAccountId, string uuid required

Response

The draft batch with its one item

object required
success, true required
data, QuickBooksWritebackBatchDetail required

Changes

    • warning

      added the new create_correcting_journal_entry enum value to the data/items/items/kind response property for the response status

    • info

      added the required property data/items/items/reason to the response with the status

    • info

      endpoint added