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.
field | subfield | type | required | length | Description |
---|---|---|---|---|---|
rfcs | Array | Yes | N/A | array containing the list of RFCs that will be consulted | |
rfc | Alphanumeric | Yes | 13 | Provide 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. | |
cp | Numeric | Yes | 5 | indicate the 5-digit zip code | |
nombre | Alphabetic | Yes | N/A | name 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:
Num | Id | Name | Description |
---|---|---|---|
1 | 663567bb713cf2110a1106d0 | Invalido | Indicates that the RFC is invalid |
2 | 663567a9713cf2110a110673 | Respuesta exitosa | Indicates 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 Name | subfield | Description |
---|---|---|
rfcs | array containing the list of RFCs that were queried. | |
rfc | It will indicate the RFC consulted. | |
nombre | name or company name recovered for the RFC | |
cp | zip code retrieved for the RFC | |
result | It 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"
}
]
}
}
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.