Saltar a contenido

Inicio Rápido

Validación LRFC estándar

Validar si el RFC está registrado ante el SAT

var client = new RestClient("https://api.csfacturacion.com/validarfc/AAA010101AAA");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("Authorization", "Basic Zm9vOmJhcg==");
IRestResponse response = client.Execute(request);
<?php
$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.csfacturacion.com/validarfc/AAA010101AAA",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => [
    "Accept: application/json",
    "Authorization: Basic Zm9vOmJhcg=="
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.csfacturacion.com/validarfc/AAA010101AAA"))
    .header("Accept", "application/json")
    .header("Authorization", "Basic Zm9vOmJhcg==")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());

Respuesta:

{
    "rfc": "AAA010101AAA",
    "observacion": "De acuerdo a las disposiciones fiscales previstas en la reforma fiscal 2022, el SAT ya no permite realizar la consulta de la LCO y Nomina tal cómo se venía realizando y por el momento ya no podemos seguir ofreciendo esta funcionalidad.",
    "nomina": {
        "SNCF": "0",
        "subContratacion": "0"
    },
    "LCO": true,
    "mensaje": "RFC disponible",
    "estatus": true
}

Validación LRFC extendida

Validar el RFC, Razón Social y Código Postal de un Contribuyente.

var client = new
RestClient("https://api.csfacturacion.com/validarfc/v2?rfc=AAAA010101AAA
&nombre=CONROE%20SOLUCIONES&domicilio_fiscal=010101&uso_cfdi=G03&regimen_fiscal=603");
var request = new RestRequest(Method.GET);
request.AddHeader("Accept", "application/json");
request.AddHeader("Authorization", "Basic Zm9vOmJhcg==");
IRestResponse response = client.Execute(request);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8081",
CURLOPT_URL =>
"https://api.csfacturacion.com/validarfc/v2?rfc=AAA010101AAA&nomb
re=CONROE%20SOLUCIONES&domicilio_fiscal=010101&uso_cfdi=G03&regimen_fisca
l=603",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "",
CURLOPT_HTTPHEADER => [
    "Accept: application/json",
    "Authorization: Basic Zm9vOmJhcg=="
    ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.csfacturacion.com/validarfc/v2?rfc=C
AAA010101AAA&nombre=CONROE%20SOLUCIONES&domicilio_fiscal=010101&uso_cfdi=G
03&regimen_fiscal=603"))
.header("Accept", "application/json")
.header("Authorization", "Basic Zm9vOmJhcg==")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());

Respuesta:

{
    "codigo": "000",
    "descripcion": ""
}

El código 000 indica que todos los campos son correctos y coinciden con los registrados ante el SAT.

Código Postal Inválido:

{
    "codigo": "903",
    "descripcion": "301  CFDI40147 CodigoPostal del Receptor es disinto al que tiene el SAT"
}

Razón Social Inválida:

{
    "codigo": "902",
    "descripcion": "301  CFDI40145 Nombre Receptor es distinto a Nombre de Lista Rfc del SAT;  rfc=AAA010101AAA"
}