---
name: siigo-chart-of-accounts-import
description: Imports the chart of accounts exported from Siigo Nube into the Siigo chart of accounts record type so posting skills can look up account codes. Use after creating the table from the Siigo integration or whenever accounts change.
license: Apache-2.0
metadata:
  adlass.categories: "finance-accounting/closing-reporting, data-tables/export-sync"
  adlass.industries: "accounting-firms"
  adlass.tags: "siigo,chart-of-accounts,cuentas-contables,records,import,colombia"
  adlass.adaptation: "mapping"
  adlass.source: "original"
  adlass.version: "1"
---

# Siigo chart of accounts import

## Purpose

Siigo Nube does not expose the chart of accounts through its API, but posting a receipt or a journal entry needs the exact eight-digit account codes. This skill takes the Excel export from Siigo (Contabilidad → Cuentas contables → Exportar) and loads every account into the `siigo_cuentas` record type, so that a posting agent can search the codes instead of guessing them.

## Scope

The export contains one row per account from the one-digit class down to the eight-digit transactional accounts, with the columns Código, Nombre, Categoría, Clase, Relación con, Maneja vencimientos, Diferencia fiscal, Activo and Nivel agrupación. All levels are loaded, because the hierarchy explains what a code means; only eight-digit codes are postable and the posting skill filters on that.

**Excluded:** editing accounts in Siigo, creating accounts that are missing from the export, and interpreting tax settings.

## Data basis

- The Siigo Excel export uploaded as a document; the parser skips the three title rows and uses the header row.
- The `siigo_cuentas` record type created from the Siigo integration page, with fields codigo, nombre, categoria, clase, relacion_con, maneja_vencimientos, diferencia_fiscal, activo and nivel_agrupacion.

## Result

A complete `siigo_cuentas` table that mirrors the export, and a memo with the counters (created, updated, deleted, unchanged), the number of eight-digit accounts and any rows that failed.

## Quality criteria

- The number of loaded records equals the number of account rows in the export.
- Every codigo is unique and stored as text so leading zeros survive.
- Accounts removed in Siigo disappear from the records because the run uses mode sync.
- The value of maneja_vencimientos is kept verbatim; posting skills rely on it to know when an invoice reference (due) is mandatory.

## Instructions

Use list_tables and describe_table to confirm that the export was parsed with the expected columns; the column names are the normalized headers of the sheet. Check the `siigo_cuentas` fields with describe_record_type. Then run a query of the form `SELECT codigo, nombre, categoria, clase, relacion_con, maneja_vencimientos, diferencia_fiscal, activo, nivel_agrupacion FROM <table>` with the real table key, adjusting aliases if the parser named a column differently, and filter out rows whose codigo is empty. Cast codigo to text if the parser detected it as a number. Call sync_records_from_query with keyField codigo, mode sync and dryRun true; compare the created and deleted counters against the row count of the sheet. When the preview looks right, run it for real. Finally count the eight-digit codes with a query and mention in the memo how many accounts carry "Con vencimiento" in maneja_vencimientos (cartera or proveedores accounts), since those need a due reference when posted.

## Adapt before use

- Create the Siigo chart of accounts table from the Siigo credential card and add it to the skill scope.
- Upload the current export from Siigo Nube as the spreadsheet input on every run.
- Keep mode sync unless partial exports are uploaded on purpose.
