Validation for RFCs

Intro

This API is meant to validate a list of RFCs for Persona Física and for Persona Moral in the SAT website.

Important points

Mandatory Fields

The field rfcs is mandatory and it is required to send at least one rfc in the body to perform RFCs validations.

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.

If you are not sure how to obtain this 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 which is inside the rfcs array, 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)

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

Example : https://sandbox.link.kiban.cloud/api/v1/rfc_sat/validate?testCase=valid

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.
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
{
    "id": "655ff9d22bacd50889a583f8",
    "createdAt": "2023-11-24T01:18:10.851192635Z",
    "finishedAt": "2023-11-24T01:18:10.939132776Z",
    "duration": 87,
    "status": "SUCCESS",
    "request": {
        "rfcs": [
            {
                "rfc": "MAMN900119U24"
            },
            {
                "rfc": "MAMJ900119U2A"
            }
        ]
    },
    "response": {
        "rfcs": [
            {
                "result": "RFC válido, y susceptible de recibir facturas",
                "rfc": "MAMA900119U24"
            },
            {
                "result": "RFC válido, y susceptible de recibir facturas",
                "rfc": "XZXZ900119U24"
            }
        ]
    }
}

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
1663567bb713cf2110a1106cdInválidoIndicates that no information provided was not valid
2663567bb713cf2110a1106ceRespuesta exitosaIndicates one successful response

📘

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.

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

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"
}

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"
}

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"
}

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
Credentials
Header
Click Try It! to start a request and see the response here!