Accountflow Developer prod

Correcting data

Fix or remove what you pushed. Data in use is never deleted.

Every change and deletion keeps the previous version in history, stamped with the datasetId of the import that made it.

To Do
Change a line's values Re-send it with the same id (import again)
Remove a line or an opening-balance row Delete it by id
Remove an account, dimension value or sub-ledger Delete it, only while nothing uses it
Retire an account that has history Import it with hidden: true
Retire an open item Re-send it with sourceDeleted: true, or send a snapshot without it

Re-send to fix

Imports merge by identity: lines and opening balances by id, accounts by accountCode, dimension values by key, sub-ledger parties by partyKey. Re-send the corrected row through the same import and it is updated in place.

Delete lines and opening-balance rows

curl -s -X POST \
  https://api.prod.accountflow.com/v1/companies/$COMPANY/imports/general-ledger-lines/deletions \
  -H "Authorization: Bearer $TOKEN" -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{ "year": 2025, "ids": ["INV-2025-000123-1", "INV-2025-000123-2"] }'

When it has SUCCEEDED:

Data in use is never deleted

If any id in the request is in use in Accountflow, nothing is deleted:

{
  "type": "https://api.accountflow.com/errors/conflict",
  "status": 409,
  "error": "conflict",
  "reason": "lines_in_use",
  "detail": "1 line(s) are in use and nothing was deleted: remove the dependent work in the application first, or post a reversing line instead",
  "inUse": [
    { "id": "INV-2025-000123-2", "dependencies": ["match", "comment"] }
  ]
}
reason In use when
lines_in_use A line is matched, reconciled against the bank, commented, flagged, part of an accrual, tied to an asset, or allocated in payroll.
opening_balances_in_use A row is split, itemised into open items, matched or commented.
account_in_use The account has lines, opening balances, matches, reconciliations, adjustments, documents, access rules or payroll mappings.
dimension_in_use A line or opening balance has ever referenced the value, or it has child values.
sub_ledger_in_use A line, open item or opening balance has ever referenced it, or it has children.

On a 409:

  1. Remove the dependent work in Accountflow (undo the match, delete the comment), then delete again; or
  2. post a reversing line, usually the right answer for a reconciled period; or
  3. for an account, import it with hidden: true.

The check runs when you send the request. If someone starts work on a line before the job runs, the import ends FAILED with the same failureReason and the inUse list under result, and nothing is deleted. inUse names only the ids you sent. A correction can also end FAILED with internal_error or job_expired (not picked up within 30 minutes); re-send it.

Delete an account, dimension value or sub-ledger

curl -s -X DELETE "https://api.prod.accountflow.com/v1/companies/$COMPANY/accounts/9000?year=2025" \
  -H "Authorization: Bearer $TOKEN" -H "Idempotency-Key: $(uuidgen)"
curl -s -X DELETE https://api.prod.accountflow.com/v1/companies/$COMPANY/dimensions/DEPT-99 \
  -H "Authorization: Bearer $TOKEN" -H "Idempotency-Key: $(uuidgen)"
curl -s -X DELETE https://api.prod.accountflow.com/v1/companies/$COMPANY/sub-ledgers/C-9999 \
  -H "Authorization: Bearer $TOKEN" -H "Idempotency-Key: $(uuidgen)"

Not available