{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/direction-generale-des-finances-publiques/json-schema/direction-generale-des-finances-publiques-reponse-liste-finale-comptes-pour-pm-schema.json",
  "title": "ReponseListeFinaleComptesPourPM",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/direction-generale-des-finances-publiques-ficoba-openapi.yml#/components/schemas/ReponseListeFinaleComptesPourPM",
  "type": "object",
  "properties": {
    "caracteristiquesDemande": {
      "$ref": "#/$defs/DemandeRestit"
    },
    "referenceDemande": {
      "type": "string"
    },
    "nombreReponses": {
      "type": "string"
    },
    "messageInformatif": {
      "$ref": "#/$defs/ReponseErreur"
    },
    "reponses": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ReponseListeComptesPourPM"
      }
    }
  },
  "$defs": {
    "Adresse": {
      "type": "object",
      "properties": {
        "codePaysResidence": {
          "type": "string"
        },
        "libellePaysResidence": {
          "type": "string"
        },
        "codeDepartementResidence": {
          "type": "string"
        },
        "libelleDepartementResidence": {
          "type": "string"
        },
        "codeCommuneResidence": {
          "type": "string"
        },
        "libelleCommuneResidence": {
          "type": "string"
        },
        "codeNatureVoie": {
          "type": "string"
        },
        "libelleVoie": {
          "type": "string"
        },
        "numeroVoie": {
          "type": "string"
        },
        "indiceRepetition": {
          "type": "string"
        },
        "indicateurCodifAdresse": {
          "type": "string"
        },
        "codePostal": {
          "type": "string"
        },
        "libelleComplAdr": {
          "type": "string"
        }
      }
    },
    "AdresseGuichet": {
      "type": "object",
      "properties": {
        "libAdr1": {
          "type": "string"
        },
        "libAdr2": {
          "type": "string"
        },
        "libAdr3": {
          "type": "string"
        },
        "libAdr4": {
          "type": "string"
        }
      }
    },
    "CaracteristiqueCompte": {
      "type": "object",
      "properties": {
        "codeCaracteristique": {
          "type": "integer",
          "format": "int32"
        },
        "libelleCaracteristique": {
          "type": "string"
        }
      }
    },
    "CompteCaracteristiques": {
      "type": "object",
      "properties": {
        "iban": {
          "type": "string"
        },
        "dateOuverture": {
          "type": "string"
        },
        "dateFiscale": {
          "type": "string"
        },
        "codeMotifOuverture": {
          "type": "string"
        },
        "libelleMotifOuverture": {
          "type": "string"
        },
        "dateCloture": {
          "type": "string"
        },
        "nature": {
          "$ref": "#/$defs/NatureCompteDto"
        },
        "type": {
          "$ref": "#/$defs/TypeCompte"
        },
        "formatCompte": {
          "type": "string"
        },
        "caracteristique": {
          "$ref": "#/$defs/CaracteristiqueCompte"
        },
        "succession": {
          "type": "string"
        },
        "resident": {
          "type": "string"
        },
        "devise": {
          "$ref": "#/$defs/DeviseCompte"
        }
      }
    },
    "CompteStructure": {
      "type": "object",
      "properties": {
        "caracteristiqueCompte": {
          "$ref": "#/$defs/CompteCaracteristiques"
        },
        "etablissementGestionnaire": {
          "$ref": "#/$defs/EtablissementGestionnaire"
        },
        "ayantsDroits": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/TitulaireCompte"
          }
        }
      }
    },
    "DemandeRestit": {
      "type": "object",
      "properties": {
        "dateDemande": {
          "type": "string"
        },
        "motif": {
          "type": "string"
        },
        "siretDemandeur": {
          "type": "string"
        },
        "sirenDemandeur": {
          "type": "string"
        },
        "justification": {
          "type": "string"
        }
      }
    },
    "DeviseCompte": {
      "type": "object",
      "properties": {
        "codeDevise": {
          "type": "string"
        }
      }
    },
    "EtablissementBancaire": {
      "type": "object",
      "properties": {
        "numeroEtablissement": {
          "type": "string"
        },
        "libelleEtablissement": {
          "type": "string"
        },
        "bicEtablissement": {
          "type": "string"
        }
      }
    },
    "EtablissementGestionnaire": {
      "type": "object",
      "properties": {
        "etablissement": {
          "$ref": "#/$defs/EtablissementBancaire"
        },
        "guichet": {
          "$ref": "#/$defs/GuichetDto"
        }
      }
    },
    "GuichetDto": {
      "type": "object",
      "properties": {
        "numeroGuichet": {
          "type": "string"
        },
        "libelleGuichet": {
          "type": "string"
        },
        "adresse": {
          "$ref": "#/$defs/AdresseGuichet"
        }
      }
    },
    "NatureCompteDto": {
      "type": "object",
      "properties": {
        "codeNature": {
          "type": "integer",
          "format": "int32"
        },
        "libelleNature": {
          "type": "string"
        }
      }
    },
    "PersonneMorale": {
      "type": "object",
      "properties": {
        "raisonSociale": {
          "type": "string"
        },
        "sigle": {
          "type": "string"
        },
        "enseigne": {
          "type": "string"
        },
        "siret": {
          "type": "string"
        },
        "categorieJuridique": {
          "type": "integer",
          "format": "int32"
        },
        "siren": {
          "type": "string"
        },
        "adresse": {
          "$ref": "#/$defs/Adresse"
        },
        "scoreAppariement": {
          "type": "number",
          "format": "double"
        }
      }
    },
    "ReponseErreur": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "horodatage": {
          "type": "string"
        }
      }
    },
    "ReponseListeComptesPourPM": {
      "type": "object",
      "properties": {
        "caracteristiquesDemande": {
          "$ref": "#/$defs/DemandeRestit"
        },
        "referenceDemande": {
          "type": "string"
        },
        "nombreReponses": {
          "type": "string"
        },
        "messageInformatif": {
          "$ref": "#/$defs/ReponseErreur"
        },
        "personneRecherche": {
          "$ref": "#/$defs/PersonneMorale"
        },
        "nombreComptes": {
          "type": "string"
        },
        "comptes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CompteStructure"
          }
        }
      }
    },
    "TitulaireCompte": {
      "type": "object"
    },
    "TypeCompte": {
      "type": "object",
      "properties": {
        "codeType": {
          "type": "integer",
          "format": "int32"
        },
        "libelleType": {
          "type": "string"
        }
      }
    }
  }
}