---
updatedAt: 2025-06-05T00:43:08.000Z
agentTools:
  projectIndex: https://docs.kiban.com/llms.txt
---

# 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.

<Table align={["left","left","left","left","left","left"]}>
  <thead>
    <tr>
      <th style={{ textAlign: "left" }}>
        field
      </th>

      <th style={{ textAlign: "left" }}>
        subfield
      </th>

      <th style={{ textAlign: "left" }}>
        type
      </th>

      <th style={{ textAlign: "left" }}>
        required
      </th>

      <th style={{ textAlign: "left" }}>
        length
      </th>

      <th style={{ textAlign: "left" }}>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td style={{ textAlign: "left" }}>
        rfcs
      </td>

      <td style={{ textAlign: "left" }}>

      </td>

      <td style={{ textAlign: "left" }}>
        Array
      </td>

      <td style={{ textAlign: "left" }}>
        Yes
      </td>

      <td style={{ textAlign: "left" }}>
        N/A
      </td>

      <td style={{ textAlign: "left" }}>
        array containing the list of RFCs that will be consulted
      </td>
    </tr>

    <tr>
      <td style={{ textAlign: "left" }}>

      </td>

      <td style={{ textAlign: "left" }}>
        rfc
      </td>

      <td style={{ textAlign: "left" }}>
        Alphanumeric
      </td>

      <td style={{ textAlign: "left" }}>
        Yes
      </td>

      <td style={{ textAlign: "left" }}>
        13
      </td>

      <td style={{ textAlign: "left" }}>
        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.
      </td>
    </tr>
  </tbody>
</Table>

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](https://docs.kiban.cloud/reference/sat-generate-rfc-pf) 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.

<Table align={["left","left","left"]}>
  <thead>
    <tr>
      <th>
        field Name
      </th>

      <th>
        subfield
      </th>

      <th>
        Description
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        rfcs
      </td>

      <td>

      </td>

      <td>
        array containing the list of RFCs that were queried.
      </td>
    </tr>

    <tr>
      <td>

      </td>

      <td>
        rfc
      </td>

      <td>
        It will indicate the RFC consulted.
      </td>
    </tr>

    <tr>
      <td>

      </td>

      <td>
        result
      </td>

      <td>
        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
      </td>
    </tr>
  </tbody>
</Table>

```json Successful response
{
    "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:

| Num | Id                       | Name              | Description                                          |
| :-- | :----------------------- | :---------------- | :--------------------------------------------------- |
| 1   | 663567bb713cf2110a1106cd | Inválido          | Indicates that no information provided was not valid |
| 2   | 663567bb713cf2110a1106ce | Respuesta exitosa | Indicates 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](https://help.kiban.com/en/articles/2074434)
>
> <Image align="center" width="200px" src="https://files.readme.io/b69ac92-Captura_de_Pantalla_2023-10-18_a_las_19.44.33.png" />

## 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.

```json Required fields
{
    "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.

```json Length error
{
    "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

```json Test case
{
    "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

```json
{
    "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.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "link",
    "version": "2"
  },
  "servers": [
    {
      "url": "https://sandbox.link.kiban.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/api/v2/sat/rfc_validate": {
      "post": {
        "summary": "Validation for RFCs",
        "description": "",
        "operationId": "validation-for-rfcs",
        "parameters": [
          {
            "name": "testCaseId",
            "in": "query",
            "description": "Send the id of the test case to consume",
            "schema": {
              "type": "string",
              "default": "663567bb713cf2110a1106ce"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "RAW_BODY": {
                    "type": "string",
                    "format": "json"
                  }
                }
              },
              "examples": {
                "Request Example": {
                  "value": {
                    "rfcs": [
                      {
                        "rfc": "ABCD900119J70"
                      },
                      {
                        "rfc": "NKO080220554"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Success": {
                    "value": "{\n    \"id\": \"638aa4e93c85c7dbcb691c18\",\n    \"createdAt\": \"2022-12-03T01:22:48.160880914Z\",\n    \"finishedAt\": \"2022-12-03T01:22:49.286404129Z\",\n    \"duration\": 1125,\n    \"status\": \"SUCCESS\",\n    \"request\": {\n        \"rfcs\": [\n            {\n                \"rfc\": \"ABCD900119U24\"\n            },\n            {\n                \"rfc\": \"NKO080220554\"\n            }\n        ]\n    },\n    \"response\": {\n        \"rfcs\": [\n            {\n                \"result\": \"RFC no registrado en el padrón de contribuyentes\",\n                \"rfc\": \"ABCD900119U24\"\n            },\n            {\n                \"result\": \"RFC válido, y susceptible de recibir facturas\",\n                \"rfc\": \"NKO080220554\"\n            }\n        ]\n    }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "638aa4e93c85c7dbcb691c18"
                    },
                    "createdAt": {
                      "type": "string",
                      "example": "2022-12-03T01:22:48.160880914Z"
                    },
                    "finishedAt": {
                      "type": "string",
                      "example": "2022-12-03T01:22:49.286404129Z"
                    },
                    "duration": {
                      "type": "integer",
                      "example": 1125,
                      "default": 0
                    },
                    "status": {
                      "type": "string",
                      "example": "SUCCESS"
                    },
                    "request": {
                      "type": "object",
                      "properties": {
                        "rfcs": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "rfc": {
                                "type": "string",
                                "example": "ABCD900119U24"
                              }
                            }
                          }
                        }
                      }
                    },
                    "response": {
                      "type": "object",
                      "properties": {
                        "rfcs": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "result": {
                                "type": "string",
                                "example": "RFC no registrado en el padrón de contribuyentes"
                              },
                              "rfc": {
                                "type": "string",
                                "example": "ABCD900119U24"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Mandatory Fields": {
                    "value": "{\n    \"rfc[1]\": \"EMPTY_ERROR; can't be empty\"\n}"
                  },
                  "Format error": {
                    "value": "{\n    \"rfc[1]\": \"FORMAT_ERROR; should be in rfc format with homoclave\"\n}"
                  },
                  "Test case not found": {
                    "value": "[\n    {\n        \"code\": \"EMPTY_ERROR\",\n        \"message\": \"test case not found with given id\",\n        \"field\": \"testCaseId\"\n    }\n]"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "title": "Mandatory Fields",
                      "type": "object",
                      "properties": {
                        "rfc[1]": {
                          "type": "string",
                          "example": "EMPTY_ERROR; can't be empty"
                        }
                      }
                    },
                    {
                      "title": "Format error",
                      "type": "object",
                      "properties": {
                        "rfc[1]": {
                          "type": "string",
                          "example": "FORMAT_ERROR; should be in rfc format with homoclave"
                        }
                      }
                    },
                    {
                      "title": "Test case not found",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string",
                            "example": "EMPTY_ERROR"
                          },
                          "message": {
                            "type": "string",
                            "example": "test case not found with given id"
                          },
                          "field": {
                            "type": "string",
                            "example": "testCaseId"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```