---
title: "Retire Median's QuickBooks statement account for an account made inactive in QuickBooks (#3489)"
method: POST
path: "/accountant/companies/{customerId}/integrations/quickbooks/statement-accounts/{bankAccountId}/retire"
tags: ["Accountants"]
---

# Retire Median's QuickBooks statement account for an account made inactive in QuickBooks (#3489)

`POST /accountant/companies/{customerId}/integrations/quickbooks/statement-accounts/{bankAccountId}/retire`

## Request

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

Marks Median's own institution "QuickBooks" statement account (no provider, integration or external id) `disconnected`, requiring immutable creation-mapping provenance recorded when the materializer inserted the row. Unverified legacy or manual rows return 422 `QUICKBOOKS_STATEMENT_ACCOUNT_PROVENANCE_UNVERIFIED`; labels, timestamps and matching shape do not establish provenance, and this endpoint cannot recover it. The GL account can then be separately deactivated through `chart-of-accounts/{accountId}/deactivate`, subject to its guards, including posted lines in an open period even at zero net balance. Allowed only while every current mapping to that GL account is a QuickBooks Bank or Credit Card account that the latest completed read found inactive. The row and its reconciliations are kept; the change and the reason are audited with the actor (and, for the agent service token, its key) in the same transaction. A customer's bank connection, an already retired row, or an account still active in QuickBooks is refused (422). Median never reactivates the row; GET posting-setup reports `quickbooks_account_inactive` and `quickbooks_account_reactivated` instead.

## Request body

- object
  - `reason` string, required

## Response `200`

The statement account was retired

- object
  - `success` true, required
  - `data` object, required
    - `bankAccountId` string, uuid, required
    - `glAccountId` string, uuid, required
    - `qboAccountId` string, required
    - `status` 'disconnected', required

## Other responses

- `401`: Authentication required
- `403`: Insufficient permissions or not a company member
- `404`: No such bank account for this customer
- `422`: Validation error, QuickBooks not connected or not read yet, not Median's QuickBooks statement account (QUICKBOOKS_STATEMENT_ACCOUNT_NOT_RETIRABLE), or not mapped only to QuickBooks bank or card accounts read inactive (QUICKBOOKS_ACCOUNT_NOT_INACTIVE)

---

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