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

# Obtaining Personal Data from a PM RFC

Data from a RFC of a Persona Moral (PM)

## Intro

With this API, you can retrieve the data of a PM's (Persona Moral) RFC (Registro Federal de Contribuyentes).

## Important points

### Request

To make the request it is only necessary to provide the RFC for a PM.

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

      <th>
        type
      </th>

      <th>
        required
      </th>

      <th>
        length
      </th>

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

  <tbody>
    <tr>
      <td>
        rfc
      </td>

      <td>
        Alphanumeric
      </td>

      <td>
        Yes
      </td>

      <td>
        12
      </td>

      <td>
        Provide a valid RFC.\
        It can be an RFC of a PM with a length of 12 characters.
      </td>
    </tr>
  </tbody>
</Table>

If you want to validate the RFC (Registro Federal de Contribuyentes) of the PF (Persona Física) or PM (Persona Moral), you can use [this service](https://docs.kiban.cloud/reference/validation-for-rfcs) to ensure that the RFC provided is correct.

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-pm) service to generate the RFC.

## Successful response

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

| field Name             | Description                                                                                         |
| :--------------------- | :-------------------------------------------------------------------------------------------------- |
| curpRepresentanteLegal | It will indicate the CURP of the legal representative of the company.                               |
| email                  | It will indicate the email of the legal representative of the company.                              |
| status                 | Indicates a response status for the query made, the possible values are FOUND, NOT\_FOUND, INVALID. |
| razonSocial            | It will indicate the name of the company.                                                           |
| message                | A message will be displayed describing the problem why the SSN could not be retrieved               |

```json Successful response
{
    "id": "65281a530a3186c567f6b948",
    "createdAt": "2023-10-12T10:09:55.150693-06:00",
    "finishedAt": "2023-10-12T10:10:13.72024-06:00",
    "duration": 18569,
    "status": "SUCCESS",
    "request": {
        "rfc": "NKO080220554"
    },
    "response": {
        "curpRepresentanteLegal": " AISC830531MDFRSY07",
        "email": "contacto@nkonect.com",
        "estatus": "FOUND",
        "razonSocial": "NKONECT SA DE CV",
        "rfcRepresentanteLegal": "AISC830531I14"
    }
}
```

### Not found

