Obtaining constancia de situación fiscal

Endpoint to obtain the "Constancia de situación fiscal"

Intro

This API lets you get a CSF (Constancia de Situación Fiscal) within the SAT system.

Important points

Required parameters

To make the request it is necessary to provide two parameters in the request.

fieldtyperequiredlengthDescription
rfcAlphanumericYes12-13Provide a valid RFC.
It can be an RFC of a PM with a length of 12 characters or an RFC of a PF with a length of 13 characters
passwordAlphanumericYesN/AIndicate the SAT CIEC password of the person to request.

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 to ensure that the RFC provided is correct.

Validations

The following validations are applied to the RFC parameter

  • Must be 12 or 13 characters long, depending on the type to request
  • Must comply with the format of a valid RFC

Response

You can find an examples of the different kinds of responses in the examples of the call.

CSF PDF File

You can also download the PDF file of the CSF and obtain the original file.

In order to obtain the file, you must look in the JSON response the structure called apiData->files->path

"apiData": [
    {
      "files": [
        {
          "path": "11/63dac04eb76d338acdc75b73/sat/csf/sandbox/64821d23824123766beac2be/AAAA010123AB1",
          "name": "AAAA010123AB1"
        }
      ]
    }
  ]

Once you have obtained the path, the Get File API must be called in order to obtain the PDF file.

Test the service (test cases)

We included a query param in Sandbox environment, so you can query test cases that we created to run tests.
In order to obtain the response, please fill the query param with:

  • success: it sends back a successful response

Possible Errors

Required field

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

{
    "rfc": "REQUIRED_FIELD_ERROR; EMPTY_ERROR; can't be empty",
  	"password":"REQUIRED_FIELD_ERROR; EMPTY_ERROR; can't be empty"
}

Invalid format

You will get a 400 bad request error when the rfc parameter does not comply with the correct format

{
    "rfc": "FORMAT_ERROR; invalid rfc format"
}

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

{
    "testCase": "EMPTY_ERROR; test case not found"
}

Service Unavailable

If the SAT system is not available, this endpoint will retrieve the next response:

{
    "id": "64405bb85a7fcc51545aa79b",
    "createdAt": "2023-04-19T15:23:04.834748-06:00",
    "finishedAt": "0001-01-01T00:00:00Z",
    "duration": 0,
    "status": "SERVICE_ERROR",
    "errorMessage": "error service unavailable",
    "request": {
        "curp": "ABCD970724HYNNNL07"
    }
}
Language
Authorization
Header
Click Try It! to start a request and see the response here!