> ## Documentation Index
> Fetch the complete documentation index at: https://docs.json.pe/llms.txt
> Use this file to discover all available pages before exploring further.

# DNI - RUC

> Consulta si un DNI cuenta con RUC asociado.



## OpenAPI

````yaml POST /dni-ruc
openapi: 3.0.1
info:
  title: json.pe - API Consulta RUC, DNI, Placa, SOAT, Licencia de Conducir y más
  description: >-
    Documentación oficial de [json.pe](https://json.pe) — API Consulta RUC, DNI,
    Placa, SOAT, Licencia de Conducir y más. Regístrate gratis en
    [json.pe/signup](https://json.pe/signup).
  version: 1.0.0
servers:
  - url: https://api.json.pe/api
security:
  - bearerAuth: []
paths:
  /dni-ruc:
    post:
      tags:
        - dni
        - ruc
      description: Consulta si un DNI cuenta con RUC asociado.
      requestBody:
        required: true
        description: DNI de 8 dígitos a consultar
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/dni-ruc-request'
      responses:
        '200':
          description: Consulta exitosa. Retorna el RUC asociado al DNI.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/dni-ruc'
        '404':
          description: Recurso no encontrado
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
              example:
                success: false
                message: El DNI no cuenta con RUC
components:
  schemas:
    dni-ruc-request:
      type: object
      required:
        - dni
      description: >-
        Request body para consulta DNI - RUC. El DNI debe ser un string de 8
        dígitos.
      properties:
        dni:
          type: string
          description: Número de DNI de 8 dígitos
          example: '12345678'
          pattern: ^[0-9]{8}$
          minLength: 8
          maxLength: 8
      example:
        dni: '12345678'
    dni-ruc:
      type: object
      properties:
        success:
          type: boolean
          description: El estado de la respuesta true o false
        message:
          type: string
          description: Mensaje de la respuesta
        data:
          type: object
          description: Datos del RUC asociado al DNI
          properties:
            ruc:
              type: string
              description: Número de RUC asociado al DNI
      example:
        success: true
        message: El DNI si cuenta con RUC
        data:
          ruc: '10123456781'
    error:
      required:
        - message
        - success
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
      example:
        success: false
        message: Bad Request
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````