{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/lynx/json-schema/lynx-get-member-substantiation-history-response-schema.json",
  "title": "GetMemberSubstantiationHistoryResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/lynx-substantiation-api-openapi.yml#/components/schemas/GetMemberSubstantiationHistoryResponse",
  "type": "object",
  "properties": {
    "clientOrg": {
      "$ref": "#/$defs/ClientOrgDto",
      "description": "The name of the client organization"
    },
    "clientMemberId": {
      "type": "string",
      "description": "Unique client-side identifier for the member"
    },
    "firstName": {
      "type": "string",
      "description": "First name"
    },
    "lastName": {
      "type": "string",
      "description": "Last name"
    },
    "referenceIdentifier": {
      "type": "string",
      "description": "Transaction reference identifier"
    },
    "transactionId": {
      "type": "string",
      "format": "uuid",
      "description": "Internal unique identifier for the monetary transaction"
    },
    "history": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/MemberSubstantiationHistory"
      }
    },
    "receipts": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ReceiptData"
      }
    }
  },
  "required": [
    "clientMemberId",
    "clientOrg",
    "firstName",
    "lastName",
    "referenceIdentifier",
    "transactionId"
  ],
  "$defs": {
    "ClientOrgDto": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the client organization"
        }
      },
      "required": [
        "name"
      ]
    },
    "MemberSubstantiationHistory": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "description": "Status of the member transaction substantiation.",
          "enum": [
            "PENDING",
            "NOT_SUBSTANTIATED",
            "SUBSTANTIATED",
            "BLOCKED",
            "BLOCKED_WITH_ERROR"
          ]
        },
        "stage": {
          "type": "string",
          "description": "Substantiation stage of the member transaction",
          "enum": [
            "PNDS1",
            "PNDS2",
            "PNDS3",
            "PNDS4",
            "PMIS1",
            "PMIS2",
            "PMIS3",
            "PMIS4",
            "IELS1",
            "IELS2",
            "IELS3",
            "IELS4",
            "PNDAR",
            "PMIAR",
            "IELPR",
            "AUTO"
          ]
        },
        "stageName": {
          "type": "string",
          "description": "Substantiation stage name"
        },
        "stageStatusDate": {
          "type": "string",
          "format": "date-time",
          "description": "Date the substantiation activity occurred"
        },
        "methodApplied": {
          "type": "string",
          "description": "Method of substantiation for the member transaction; possible values are Manual, Copay, Recurring Expense, de Minimis, and IIAS"
        }
      },
      "required": [
        "methodApplied",
        "stage",
        "stageName",
        "stageStatusDate",
        "status"
      ]
    },
    "ReceiptData": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "Id"
        },
        "s3Path": {
          "type": "string",
          "description": "s3 path to the file"
        }
      },
      "required": [
        "id",
        "s3Path"
      ]
    }
  }
}