The Spanish version is the authoritative reference. View in Spanish
Method to Check the Status of the Document and the Cancellation (GetStatusDocument)
To cancel a document, it is essential to know its status, since this shows whether it has already been canceled or whether it requires acceptance to be canceled. For this reason, it is crucial that the API expose both the document status query and the cancellation process.
The POST GetStatusDocument method allows checking the document's status and determining which stage of the cancellation process it is in.
To use this method, enter the URL according to the environment to be consumed:
https://developers.gosocket.net/api/v1/Document/GetStatusDocumenthttps://developers-sbx.gosocket.net/api/v1/Document/GetStatusDocumentThe method has the following parameters:
| GetStatusDocument (request) | |||
|---|---|---|---|
| Parameter | Type | Description | Allowed values |
| UUID* | String | Country-level tax identifier of the document. | UUID (36 alphanumeric characters) |
| RFCEmisor* | String | Tax ID of the document issuer. Legal Entities: 3 letters, 6 digits, and 3 alphanumeric characters (12). Individuals: 4 letters, 6 digits, and 3 alphanumeric characters (13). | Alphanumeric characters. Expected format: `[A-Z&Ñ]{3,4}[0-9]2(0[1-9] |
- Required
Request example
For this method we use Postman's Body tab.
- Select the method type. In this case, you must select POST.
- Enter the method URL.
- Enter the parameters shown in the table above with their corresponding values.
{
"UUID":"00000000-0000-0000-0000-000000000000",
"RFCEmisor":"ANJ235103JM8"
}- Press Send.
Response example
The Tax Authority responds to queries through the API as follows: Successful result: Receipt obtained successfully: Active - Non-cancelable
{
"Success": true,
"GlobalDocumentId": "00000000-0000-0000-0000-000000000000",
"CountryDocumentId": "239EF8DC-A6C7-3E87-AAC6-FF8244DE1FB5",
"OtherData": {
"EstatusCancelacion": "",
"ValidacionEFOS": "200",
"ResponseSAT": "PHExOkVudmVsb...udmVsb3BlPg==",
"StatusCode": "No cancelable",
"StatusMessage": "Vigente"
},
"Messages": null,
"ResponseValue": "PD94bWwgdmV...HJvYmFudGU+",
"Code": "200",
"Description": "S - Comprobante obtenido satisfactoriamente.",
"ErrorException": null
}Successful result: Receipt obtained successfully: Active - Cancelable without acceptance
{
"Success": true,
"GlobalDocumentId": "00000000-0000-0000-0000-000000000000",
"CountryDocumentId": "239EF8DC-A6C7-3E87-AAC6-FF8244DE1FB5",
"OtherData": {
"EstatusCancelacion": "",
"ValidacionEFOS": "200",
"ResponseSAT": "PHExOkVudmV...pFbnZlbG9wZT4=",
"StatusCode": "Cancelable sin aceptación",
"StatusMessage": "Vigente"
},
"Messages": null,
"ResponseValue": "PD94bWwgdm...m9iYW50ZT4=",
"Code": "200",
"Description": "S - Comprobante obtenido satisfactoriamente.",
"ErrorException": null
}Successful result: Receipt obtained successfully: Active - Cancelable with acceptance
{
"Success": true,
"GlobalDocumentId": "00000000-0000-0000-0000-000000000000",
"CountryDocumentId": "239EF8DC-A6C7-3E87-AAC6-FF8244DE1FB5",
"OtherData": {
"EstatusCancelacion": "",
"ValidacionEFOS": "200",
"ResponseSAT": "PHExOkVudm...ZlbG9wZT4=",
"StatusCode": "Cancelable con aceptación",
"StatusMessage": "Vigente"
},
"Messages": null,
"ResponseValue": "PGNmZGk6Q2...wcm9iYW50ZT4=",
"Code": "200",
"Description": "S - Comprobante obtenido satisfactoriamente.",
"ErrorException": null
}Successful result: Receipt obtained successfully: Canceled - Canceled without acceptance
{
"Success": true,
"GlobalDocumentId": "00000000-0000-0000-0000-000000000000",
"CountryDocumentId": "239EF8DC-A6C7-3E87-AAC6-FF8244DE1FB5",
"OtherData": {
"EstatusCancelacion": "Cancelado sin aceptación",
"ValidacionEFOS": "200",
"ResponseSAT": "PHExOkVudmVs...ZWxvcGU+",
"StatusCode": "Cancelable sin aceptación",
"StatusMessage": "Cancelado"
},
"Messages": null,
"ResponseValue": "PD94bWwg...b2JhbnRlPg==",
"Code": "200",
"Description": "S - Comprobante obtenido satisfactoriamente.",
"ErrorException": null
}Successful result: Receipt obtained successfully: Canceled - Deadline expired
{
"Success": true,
"GlobalDocumentId": "00000000-0000-0000-0000-000000000000",
"CountryDocumentId": "239EF8DC-A6C7-3E87-AAC6-FF8244DE1FB5",
"OtherData": {
"EstatusCancelacion": "Plazo vencido",
"ValidacionEFOS": "200",
"ResponseSAT": "PHExOkVu...2ZWxvcGU+",
"StatusCode": "Cancelable con aceptación",
"StatusMessage": "Cancelado"
},
"Messages": null,
"ResponseValue": "PD94bWw...JvYmFudGU+",
"Code": "200",
"Description": "S - Comprobante obtenido satisfactoriamente.",
"ErrorException": null
}Successful result: Receipt not found: Not found
{
"Success": true,
"GlobalDocumentId": "00000000-0000-0000-0000-000000000000",
"CountryDocumentId": "239EF8DC-A6C7-3E87-AAC6-FF8244DE1FB5",
"OtherData": {
"EstatusCancelacion": "",
"ValidacionEFOS": "",
"ResponseSAT": "PHExOkVudm...nZlbG9wZT4=",
"StatusCode": "",
"StatusMessage": "No Encontrado"
},
"Messages": null,
"ResponseValue": "PD94bWwg...9iYW50ZT4=",
"Code": "99",
"Description": "N - 602: Comprobante no encontrado.",
"ErrorException": null
}If the sending result is NOT successful, the Inbox API will respond with an error message: Document not found in the database:
{
"Success": false,
"GlobalDocumentId": "00000000-0000-0000-0000-000000000000",
"CountryDocumentId": null,
"OtherData": {
"StatusCode": "500",
"StatusMessage": null
},
"Messages": null,
"ResponseValue": null,
"Code": "500",
"Description": "Documento no encontrado",
"ErrorException": null
}Company not active to consume the method:
{
"Success": false,
"GlobalDocumentId": "00000000-0000-0000-0000-000000000000",
"CountryDocumentId": null,
"OtherData": null,
"Messages": null,
"ResponseValue": "Permis Required",
"Code": "500",
"Description": "Empresa no activa para utilizar el evento CancelFunction",
"ErrorException": null
}Interpreting the Response
To correctly interpret the response, take into account the following criteria:
| GetStatusDocument (response) | |||
|---|---|---|---|
| Parameter | Type | Description | Allowed values |
| Success | Boolean | Indicates whether the request executed successfully. | true: The request executed successfully. false: The request executed with some inconsistency. |
| GlobalDocumentId | String | null | 00000000-0000-0000-0000-000000000000 |
| CountryDocumentId | String | Tax identifier of the queried document (UUID). | null Queried UUID (36 alphanumeric characters). |
| OtherData | String | Additional properties depending on the country and the method. | |
| OtherData.EstatusCancelacion | String | Status of the cancellation request | * In process * Canceled without acceptance * Canceled with acceptance * Request Rejected * Deadline Expired * null |
| OtherData.ValidacionEFOS | String | Status of the issuing taxpayer on the EFOS list | * 100 * 200 |
| OtherData.ResponseSAT | String | XML with SAT's response for the queried document | Base64-encoded XML |
| OtherData.StatusCode | String | Cancellation conditions | * Cancelable without acceptance * Cancelable with acceptance * Non-cancelable |
| OtherData.StatusMessage | String | Receipt status | * Active * Canceled * Not found |
| Messages | String | null | null |
| ResponseValue | String | Response from the queried service in base64-encoded XML format. | Base64-encoded XML |
| Code | String | Response code for the process | * 99: Receipt not found * 200: Receipt obtained successfully * 404: document not found in Inbox |
| Description | String | Indicates whether the receipt was found or if there is a problem with the query | * N 601: The provided printed expression is not valid. * N 602: Receipt not found * S Receipt obtained successfully |
| ErrorException | String | null | null |