{
  "tags": [
    "账户资料"
  ],
  "description": "为当前登录用户发起个人实名认证、二次实名认证或企业实名认证。个人认证可能直接通过，也可能返回第三方认证跳转地址；企业认证要求先完成法人个人认证，并由系统调用已配置的企业认证服务完成校验。",
  "operationId": "user_post_v1_user_certify",
  "security": [
    {
      "AccessToken": []
    },
    {
      "ApiKey": [],
      "ApiSecret": []
    }
  ],
  "responses": {
    "200": {
      "description": "请求已被处理。个人认证直接通过或企业认证成功时 data 为 null；需要跳转第三方认证时 data 为认证地址；身份信息无效、重复认证、认证服务未配置或企业信息校验失败时仍返回 HTTP 200。",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "code",
              "msg",
              "data"
            ],
            "properties": {
              "code": {
                "type": "integer",
                "description": "业务状态码；成功为 0。",
                "example": 0
              },
              "msg": {
                "type": "string",
                "description": "处理结果说明。",
                "example": "获取认证地址成功"
              },
              "data": {
                "type": "string",
                "nullable": true,
                "description": "需要第三方个人认证时为认证跳转地址；认证直接通过时为 null；失败时为空字符串。",
                "example": "https://verify.example.invalid/session/demo"
              }
            }
          },
          "examples": {
            "redirect": {
              "summary": "返回个人认证地址",
              "value": {
                "code": 0,
                "msg": "获取认证地址成功",
                "data": "https://verify.example.invalid/session/demo"
              }
            },
            "personalPassed": {
              "summary": "个人认证直接通过",
              "value": {
                "code": 0,
                "msg": "认证成功",
                "data": null
              }
            },
            "companyPassed": {
              "summary": "企业认证通过",
              "value": {
                "code": 0,
                "msg": "企业认证成功",
                "data": null
              }
            },
            "idUsed": {
              "summary": "身份证已被认证",
              "value": {
                "code": "user_certify-2",
                "msg": "您填写的身份证已经在其它账号认证过.",
                "data": ""
              }
            }
          },
          "example": {
            "code": 0,
            "msg": "获取认证地址成功",
            "data": "https://verify.example.invalid/session/demo"
          }
        }
      }
    }
  },
  "x-python-handler": "user.UserCertifyAPI",
  "x-python-route-line": 213,
  "x-audience": "user",
  "x-auth": "user",
  "x-reviewed": true,
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "verify_type": {
              "type": "string",
              "enum": [
                "personal_auth",
                "company_auth"
              ],
              "default": "personal_auth",
              "description": "认证类型。personal_auth 为个人或二次个人认证；company_auth 为企业认证。未传时为 personal_auth。",
              "example": "personal_auth"
            },
            "cert_name": {
              "type": "string",
              "description": "个人认证时使用的姓名；必须为中文姓名。二次认证时必须与首次认证姓名一致。",
              "example": "张三"
            },
            "cert_no": {
              "type": "string",
              "description": "个人认证时使用的中国居民身份证号码。二次认证时必须与首次认证身份证号码一致。",
              "example": "110101199001011234"
            },
            "company_credit_code": {
              "type": "string",
              "description": "企业认证必填。企业统一社会信用代码，必须通过格式校验。",
              "example": "91110000100000000X"
            },
            "company_name": {
              "type": "string",
              "description": "企业认证必填。企业名称；会进行 XSS 过滤。",
              "example": "示例科技有限公司"
            }
          },
          "example": {
            "verify_type": "personal_auth",
            "cert_name": "张三",
            "cert_no": "110101199001011234"
          }
        }
      }
    }
  },
  "parameters": [],
  "x-itecdn-source-reviewed": true,
  "extensions": [
    {
      "key": "x-python-handler",
      "value": "user.UserCertifyAPI"
    },
    {
      "key": "x-python-route-line",
      "value": 213
    },
    {
      "key": "x-audience",
      "value": "user"
    },
    {
      "key": "x-auth",
      "value": "user"
    },
    {
      "key": "x-reviewed",
      "value": true
    },
    {
      "key": "x-itecdn-source-reviewed",
      "value": true
    }
  ],
  "method": "post",
  "path": "/v1/user/certify",
  "servers": [
    {
      "url": "https://master.example.invalid",
      "description": "不可调用的示例地址；复制示例后替换为自己的主控域名。"
    }
  ],
  "securitySchemes": {
    "AccessToken": {
      "type": "apiKey",
      "in": "header",
      "name": "access-token",
      "description": "通过登录接口获得的短期访问令牌。"
    },
    "ApiKey": {
      "type": "apiKey",
      "in": "header",
      "name": "api-key",
      "description": "API Key；必须和 api-secret 同时发送。"
    },
    "ApiSecret": {
      "type": "apiKey",
      "in": "header",
      "name": "api-secret",
      "description": "API Secret；必须和 api-key 同时发送。"
    }
  },
  "jsonRequestBodyExample": {
    "verify_type": "personal_auth",
    "cert_name": "张三",
    "cert_no": "110101199001011234"
  },
  "info": {
    "title": "itecdn v5 用户 API",
    "version": "5.x",
    "description": "itecdn v5.x Python 主控用户 API。本文档不适用于 v6 或其它实现。"
  },
  "postman": {
    "name": "发起个人或企业实名认证",
    "description": {
      "content": "为当前登录用户发起个人实名认证、二次实名认证或企业实名认证。个人认证可能直接通过，也可能返回第三方认证跳转地址；企业认证要求先完成法人个人认证，并由系统调用已配置的企业认证服务完成校验。",
      "type": "text/plain"
    },
    "url": {
      "path": [
        "v1",
        "user",
        "certify"
      ],
      "host": [
        "{{baseUrl}}"
      ],
      "query": [],
      "variable": []
    },
    "header": [
      {
        "key": "Content-Type",
        "value": "application/json"
      },
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "method": "POST",
    "body": {
      "mode": "raw",
      "raw": "",
      "options": {
        "raw": {
          "language": "json"
        }
      }
    },
    "auth": {
      "type": "apikey",
      "apikey": [
        {
          "type": "any",
          "value": "access-token",
          "key": "key"
        },
        {
          "type": "any",
          "value": "{{apiKey}}",
          "key": "value"
        },
        {
          "type": "any",
          "value": "header",
          "key": "in"
        }
      ]
    }
  }
}