> For the complete documentation index, see [llms.txt](https://docs.senmo.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.senmo.io/segment-ledger/data-models.md).

# Data Models

### Ledgers

```json
{
  "id": "ledger_123",
  "name": "Main Ledger",
  "api_key": "******",
  "metadata": {
    "project_features": "sepa, cards",
    "project_type": "personal, business",
    "status": "active"
  },
  "created_at": "2026-04-16T10:00:00Z",
  "updated_at": "2026-04-16T10:00:00Z"
}
```

#### Ledger metadata

The `metadata` an object can be used for custom business classification and configuration.

**Example:**

```json
{
  "metadata": {
    "project_features": "sepa, cards",
    "project_type": "personal, business",
    "status": "active"
  }
}
```

**Recommended usage:**

* project\_features: comma-separated or structured list of supported capabilities
* project\_type: business classification such as personal, business, enterprise
* status: lifecycle state such as active, disabled, pending

### Account

```json
{
  "id": "ledger_123",
  "name": "Main Ledger",
  "api_key": "******",
  "metadata": {
    "project_features": "sepa, cards",
    "project_type": "personal, business",
    "status": "active"
  },
  "created_at": "2026-04-16T10:00:00Z",
  "updated_at": "2026-04-16T10:00:00Z"
}
```

### Transaction

```json
{
  "id": "txn_123",
  "ledger_id": "ledger_123",
  "account_id": "account_123",
  "amount": 2500,
  "description": "Card settlement",
  "type": "TRANSFER",
  "status": "PENDING",
  "metadata": {
    "provider": "letknow",
    "reference": "ABC123"
  },
  "created_at": "2026-04-16T10:00:00Z",
  "updated_at": "2026-04-16T10:00:00Z"
}
```

**Allowed transaction types:**

* `TRANSFER`
* `ISSUE`
* `RETIRE`

**Allowed transaction statuses:**

* `PENDING`
* `INFLIGHT`
* `COMPLETED`
* `REJECTED`
* `VOID`

**Allowed status transitions:**

* `PENDING` → `INFLIGHT`, `COMPLETED`, `REJECTED`, `VOID`
* `INFLIGHT` → `COMPLETED`, `REJECTED`, `VOID`
* `COMPLETED` → no further transitions
* `REJECTED` → no further transitions
* `VOID` → no further transitions
