Skip to main content

The Spanish version is the authoritative reference. View in Spanish

Method to Query Documents Pending Cancellation (GetPendingCancelRequest)

When the CFDI requires acceptance to be canceled, the API allows checking whether the receiver has documents pending cancellation.

To identify documents with a pending cancellation request, the POST GetPendingCancelRequest method can be used.

To use this method, enter the URL according to the environment to be consumed:

PRODUCTIONhttps://developers.gosocket.net/api/v1/Document/GetPendingCancelRequest
SANDBOXhttps://developers-sbx.gosocket.net/api/v1/Document/GetPendingCancelRequest

The method has the following parameters:

GetPendingCancelRequest (request)
ParameterTypeDescriptionAllowed values
RFCReceptor*StringTax ID of the document receiver.

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.

  1. Select the method type. In this case, you must select POST.
  2. Enter the method URL.
  3. Enter the parameters shown in the table above with their corresponding values.
{
"RFCReceptor":"ANJ235103JM8"
}
  1. Press Send.

Response example

The Tax Authority responds to queries through the API as follows: Successful result: No pending requests exist for the queried RFC

{
"Success": true,
"GlobalDocumentId": "00000000-0000-0000-0000-000000000000",
"CountryDocumentId": null,
"OtherData": {},
"Messages": [
"0"
],
"ResponseValue": null,
"Code": "1101",
"Description": "No existen peticiones para el RFC Receptor",
"ErrorException": null
}

Successful result: With pending requests

{
"Success": true,
"GlobalDocumentId": "00000000-0000-0000-0000-000000000000",
"CountryDocumentId": null,
"OtherData": {
"Uuids": "{\"Uuid\":[\"239EF8DC-A6C7-3E87-AAC6-FF8244DE1FB5\"]}"
},
"Messages": [
"0"
],
"ResponseValue": null,
"Code": "1100",
"Description": "Se obtuvieron las peticiones del RFC Receptor de forma exitosa",
"ErrorException": null
}

If the sending result is NOT successful, the Inbox API will respond with an error message: 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
}

Error with the client certificate:

{
"Success": false,
"GlobalDocumentId": "00000000-0000-0000-0000-000000000000",
"CountryDocumentId": null,
"OtherData": null,
"Messages": [
"Regla: Error de Certificado, verifique el certificado y reintente nuevamente. Failed to load certificate after retries"
],
"ResponseValue": null,
"Code": "500",
"Description": null,
"ErrorException": null
}

Error with the client certificate:

{
"Success": false,
"GlobalDocumentId": "00000000-0000-0000-0000-000000000000",
"CountryDocumentId": null,
"OtherData": null,
"Messages": [
"Regla: Error de Certificado, verifique el certificado y reintente nuevamente. .Cer or .Key estan vacios para el accountCode: ANJ235103JM8"
],
"ResponseValue": null,
"Code": "500",
"Description": null,
"ErrorException": null
}

Interpreting the Response

To correctly interpret the response, take into account the following criteria:

GetPendingCancelRequest (response)
ParameterTypeDescriptionAllowed values
SuccessBooleanIndicates whether the request executed successfully.true: The request executed successfully. false: The request executed with some inconsistency.
GlobalDocumentIdStringnull00000000-0000-0000-0000-000000000000
CountryDocumentIdStringnullnull
OtherDataStringList of documents with a pending cancellation request.null or an object with the Uuids property.
OtherData.UuidsStringNode containing information for the UUID(s) with a pending cancellation request.Example: {"Uuid":["239EF8DC-A6C7-3E87-AAC6-FF8244DE1FB5"]}
MessagesStringGlobal invocation code. A value of 0 (zero) indicates the invocation was successful; otherwise it indicates the reason for the problem.Example: "0"
ResponseValueStringnullnull
CodeStringResponse code for the process* 1100: The Receiver RFC's requests were retrieved successfully * 1101: No requests exist for the Receiver RFC
DescriptionStringIndicates the description of the process response code* 1100: The Receiver RFC's requests were retrieved successfully * 1101: No requests exist for the Receiver RFC
ErrorExceptionStringnullnull