> 📘 Status NOT FOUND
>
> If the response indicates a NOT\_FOUND status, it means that the data could not be recovered, even though the response has an HTTP code 200. This occurs because we accessed the SAT system to validate the RFC provided .
>
> For more details we suggest you see the [Possible Not Found Responses](https://docs.kiban.cloud/reference/rfc-data-pm#listing-the-possible-not-found-responses) section.

You will receive this response with an HTTP code 200 when we were able to successfully query the RFC provided to the SAT. However, no data was found registered under that RFC with the SAT.

```json Test case
{
    "id": "65281b5300e2e3f2aecec92b",
    "createdAt": "2023-10-12T10:14:11.626772-06:00",
    "finishedAt": "2023-10-12T10:14:16.158018-06:00",
    "duration": 4531,
    "status": "SUCCESS",
    "request": {
        "rfc": "KIB801010CLO"
    },
    "response": {
        "estatus": "NOT_FOUND",
        "mensaje": "No encontramos datos registrados ante el SAT"
    }
}
```

## 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   | 663567bb713cf2110a1106d5 | No encontrado     | Indicates that no information was found for the data provided |
| 2   | 663567bb713cf2110a1106d4 | 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 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](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 error responses

### Required fields

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

```json Required fields
[
    {
        "code": "EMPTY_ERROR",
        "message": "can't be empty",
        "field": "rfc"
    }
]
```

### Invalid format

You will get a 400 bad request error when the RFC does not conform the specific format.

```json Length error
[
    {
        "code": "FORMAT_ERROR",
        "message": "should be in rfc format",
        "field": "rfc"
    }
]
```

### Test case not found

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
[
    {
        "code": "EMPTY_ERROR",
        "message": "test case not found",
        "field": "testCase"
    },
    {
        "code": "EMPTY_ERROR",
        "message": "test case not found with given id",
        "field": "testCaseId"
    }
]
```

### NOT FOUND

You will get a 200 http code response when we could not find data on the SAT platform associated with the RFC provided

```json Test case
{
    "id": "65281b5300e2e3f2aecec92b",
    "createdAt": "2023-10-12T10:14:11.626772-06:00",
    "finishedAt": "2023-10-12T10:14:16.158018-06:00",
    "duration": 4531,
    "status": "SUCCESS",
    "request": {
        "rfc": "KIB801010CLO"
    },
    "response": {
        "estatus": "NOT_FOUND",
        "mensaje": "No encontramos datos registrados ante el SAT"
    }
}
```

### Length error

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

```json
[
    {
        "code": "LENGTH_ERROR",
        "message": "should be == 12",
        "field": "rfc"
    }
]
```

### 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/pm_data_from_rfc": {
      "post": {
        "summary": "Obtaining Personal Data from a PM RFC",
        "description": "Data from a RFC of a Persona Moral (PM)",
        "operationId": "rfc-data-pm",
        "parameters": [
          {
            "name": "testCaseId",
            "in": "query",
            "description": "Send the id of the test case to consume",
            "schema": {
              "type": "string",
              "default": "663567bb713cf2110a1106d4"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "RAW_BODY": {
                    "type": "string",
                    "format": "json"
                  }
                }
              },
              "examples": {
                "Request": {
                  "value": {
                    "rfc": "NKO080220554"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Success": {
                    "value": "{\n    \"id\": \"65281a530a3186c567f6b948\",\n    \"createdAt\": \"2023-10-12T10:09:55.150693-06:00\",\n    \"finishedAt\": \"2023-10-12T10:10:13.72024-06:00\",\n    \"duration\": 18569,\n    \"status\": \"SUCCESS\",\n    \"request\": {\n        \"rfc\": \"NKO080220554\"\n    },\n    \"response\": {\n        \"curpRepresentanteLegal\": \" AISC830531MDFRSY07\",\n        \"email\": \"contacto@nkonect.com\",\n        \"estatus\": \"FOUND\",\n        \"razonSocial\": \"NKONECT SA DE CV\",\n        \"rfcRepresentanteLegal\": \"AISC830531I14\"\n    }\n}"
                  },
                  "Not Found": {
                    "value": "{\n    \"id\": \"65281a7a0a3186c567f6b949\",\n    \"createdAt\": \"2023-10-12T10:10:34.324848-06:00\",\n    \"finishedAt\": \"2023-10-12T10:10:40.239286-06:00\",\n    \"duration\": 5914,\n    \"status\": \"SUCCESS\",\n    \"request\": {\n        \"rfc\": \"NKO080220553\"\n    },\n    \"response\": {\n        \"estatus\": \"NOT_FOUND\",\n        \"mensaje\": \"No encontramos datos registrados ante el SAT\"\n    }\n}"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "title": "Success",
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "65281a530a3186c567f6b948"
                        },
                        "createdAt": {
                          "type": "string",
                          "example": "2023-10-12T10:09:55.150693-06:00"
                        },
                        "finishedAt": {
                          "type": "string",
                          "example": "2023-10-12T10:10:13.72024-06:00"
                        },
                        "duration": {
                          "type": "integer",
                          "example": 18569,
                          "default": 0
                        },
                        "status": {
                          "type": "string",
                          "example": "SUCCESS"
                        },
                        "request": {
                          "type": "object",
                          "properties": {
                            "rfc": {
                              "type": "string",
                              "example": "NKO080220554"
                            }
                          }
                        },
                        "response": {
                          "type": "object",
                          "properties": {
                            "curpRepresentanteLegal": {
                              "type": "string",
                              "example": " AISC830531MDFRSY07"
                            },
                            "email": {
                              "type": "string",
                              "example": "contacto@nkonect.com"
                            },
                            "estatus": {
                              "type": "string",
                              "example": "FOUND"
                            },
                            "razonSocial": {
                              "type": "string",
                              "example": "NKONECT SA DE CV"
                            },
                            "rfcRepresentanteLegal": {
                              "type": "string",
                              "example": "AISC830531I14"
                            }
                          }
                        }
                      }
                    },
                    {
                      "title": "Not Found",
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "65281a7a0a3186c567f6b949"
                        },
                        "createdAt": {
                          "type": "string",
                          "example": "2023-10-12T10:10:34.324848-06:00"
                        },
                        "finishedAt": {
                          "type": "string",
                          "example": "2023-10-12T10:10:40.239286-06:00"
                        },
                        "duration": {
                          "type": "integer",
                          "example": 5914,
                          "default": 0
                        },
                        "status": {
                          "type": "string",
                          "example": "SUCCESS"
                        },
                        "request": {
                          "type": "object",
                          "properties": {
                            "rfc": {
                              "type": "string",
                              "example": "NKO080220553"
                            }
                          }
                        },
                        "response": {
                          "type": "object",
                          "properties": {
                            "estatus": {
                              "type": "string",
                              "example": "NOT_FOUND"
                            },
                            "mensaje": {
                              "type": "string",
                              "example": "No encontramos datos registrados ante el SAT"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Length error": {
                    "value": "[\n    {\n        \"code\": \"LENGTH_ERROR\",\n        \"message\": \"should be == 12\",\n        \"field\": \"rfc\"\n    }\n]"
                  },
                  "Empty error": {
                    "value": "[\n    {\n        \"code\": \"EMPTY_ERROR\",\n        \"message\": \"can't be empty\",\n        \"field\": \"rfc\"\n    }\n]"
                  },
                  "Format Error": {
                    "value": "[\n    {\n        \"code\": \"FORMAT_ERROR\",\n        \"message\": \"should be in rfc format\",\n        \"field\": \"rfc\"\n    }\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": "Length error",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string",
                            "example": "LENGTH_ERROR"
                          },
                          "message": {
                            "type": "string",
                            "example": "should be == 12"
                          },
                          "field": {
                            "type": "string",
                            "example": "rfc"
                          }
                        }
                      }
                    },
                    {
                      "title": "Empty error",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string",
                            "example": "EMPTY_ERROR"
                          },
                          "message": {
                            "type": "string",
                            "example": "can't be empty"
                          },
                          "field": {
                            "type": "string",
                            "example": "rfc"
                          }
                        }
                      }
                    },
                    {
                      "title": "Format Error",
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string",
                            "example": "FORMAT_ERROR"
                          },
                          "message": {
                            "type": "string",
                            "example": "should be in rfc format"
                          },
                          "field": {
                            "type": "string",
                            "example": "rfc"
                          }
                        }
                      }
                    },
                    {
                      "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"
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "application/json": {
                "examples": {
                  "Unauthorized": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```