# Surface Trial-Balance Rows That Share an ``account_number``

> Scans the trial balance rows you supply and returns those that share an account code with another row that has a balance. Each returned row carries…

POST /api/v1/skills/detect.tb.duplicates/invoke

Scans the trial balance `rows` you supply and returns those that share an account code with another row that has a balance. Each returned row carries `conflict_codes` and `conflict_count`. Zero-balance rows are ignored, so a dormant account never flags a live one.

Body parameters

rows array of objects

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

Returns

Skill executed successfully

skill string Required

Example detect_tb_duplicates

output object Required

Envelope for `detect_tb_duplicates` output — the conflict subset with `conflict_codes` + `conflict_count` added per row.

output.stub_fields array of strings

output.warnings array of strings

output.duplicates 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 ← Derive Canonical Period Bounds + Matching Prior-Period Bounds](https://heyarchie.com/en-gb/developers/api-reference/utility/derive-canonical-period-bounds-matching-prior-period-bounds/)[Next Enrich a Trial Balance With Auto-Renumber + Classification →](https://heyarchie.com/en-gb/developers/api-reference/utility/enrich-a-trial-balance-with-auto-renumber-classification/)

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

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

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

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

Response

```
{
  "skill": "detect_tb_duplicates",
  "output": {
    "duplicates": [
      {
        "code": "4000",
        "conflict_codes": [
          "4000"
        ],
        "conflict_count": 2,
        "credit": 125000,
        "debit": 0,
        "name": "Sales",
        "section": "Revenue"
      },
      {
        "code": "4000",
        "conflict_codes": [
          "4000"
        ],
        "conflict_count": 2,
        "credit": 18400,
        "debit": 0,
        "name": "Sales - online",
        "section": "Revenue"
      }
    ]
  },
  "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.
