API to validate a CFDI
Intro
With this API, you can validate if one CFDI, if it is valid and is registered on the SAT portal.
Important points
Request
To make the request it is necessary provide all the fields.
field | type | required | Description |
---|---|---|---|
monto | Numeric | Yes | numerical value greater than zero, may contain decimal point |
rfcEmisor | Alphanumeric | Yes | Indicate the RFC of the issuer. |
rfcReceptor | Alphanumeric | Yes | Indicate the RFC of the receiver. |
uuid | Alphanumeric | Yes | Indicate the uuid, the middle hyphens are allowed |
Successful response
Inside the response object you will only get the next fields.
field Name | Description |
---|---|
CodigoEstatus | It will indicate the status code of the CFDI |
EsCancelable | It will indicate if you can still cancel the CFDI |
Estado | Status of the invoice |
EstatusCancelacion | It will contain the status if the invoice cancellation was made |
ValidacionEFOS | N/A |
{
"id": "65600ac52bacd50889a58413",
"createdAt": "2023-11-24T02:30:29.444346809Z",
"finishedAt": "2023-11-24T02:30:29.713632202Z",
"duration": 269,
"status": "SUCCESS",
"request": {
"monto": 161,
"rfcEmisor": "SAS121109B14",
"rfcReceptor": "MQMJ900119U24",
"uuid": "44E5AF40-8E46-4AFE-BA70-64F5CDB4A6DC"
},
"response": {
"CodigoEstatus": "S - Comprobante obtenido satisfactoriamente.",
"EsCancelable": "Cancelable sin aceptación",
"Estado": "Vigente",
"EstatusCancelacion": "",
"ValidacionEFOS": "200"
}
}
Test the service (test cases)
We included two query params in Sandbox environment (testCase and testCaseId), so you can query test cases that we created to run tests.
In order to obtain the response you shall fill the testCase param with:
- success: it sends back a successful example of a requests.
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
Listing the possible error responses
Required fields
You will get a 400 bad request error any of the fields are not provided in the request body.
{
"monto": "FORMAT_ERROR; can't be zero or less",
"rfcEmisor": "EMPTY_ERROR; can't be empty",
"rfcReceptor": "EMPTY_ERROR; can't be empty",
"uuid": "EMPTY_ERROR; can't be empty"
}
Invalid format
You will get a 400 bad request error when the RFC does not conform the specific format.
{
"monto": "FORMAT_ERROR; should be have 2 decimal digits maximum",
"rfcEmisor": "FORMAT_ERROR; should be in rfc format",
"rfcReceptor": "FORMAT_ERROR; should be in rfc format",
"uuid": "FORMAT_ERROR; should be in uuid 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",
"testCaseId": "EMPTY_ERROR; test case not found with given id"
}
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.