# Enrich a Trial Balance With Auto-Renumber + Classification

> Prepares trial balance rows for use. Pass the tbrows, and the coarows if you have them so each account's type can be looked up. Each row comes back with…

POST /api/v1/skills/enrich.tb.rows/invoke

Prepares trial balance rows for use. Pass the `tb_rows`, and the `coa_rows` if you have them so each account's type can be looked up. Each row comes back with a `classification`, its `original_code`, any `auto_assigned_code` and a `drop_reason`; accounts without a code are numbered by account type and zero-balance rows are dropped.

Body parameters

tb_rows array of objects

Trial balance rows to enrich, each with code, name, section, debit and credit (amounts as numbers).

coa_rows array of objects

Chart of accounts rows used to look up each account's type, each with account_id, code, name, type and balance.

Returns

Skill executed successfully

skill string Required

Example enrich_tb_rows

output object Required

Envelope for `enrich_tb_rows` output — same dict shape as input rows with added `classification` / `original_code` / `auto_assigned_code` / `drop_reason` keys.

output.stub_fields array of strings

output.warnings array of strings

output.rows array of objects

correlation_id string Required

Errors

Status Type When

401 AUTH.TOKEN_INVALID Authentication required

403 PERMISSION.CAPABILITY_DENIED Insufficient permissions

404 SKILL.NOT_FOUND Skill not found

422 VALIDATION.INVALID_FORMAT Validation error

429 RATE_LIMIT.USER Rate limit exceeded

5XX INTERNAL.UNKNOWN Internal server error

[Previous ← Surface Trial-Balance Rows That Share an ``account_number``](https://heyarchie.com/en-gb/developers/api-reference/utility/surface-trial-balance-rows-that-share-an-account-number/)[Next Fetch Meeting Record →](https://heyarchie.com/en-gb/developers/api-reference/utility/fetch-meeting-record/)

```
curl https://uk.heyarchie.com/api/v1/skills/enrich.tb.rows/invoke \
  -X POST \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{
       "tb_rows": [
         {}
       ],
       "coa_rows": [
         {}
       ]
     }'
```

```
from heyarchie import Archie
archie = Archie(api_key="sk_...")
result = archie.skills.invoke(
    "enrich.tb.rows",
    tb_rows=[{}],
    coa_rows=[{}],
)
print(result)
```

```
import { Archie } from "heyarchie";

const archie = new Archie({ apiKey: "sk_..." });
const result = await archie.skills.invoke("enrich.tb.rows", {
  "tb_rows": [
    {}
  ],
  "coa_rows": [
    {}
  ]
});
console.log(result);
```

Response

```
{
  "skill": "enrich_tb_rows",
  "output": {
    "rows": [
      {
        "classification": "ok",
        "code": "1200",
        "credit": 0,
        "debit": 96250,
        "drop_reason": null,
        "name": "Bank current account",
        "original_code": "1200",
        "section": "Assets"
      },
      {
        "auto_assigned_code": "1500",
        "classification": "auto_renumbered",
        "code": "1500",
        "credit": 0,
        "debit": 4800,
        "drop_reason": null,
        "name": "Office equipment",
        "original_code": "",
        "section": "Assets"
      },
      {
        "classification": "dropped",
        "code": "2900",
        "credit": 0,
        "debit": 0,
        "drop_reason": "zero_balance",
        "name": "Old suspense",
        "original_code": "2900",
        "section": "Liabilities"
      }
    ]
  },
  "correlation_id": "<string>"
}
```

```
{
  "error": {
    "type": "<string>",
    "code": "<string>",
    "message": "<string>",
    "param": "<string>",
    "retry_after_seconds": "<integer>"
  }
}
```

Every response also carries X-Request-ID. Quote it if you write to us about a call.
