# 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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.senmo.io/segment-ledger/data-models.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
