{
  "openapi": "3.0.1",
  "info": {
    "title": "CP_Leads_Service_APIs",
    "version": "v1"
  },
  "paths": {
    "/api/leads/load": {
      "post": {
        "tags": [
          "Clienti"
        ],
        "parameters": [
          {
            "name": "token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClienteCP"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ClienteCP"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ClienteCP"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WebResponseCP"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebResponseCP"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebResponseCP"
                }
              }
            }
          }
        }
      }
    },
    "/api/leads/loadLegalPerson": {
      "post": {
        "tags": [
          "Clienti"
        ],
        "parameters": [
          {
            "name": "token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClienteLegalCP"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ClienteLegalCP"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ClienteLegalCP"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WebResponseCP"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebResponseCP"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebResponseCP"
                }
              }
            }
          }
        }
      }
    },
    "/api/login": {
      "post": {
        "tags": [
          "Login"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginCP"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginCP"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/LoginCP"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/WebResponseCP"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebResponseCP"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebResponseCP"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ClienteCP": {
        "required": [
          "cognome",
          "nome",
          "provinciaDomicilio"
        ],
        "type": "object",
        "properties": {
          "nome": {
            "type": "string",
            "nullable": true
          },
          "cognome": {
            "type": "string",
            "nullable": true
          },
          "cellulare": {
            "type": "string",
            "nullable": true
          },
          "cellulare2": {
            "type": "string",
            "nullable": true
          },
          "telefonoResidenza": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "dataNascita": {
            "type": "string",
            "nullable": true
          },
          "provinciaNascita": {
            "type": "string",
            "nullable": true
          },
          "comuneNascita": {
            "type": "string",
            "nullable": true
          },
          "sesso": {
            "type": "string",
            "nullable": true
          },
          "codiceFiscale": {
            "type": "string",
            "nullable": true
          },
          "provinciaResidenza": {
            "type": "string",
            "nullable": true
          },
          "comuneResidenza": {
            "type": "string",
            "nullable": true
          },
          "indirizzoResidenza": {
            "type": "string",
            "nullable": true
          },
          "capResidenza": {
            "type": "string",
            "nullable": true
          },
          "fax": {
            "type": "string",
            "nullable": true
          },
          "provinciaDomicilio": {
            "type": "string",
            "nullable": true
          },
          "comuneDomicilio": {
            "type": "string",
            "nullable": true
          },
          "indirizzoDomicilio": {
            "type": "string",
            "nullable": true
          },
          "capDomicilio": {
            "type": "string",
            "nullable": true
          },
          "telefonoDomicilio": {
            "type": "string",
            "nullable": true
          },
          "iban": {
            "type": "string",
            "nullable": true
          },
          "idTipoDocumento": {
            "type": "integer",
            "format": "int32"
          },
          "numeroDocumento": {
            "type": "string",
            "nullable": true
          },
          "dataEmissioneDocumento": {
            "type": "string",
            "nullable": true
          },
          "dataScadenzaDocumento": {
            "type": "string",
            "nullable": true
          },
          "idProfessione": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "idProtocollo": {
            "type": "string",
            "nullable": true
          },
          "nota": {
            "type": "string",
            "nullable": true
          },
          "idCanale": {
            "type": "integer",
            "format": "int32"
          },
          "ragioneSociale": {
            "type": "string",
            "nullable": true
          },
          "partitaIva": {
            "type": "string",
            "nullable": true
          },
          "emailPec": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HttpStatusCode": {
        "enum": [
          100,
          101,
          102,
          103,
          200,
          201,
          202,
          203,
          204,
          205,
          206,
          207,
          208,
          226,
          300,
          300,
          301,
          301,
          302,
          302,
          303,
          303,
          304,
          305,
          306,
          307,
          307,
          308,
          400,
          401,
          402,
          403,
          404,
          405,
          406,
          407,
          408,
          409,
          410,
          411,
          412,
          413,
          414,
          415,
          416,
          417,
          421,
          422,
          423,
          424,
          426,
          428,
          429,
          431,
          451,
          500,
          501,
          502,
          503,
          504,
          505,
          506,
          507,
          508,
          510,
          511
        ],
        "type": "integer",
        "format": "int32"
      },
      "Error": {
        "type": "object",
        "properties": {
          "httpStatusCode": {
            "$ref": "#/components/schemas/HttpStatusCode"
          },
          "message": {
            "type": "string",
            "nullable": true
          },
          "messageType": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Response": {
        "type": "object",
        "properties": {
          "items": {
            "type": "object",
            "additionalProperties": false,
            "nullable": true
          },
          "message": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "WebResponseCP": {
        "type": "object",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/Error"
          },
          "response": {
            "$ref": "#/components/schemas/Response"
          }
        },
        "additionalProperties": false
      },
      "ReferenteBL": {
        "type": "object",
        "properties": {
          "nome": {
            "type": "string",
            "nullable": true
          },
          "cognome": {
            "type": "string",
            "nullable": true
          },
          "cellulare": {
            "type": "string",
            "nullable": true
          },
          "telefono": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ClienteLegalCP": {
        "type": "object",
        "properties": {
          "cellulare": {
            "type": "string",
            "nullable": true
          },
          "telefono": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "codiceFiscale": {
            "type": "string",
            "nullable": true
          },
          "provincia": {
            "type": "string",
            "nullable": true
          },
          "comune": {
            "type": "string",
            "nullable": true
          },
          "indirizzo": {
            "type": "string",
            "nullable": true
          },
          "nota": {
            "type": "string",
            "nullable": true
          },
          "idCanale": {
            "type": "integer",
            "format": "int32"
          },
          "ragioneSociale": {
            "type": "string",
            "nullable": true
          },
          "partitaIva": {
            "type": "string",
            "nullable": true
          },
          "emailPec": {
            "type": "string",
            "nullable": true
          },
          "rappresentanteLegale": {
            "$ref": "#/components/schemas/ReferenteBL"
          },
          "titolareEffettivo": {
            "$ref": "#/components/schemas/ReferenteBL"
          }
        },
        "additionalProperties": false
      },
      "LoginCP": {
        "required": [
          "password",
          "username"
        ],
        "type": "object",
        "properties": {
          "username": {
            "pattern": "^[a-zA-Z0-9._\\-@!?]{2,16}$",
            "type": "string",
            "nullable": true
          },
          "password": {
            "pattern": "^[a-zA-Z0-9._#*@!?\\-\\\\]{8,16}$",
            "type": "string",
            "nullable": true
          },
          "cloudId": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    }
  }
}