> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vinmake.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Chart of Accounts

> Manage GL accounts and posting mappings

# Chart of Accounts

The Chart of Accounts (COA) is the backbone of the Finindex General Ledger. Each account has a code, a name, a type, and a currency. **Mappings** connect Cutmake business events (bills, invoices, payments) to the GL accounts they post to, so that postings flow automatically from PLM/MES into the ledger.

## List Accounts

```bash theme={null}
GET /api/v1/gl/accounts
Authorization: Bearer <access_token>
```

**Response (200):**

```json theme={null}
[
  {
    "id": "uuid",
    "code": "1000",
    "name": "Cash",
    "type": "asset",
    "currency": "VND"
  }
]
```

## Create Account

<ParamField body="code" type="string" required>
  Unique account code (e.g. "1000")
</ParamField>

<ParamField body="name" type="string" required>
  Account name (e.g. "Cash")
</ParamField>

<ParamField body="type" type="string" required>
  Account type: `asset`, `liability`, `equity`, `revenue`, `expense`
</ParamField>

<ParamField body="currency" type="string">
  ISO currency code (default: VND)
</ParamField>

```bash theme={null}
POST /api/v1/gl/accounts
Authorization: Bearer <access_token>

{
  "code": "1000",
  "name": "Cash",
  "type": "asset",
  "currency": "VND"
}
```

**Response (201):**

```json theme={null}
{
  "id": "uuid",
  "code": "1000",
  "name": "Cash",
  "type": "asset",
  "currency": "VND"
}
```

## Mappings

Mappings tell Finindex which GL account a given business event posts to — for example, which account a vendor bill debits, or which account a customer receipt credits. This is what lets postings flow automatically from Cutmake [procurement](/cutmake/staging/index) and sales into the ledger.

### List Mappings

```bash theme={null}
GET /api/v1/gl/mappings
Authorization: Bearer <access_token>
```

**Response (200):**

```json theme={null}
[
  {
    "id": "uuid",
    "event": "bill.posted",
    "debit_account_code": "5100",
    "credit_account_code": "2000"
  }
]
```

### Create Mapping

<ParamField body="event" type="string" required>
  The business event key (e.g. `bill.posted`, `invoice.posted`, `payment.posted`)
</ParamField>

<ParamField body="debit_account_code" type="string" required>
  Account code to debit when the event fires
</ParamField>

<ParamField body="credit_account_code" type="string" required>
  Account code to credit when the event fires
</ParamField>

```bash theme={null}
POST /api/v1/gl/mappings
Authorization: Bearer <access_token>

{
  "event": "bill.posted",
  "debit_account_code": "5100",
  "credit_account_code": "2000"
}
```

<Tip>
  Define mappings before posting bills or invoices so events resolve to the correct accounts on the first run.
</Tip>

<Info>
  See the **API Reference** tab for the full list of GL endpoints, including recurring templates and statement lines.
</Info>
