Validation for RFCs with data

API to validate multiple RFCs with data

Intro

This API is meant to validate a list of RFCs for Persona Física and for Persona Moral with the full tax information in the SAT system, checking for every RFC if the postal code and name of the person is correct.

Important points

Mandatory Fields

The request contains a list called rfcs, it is mandatory to send at least one element.
The fields rfc, cp and nombre are mandatory for every RFC sent.
The field "nombre" can contain a name of a Persona Física or the razón social of a Persona Moral.

fieldsubfieldtyperequiredlengthDescription
rfcsArrayYesN/Aarray containing the list of RFCs that will be consulted
rfcAlphanumericYes13Provide a valid RFC.
It can be an RFC for a PF with a length of 13 characters or an RFC for a PM with 12 characters.
cpNumericYes5indicate the 5-digit zip code
nombreAlphabeticYesN/Aname or company name defined for the RFC.

If you are not sure how to obtain the RFC field and you have your client's personal data, we suggest you visit our RFC generate RFC service to generate the RFC.

Validations applied

For the field rfc, kiban cloud applies a RFC format validation according to the SAT rules, the RFC must contain an RFC with homoclave and could be for Persona Física or Persona Moral.

Test the service (test cases)

We have included a query parameter in Sandbox to enable you to query the test cases that we created for running tests. To get a response, fill the testCaseId parameter with any of the following cases:

NumIdNameDescription
1663567bb713cf2110a1106d0InvalidoIndicates that the RFC is invalid
2663567a9713cf2110a110673Respuesta exitosaIndicates that the RFC is valid

📘

Test your own test case

In case you want to test your own test case created in link, you can send in the testCaseId parameter the identifier of the test case you want to use.

For more information visit our knowledge center to know more about test cases

Successful response

Inside the response object you will only get the next fields.

field NamesubfieldDescription
rfcsarray containing the list of RFCs that were queried.
rfcIt will indicate the RFC consulted.
nombrename or company name recovered for the RFC
cpzip code retrieved for the RFC
resultIt will display a message indicating the status of the RFC.

- RFC válido, y susceptible de recibir facturas
- RFC no registrado en el padrón de contribuyentes
- El nombre, denominación o razón social no coincide con el registrado en el RFC
- El Código Postal no coincide con el registrado en el RFC.
{
    "id": "655ffe922bacd50889a58400",
    "createdAt": "2023-11-24T01:38:26.556261308Z",
    "finishedAt": "2023-11-24T01:38:26.90064124Z",
    "duration": 344,
    "status": "SUCCESS",
    "request": {
        "rfcs": [
            {
                "cp": "06500",
                "nombre": "Felipe Garcia",
                "rfc": "XVRS900119U23"
            },
            {
                "cp": "09810",
                "nombre": "juan lopez",
                "rfc": "LSRT900119U2A"
            }
        ]
    },
    "response": {
        "rfcs": [
            {
                "cp": "09810",
                "nombre": "Jose Montes",
                "result": "RFC válido, y susceptible de recibir facturas",
                "rfc": "MAMA900119U24"
            },
            {
                "cp": "09810",
                "nombre": "Andres Torres",
                "result": "RFC válido, y susceptible de recibir facturas",
                "rfc": "XZXZ900119U24"
            }
        ]
    }
}

Test the service (test cases)

We included two query params in Sandbox environment (testCase and testCaseId), so you can query test cases that we created to run tests.

To recover a success response in sandbox environment is necessary to send a test case (see query parameter "testCase"). The posible values for the query param "testCase" are :

  • valid it will return an example with valid RFCs
  • invalid it will return an example with invalid RFCs

📘

Test your own test case

In case you want to test your own test case created in link, you can change the testCase parameter to testCaseId and send the identifier of the test case you want to use


🚧

change in test cases starting May 20, 2024

We inform you that starting May 20, 2024 we will make an update in the way of consuming our test cases, from now on, you must send the parameter testCaseId, indicating the identifier of the ID that is required to consult, for more information visit our knowledge center.

You can use any of the following testCaseId to test this service:

NumIdNameDescription
1663567bb713cf2110a1106d0InválidoIndicates that no information provided was not valid
2663567bb713cf2110a1106cfRespuesta exitosaIndicates one successful response

Listing the possible not success responses

Required RFCs

You will get a 400 bad request error when the rfcs array is not provided in the request body.

{
    "RFCs": "EMPTY_ERROR; can't be empty"
}

Empty RFC

You will get a 400 bad request error when the array does not contain at least one rfc is not provided in the request body.

{
    "rfc[1]": "EMPTY_ERROR; can't be empty"
}

Empty postal code

You will get a 400 bad request error when the array does not contain at least one rfc is not provided in the request body.

{
    "cp[1]": "EMPTY_ERROR; can't be empty"
}

Empty name

You will get a 400 bad request error when the array does not contain at least one rfc is not provided in the request body.

{
    "nombre[1]": "EMPTY_ERROR; can't be empty"
}

Test case not found

In sandbox environment, if a test case parameter is not sent or a value other than those mentioned above is sent, the service will return the following error 400 bad request

{
    "testCase": "EMPTY_ERROR; test case not found",
    "testCaseId": "EMPTY_ERROR; test case not found with given id"
}

RFC Invalid Format

RFC length provided is not correct, the service will return the following error 400 bad request

{
    "rfc[1]": "FORMAT_ERROR; should be in rfc format with homoclave"
}

Zip code Invalid Format

RFC length provided is not correct, the service will return the following error 400 bad request

{  
    "cp[1]": "FORMAT_ERROR; should be in postal code format"  
}

Unauthorized

It means that the provided API is incorrect and that you are not authorized to access it. You will not receive a body, only a 401 HTTP code.

Language
Authorization
Header
Click Try It! to start a request and see the response here!