{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/immix/json-schema/immix-account-row-schema.json",
  "title": "AccountRow",
  "description": "An account as the API serves it: the `AccountUpdated` record plus the row extras (`globalSequence`; the deprecated `unscaled`, never present since 0.3.3) — the one shape its reads and its commands answer.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/immix-accounts-api-openapi.yml#/components/schemas/AccountRow",
  "type": "object",
  "properties": {
    "accountId": {
      "type": "integer",
      "description": "Sticky entity key."
    },
    "version": {
      "type": "string",
      "pattern": "^-?[0-9]+$",
      "description": "Monotonic per entity. int64 as a decimal JSON string"
    },
    "orgId": {
      "type": "integer",
      "description": "The owning org — stamped by the owner from the credential's org, never client-supplied."
    },
    "credentialId": {
      "type": "integer",
      "description": "The pipe this account is reached through."
    },
    "status": {
      "$ref": "#/$defs/AccountUpdatedStatus",
      "description": "UNKNOWN is the unset sentinel: outputs only — as input, omit the field instead; explicit UNKNOWN refuses 400. The value set is append-only: a consumer READING this field treats an unknown name as UNKNOWN, never as an error; as input an unknown name refuses 400 — the parse is strict"
    },
    "location": {
      "$ref": "#/$defs/AccountUpdatedLocation",
      "description": "UNKNOWN is the unset sentinel: outputs only — as input, omit the field instead; explicit UNKNOWN refuses 400. The value set is append-only: a consumer READING this field treats an unknown name as UNKNOWN, never as an error; as input an unknown name refuses 400 — the parse is strict"
    },
    "ownership": {
      "$ref": "#/$defs/AccountUpdatedOwnership",
      "description": "HOUSE only exercised in the POC. UNKNOWN is the unset sentinel: outputs only — as input, omit the field instead; explicit UNKNOWN refuses 400. The value set is append-only: a consumer READING this field treats an unknown name as UNKNOWN, never as an error; as input an unknown name refuses 400 — the parse is strict"
    },
    "purpose": {
      "$ref": "#/$defs/AccountUpdatedPurpose",
      "description": "UNKNOWN is the unset sentinel: outputs only — as input, omit the field instead; explicit UNKNOWN refuses 400. The value set is append-only: a consumer READING this field treats an unknown name as UNKNOWN, never as an error; as input an unknown name refuses 400 — the parse is strict"
    },
    "temperature": {
      "$ref": "#/$defs/AccountUpdatedTemperature",
      "description": "UNKNOWN is the unset sentinel: outputs only — as input, omit the field instead; explicit UNKNOWN refuses 400. The value set is append-only: a consumer READING this field treats an unknown name as UNKNOWN, never as an error; as input an unknown name refuses 400 — the parse is strict"
    },
    "portfolioId": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Single assignment in the POC; 0 = unassigned."
    },
    "pendingByUserId": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The maker while a proposal is pending; 0 otherwise."
    },
    "pendingTransition": {
      "$ref": "#/$defs/AccountUpdatedPendingTransition",
      "description": "ACTIVATE (a classification), AMEND (a re-classification — the proposed axes ride this record while the last approved record keeps enforcing), UNFREEZE, RETIRE; NONE otherwise. NONE is the unset sentinel: outputs only — as input, omit the field instead; explicit NONE refuses 400. The value set is append-only: a consumer READING this field treats an unknown name as NONE, never as an error; as input an unknown name refuses 400 — the parse is strict"
    },
    "tradingCredentialId": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The trading credential this account's orders go through when set (a read-only key discovers the account; a trading key at the same venue is designated here); absent or 0 = orders go through credentialId. Designated at classification, under dual control."
    },
    "externalRef": {
      "type": "string",
      "description": "The venue's own account identifier — an attribute, never the id; with the credential, the key a discovery is idempotent on."
    },
    "displayName": {
      "type": "string",
      "description": "Empty-not-null."
    },
    "globalSequence": {
      "$ref": "#/$defs/GlobalSequenceValue"
    },
    "unscaled": {
      "type": "boolean",
      "description": "Never present since 0.3.3: every money value on this API states its own scale on the wire — a policy amount or cap since 0.3.3, an order's and an execution's since 0.3.2, a balance's since 0.3.1 — so a row is never served raw, whether or not this member holds the asset or instrument it references. Kept, deprecated, so a client generated from 0.3.2 still compiles; it goes at the next major.",
      "deprecated": true
    }
  },
  "required": [
    "accountId",
    "version",
    "orgId",
    "credentialId",
    "status",
    "location",
    "ownership",
    "purpose",
    "temperature",
    "pendingTransition",
    "externalRef",
    "displayName",
    "globalSequence"
  ],
  "$defs": {
    "AccountUpdatedLocation": {
      "type": "string",
      "enum": [
        "UNKNOWN",
        "EXCHANGE",
        "CUSTODIAN",
        "WALLET",
        "SELF_HOSTED",
        "BANK"
      ],
      "description": "UNKNOWN is the unset sentinel: outputs only — as input, omit the field instead; explicit UNKNOWN refuses 400. The value set is append-only: a consumer READING this field treats an unknown name as UNKNOWN, never as an error; as input an unknown name refuses 400 — the parse is strict",
      "title": "AccountUpdatedLocation"
    },
    "AccountUpdatedOwnership": {
      "type": "string",
      "enum": [
        "UNKNOWN",
        "HOUSE",
        "CLIENT_OMNIBUS",
        "CLIENT_SEGREGATED"
      ],
      "description": "HOUSE only exercised in the POC. UNKNOWN is the unset sentinel: outputs only — as input, omit the field instead; explicit UNKNOWN refuses 400. The value set is append-only: a consumer READING this field treats an unknown name as UNKNOWN, never as an error; as input an unknown name refuses 400 — the parse is strict",
      "title": "AccountUpdatedOwnership"
    },
    "AccountUpdatedPendingTransition": {
      "type": "string",
      "enum": [
        "NONE",
        "ACTIVATE",
        "AMEND",
        "REACTIVATE",
        "UNFREEZE",
        "RETIRE",
        "REVOKE",
        "ROTATE",
        "RESUME_TRADING"
      ],
      "description": "ACTIVATE (a classification), AMEND (a re-classification — the proposed axes ride this record while the last approved record keeps enforcing), UNFREEZE, RETIRE; NONE otherwise. NONE is the unset sentinel: outputs only — as input, omit the field instead; explicit NONE refuses 400. The value set is append-only: a consumer READING this field treats an unknown name as NONE, never as an error; as input an unknown name refuses 400 — the parse is strict",
      "title": "AccountUpdatedPendingTransition"
    },
    "AccountUpdatedPurpose": {
      "type": "string",
      "enum": [
        "UNKNOWN",
        "TREASURY",
        "CLIENT_DEPOSIT",
        "SETTLEMENT_OPS",
        "COLLATERAL",
        "HEDGE",
        "RAIL_VISIBLE"
      ],
      "description": "UNKNOWN is the unset sentinel: outputs only — as input, omit the field instead; explicit UNKNOWN refuses 400. The value set is append-only: a consumer READING this field treats an unknown name as UNKNOWN, never as an error; as input an unknown name refuses 400 — the parse is strict",
      "title": "AccountUpdatedPurpose"
    },
    "AccountUpdatedStatus": {
      "type": "string",
      "enum": [
        "UNKNOWN",
        "DISCOVERED",
        "PENDING_APPROVAL",
        "ACTIVE",
        "FROZEN",
        "RETIRED"
      ],
      "description": "UNKNOWN is the unset sentinel: outputs only — as input, omit the field instead; explicit UNKNOWN refuses 400. The value set is append-only: a consumer READING this field treats an unknown name as UNKNOWN, never as an error; as input an unknown name refuses 400 — the parse is strict",
      "title": "AccountUpdatedStatus"
    },
    "AccountUpdatedTemperature": {
      "type": "string",
      "enum": [
        "UNKNOWN",
        "COLD",
        "WARM",
        "HOT"
      ],
      "description": "UNKNOWN is the unset sentinel: outputs only — as input, omit the field instead; explicit UNKNOWN refuses 400. The value set is append-only: a consumer READING this field treats an unknown name as UNKNOWN, never as an error; as input an unknown name refuses 400 — the parse is strict",
      "title": "AccountUpdatedTemperature"
    },
    "GlobalSequenceValue": {
      "type": "string",
      "pattern": "^[0-9]+$",
      "description": "The position as a decimal string — the last change this member had applied, orders, balance readings and algo instances included.",
      "title": "GlobalSequenceValue"
    }
  }
}