# Consulta DNI - RUC

<mark style="color:green;">`POST`</mark> `https://apiperu.dev/api/dni-ruc`&#x20;

#### Headers

| Name          | Type   | Description      |
| ------------- | ------ | ---------------- |
| Accept        | String | application/json |
| Content-Type  | string | application/json |
| Authorization | string | Bearer \<token>  |

#### Body

| Name                                  | Type   | Description |
| ------------------------------------- | ------ | ----------- |
| dni<mark style="color:red;">\*</mark> | String | 8 dígitos   |

{% tabs %}
{% tab title="200 " %}

```json
{
    "success": true,
    "message": "El DNI si cuenta con RUC",
    "data": {
        "ruc": "10*4***3*9*"
    }
}
```

{% endtab %}
{% endtabs %}

### Ejemplos de uso&#x20;

{% tabs %}
{% tab title="PHP" %}

```php
    $params = json_encode(['dni' => 'INGRESAR_NUMERO_DNI_AQUI']);
    $curl = curl_init();
    curl_setopt_array($curl, array(
        CURLOPT_URL => "https://apiperu.dev/api/dni-ruc",
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_CUSTOMREQUEST => "POST",
        CURLOPT_SSL_VERIFYPEER => false,
        CURLOPT_POSTFIELDS => $params,        
        CURLOPT_HTTPHEADER => [
            'Accept: application/json',
            'Content-Type: application/json',
            'Authorization: Bearer INGRESAR_TOKEN_AQUI'
        ],        
    ));
    $response = curl_exec($curl);
    $err = curl_error($curl);
    curl_close($curl);
    if ($err) {
        echo "cURL Error #:" . $err;
    } else {
        echo $response;
    }
```

{% endtab %}
{% endtabs %}
