{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/lynx/main/json-schema/lynx-member-account-status-request-schema.json",
  "title": "MemberAccountStatusRequest",
  "x-generated": "2026-10-14",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/lynx-account-api-openapi.yml#/components/schemas/MemberAccountStatusRequest",
  "type": "object",
  "properties": {
    "data": {
      "$ref": "#/$defs/PatchUpdateMemberAccountStatusRequest"
    },
    "idempotency": {
      "$ref": "#/$defs/Idempotency",
      "description": "Unique identifier that represents the operation"
    }
  },
  "required": [
    "data",
    "idempotency"
  ],
  "$defs": {
    "BaseMemberProduct": {
      "type": "object",
      "properties": {
        "productName": {
          "type": "string",
          "description": "The name of the product"
        }
      },
      "required": [
        "productName"
      ]
    },
    "ClientOrgDto": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the client organization"
        }
      },
      "required": [
        "name"
      ]
    },
    "Idempotency": {
      "type": "object",
      "properties": {
        "idempotencyKey": {
          "type": "string",
          "description": "Unique identifier that represents the operation"
        }
      }
    },
    "PatchAccountStatusMemberDto": {
      "type": "object",
      "properties": {
        "clientMemberId": {
          "type": "string",
          "description": "Unique client-side identifier for the member"
        },
        "memberBankAccountId": {
          "type": "string",
          "format": "uuid",
          "description": "Unique identifier of the bank account"
        }
      },
      "required": [
        "clientMemberId"
      ]
    },
    "PatchMemberAccountStatusDto": {
      "type": "object",
      "properties": {
        "accountType": {
          "type": "string",
          "description": "Type of account"
        },
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "UUID of the member account"
        }
      }
    },
    "PatchUpdateMemberAccountStatusRequest": {
      "type": "object",
      "properties": {
        "clientOrg": {
          "$ref": "#/$defs/ClientOrgDto"
        },
        "member": {
          "$ref": "#/$defs/PatchAccountStatusMemberDto"
        },
        "memberProduct": {
          "$ref": "#/$defs/BaseMemberProduct"
        },
        "memberAccount": {
          "$ref": "#/$defs/PatchMemberAccountStatusDto"
        },
        "status": {
          "type": "string",
          "enum": [
            "CLOSE",
            "FREEZE",
            "ACTIVATE"
          ]
        },
        "statusReason": {
          "type": "string",
          "description": "The reason for a particular status; Required when closing the account",
          "enum": [
            "Close Account - Customer Request",
            "Close Account - Deceased",
            "Close Account - Other"
          ]
        },
        "memberAuthorized": {
          "type": "boolean",
          "description": "Indicates whether member has authorized closure of the account; this is required when it is a member-owned account type, such as a Health Savings Account"
        },
        "memberAuthorizedDate": {
          "type": "string",
          "description": "Date when the member has authorized closure of the account; this is required when it is a member-owned account type, such as a Health Savings Account"
        }
      },
      "required": [
        "clientOrg",
        "memberAccount",
        "memberProduct",
        "status"
      ]
    }
  }
}