Cancelation of the electronic document supporting Retentions and Payment Information
This service allows requesting the fiscal cancelation to the SAT of the electronic documents supporting Retentions and Payment Information.
Content
- General Features
- Requirements to cancel an electronic document supporting Retentions and Payment Information
- Integration
-
Cancelation Web Service for Electronic Documents supporting Retentions and Payment Information
- What do I need?
- Service Location
- Method [
Cancelar
]: Cancelation of fiscal folios - Request to Cancelar
- Response from Cancelar
- Method [
CancelarSolicitudFirmada
]: Cancelation with a signature of origin - Request to CancelarSolicitudFirmada
- Response from CancelarSolicitudFirmada
- Method [
GetTransactionStatusDetail
]: Consultation of results per batch - Request to GetTransactionStatus
- Response from GetTransactionStatus
- Response Codes of SAT Cancelation
General Features
In the scheme of digital fiscal receipts for the Electronic Document supporting Retentions and Payment Information, the SAT keeps in its central database all the digital fiscal receipts that had been certified by the certification providers of CFDI. Due to this centralized model, the cancelation of the Electronic Document supporting Retentions and Payment Information is basically asking the SAT to cancel the fiscal receipt.
The cancelation of the Electronic Document supporting Retentions and Payment Information can be requested in the SAT electronic invoice portal by the issuer taxpayer directly or through an Authorized Certification Provider (PAC) as Sovos. During this procedure, the SAT can approve or reject the cancelation request.
Sovos offers the service to perform the cancelation of the Electronic Document supporting Retentions and Payment Information to the SAT. The service has an immediate response from the SAT indicating that the cancelation request has been received, however, it is necessary to perform additional consultation to know the status of the fiscal folio requesting to be canceled.
Requirements to cancel an Electronic Document supporting Retentions and Payment Information
To perform the cancelation of an electronic document of retentions it is necessary to have the following elements:
- The fiscal folio (UUID), the RFC of the issuer from the receipt to be canceled, and the reason for cancelation of that receipt. The first two data can be extracted from the electronic document of retentions, either from the XML document or from the printed representation PDF. The reason for cancelation must correspond to the permitted values specified by the authority (
01
- Receipt issued with relation errors,02
- Receipt issued with non-related errors,03
- Operation was not performed,04
- Nominative operation related to a Global Invoice). -
The Digital Seal Certificate (CSD) from the issuer of the valid receipt.
The CSD usually has three parts:
- The Certificate, which is a file with extension
.cer
- The private key, which is a file with extension
.key
- The password from the private key.
- The Certificate, which is a file with extension
To obtain a digital seal certification (CSD) from the SAT, review the requirements and the procedure in the SAT portal: How to request a Digital Seal Certificate (CSD).
Integration
There are two ways of integration to deliver the cancelation requests to Sovos:
- Web Service of Cancelation
- Integration file
To generate the integration file for the Electronic Document supporting Retentions and Payment Information, please check this guide: Integration File for cancelation retentions.
Cancelation Web Service for the Electronic Documents supporting Retentions and Payment Information
There are several methods to request the cancelation. The methods are the following:
- Cancelar - It allows the cancelation request from 1 up to 10,000 fiscal folios. The SAT performs the cancelation procedure in an asynchronous way, obtaining as a response, a tracking Id.
- CancelarSolicitudFirmada - It allows the cancelation request from 1 up to 10,000 fiscal folios previously signed with the Digital Seal Certificate of the issuer.
- GetTransactionStatusDetail - It allows to consult the content detail of the batch to cancel.
What do I need?
To use the cancelation web service, you will need:
- A service contract with Sovos: this is an identifier that helps you to authenticate in the platform Web Services. To know how to generate an API Key, see this article: Generating an API Key for Web Services.
- To have an API Key on your Sovos Mexico account: this is an identifier that helps you to authenticate in the platform Web Services. To know how to generate an API Key, see this article: Generating an API Key for Web Services.
Service Location
The URLs for each environment are:
Cancelation
Sovos perform the cancelation request to the SAT of one or several fiscal folios (UUID) by following the next steps:
- Sovos generates the structure (XML) defined by the SAT to request the cancelation.
- Sovos signs the cancelation request with the CSD of the issuer.
- Sovos sends the request to the SAT.
You have to use the Web Service method Cancelar
and the result of the cancelation request will be a tracking Id that can be used in the method GetTransactionStatusDetail
.
If you do not want to give Sovos the Digital Seal Certificate (CSD) of the company requesting the cancelation, you can use the Web Service method CancelarSolicitudFirmada
where you should create the structure defined by the SAT on Anexo 20 for cancelations. Sign the requisition with the CSD of the issuer of the fiscal folios and send it to the web service of Sovos. In this way, Sovos can send the cancelation request to the SAT. The result of this method will also be a tracking Id that can be used in the method GetTransactionStatusDetail
.
Method [Cancelar
]: Cancelation of fiscal folios.
On this method, you can perform the cancelation request for the fiscal folio of an electronic document supporting retentions and payment information. To use this method, the CSD must be registered at Sovos to sign the cancelation request.
Cancelation Request
Element | Use | Description |
---|---|---|
ApiKey | Required | Authentication Id, generated at the Sovos Portal. |
RFC | Required | Indicates if the RFC which issues the receipt with the fiscal folio and indicates the Digital Seal Certificate that will be used for the electronic signature of the cancelation request. |
Folios | Required | Array of CancelFolioRetencion:
|
Request Example:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cus="http://www.reachcore.com/CFDI/customHeaders" xmlns:urn="urn:reachcore.com:services:api:ws:pacservices:6.0">
<soapenv:Header>
<cus:ApiKey>?</cus:ApiKey>
</soapenv:Header>
<soapenv:Body>
<urn:CancelacionRetencionesRequest>
<urn:RFC>WATM640917J45</urn:RFC>
<urn:Folios>
<urn:CancelFolioRetencion>
<urn:UUID>1569bfcf-bbaf-49db-9337-fb4cf3aaf3af</urn:UUID>
<urn:Reason>02</urn:Reason>
</urn:CancelFolioRetencion>
</urn:Folios>
</urn:CancelacionRetencionesRequest>
</soapenv:Body>
</soapenv:Envelope>
Cancelation Response
Element | Description |
---|---|
Error | If the element OnError has the value true, it will show the error description through an XML structure with the nodes Code and Message . Errors are related with the cancelation request, not with the content of the request itself. |
OnError | false : Successful transaction. true : Error processing the request. |
TrackingId | If the element OnError has the value false, it will show a tracking Id for the operation. |
Example of a response with errors:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CancelacionRetencionesResponse xmlns="urn:reachcore.com:services:api:ws:pacservices:6.0">
<Error>
<Code>AuthenticationFailed</Code>
<Message>Credenciales inválidas.</Message>
<InnerErrors>
<Error>
<Code>101</Code>
<Message>API Key no válida.</Message>
<Target>Cancelacion Retenciones</Target>
</Error>
</InnerErrors>
</Error>
<OnError>false</OnError>
<TrackingId>fda4a123-7c1d-412a-a862-573416e62759</TrackingId>
</CancelacionRetencionesResponse>
</s:Body>
</s:Envelope>
Example of a response with no errors:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CancelacionRetencionesResponse xmlns="urn:reachcore.com:services:api:ws:pacservices:6.0">
<OnError>false</OnError>
<TrackingId>a537ad4a-29ef-400a-a990-f4a9bf053a58</TrackingId>
</CancelacionRetencionesResponse>
</s:Body>
</s:Envelope>
Method [CancelarSolicitudFirmada
]: Cancelation with no signature of origin
This method is used when it is not possible to register the Digital Seal Certificate (CSD) in the issuance portal of Sovos. The XML of the cancelation request signed with the CSD of the issuer must be sent in the request according to what has been defined by the SAT for the retention's cancelation requests. As in the method Cancelar
, the successful answer of the service will have a tracking Id that can be used in the method GetTransactionStatusDetail
.
Request CancelarSolicitudFirmada
Element | Use | Description |
---|---|---|
ApiKey | Required | Authentication Id generated at the Sovos Mexico portal. |
SolicitudFirmada | Required | Cancelation Request XML according to what has been specified by the SAT, indicates the fiscal folio to be canceled, issuer’s RFC, operation time, the reason for cancelation, and if applicable, substitution folio. This XML must be electronically signed with the private key of the issuer. For reference about the signing, please check Cancelation Request Signature of a CFDI and Retentions. Cancelation Request Signature of a CFDI and Retentions <![CDATA[...]]> . |
Request Example:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cus="http://www.reachcore.com/CFDI/customHeaders" xmlns:urn="urn:reachcore.com:services:api:ws:pacservices:6.0">
<soapenv:Header>
<cus:ApiKey>?</cus:ApiKey>
</soapenv:Header>
<soapenv:Body>
<urn:CancelarSolicitudFirmadaRetencionesRequest>
<urn:SolicitudFirmada><![CDATA[<Cancelacion xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Fecha="2021-12-22T19:44:12" RfcEmisor="EKU9003173C9" xmlns="http://www.sat.gob.mx/esquemas/retencionpago/1"><Folios><Folio UUID="FE89B270-B48E-4B2A-A595-E792A779C0FD" Motivo="02"/</Folios><Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><DigestValue>Gp9EaIik0WOwKmieXClhi+YsjYg=</DigestValue></Reference></SignedInfo><SignatureValue>HjGYFBQszrLyWqpn+VoYIPf5VvWVrtfFIsTovDay+vsUNz7jjDj3bjDFkDfWJ4kmdwY9ENyBIaEIoi13qEBZjKi46b0Udjdy/mrlqwEJRRFzL3+IDX6NLQnqZDRGV8/G8WnMzjo/wT6ijicP4w7TbcmX2Gw0oysJR0/Wif5AA+w/RAdCDs3XjEwJydNDhP033Y9JFL28s3rGCG5BkSCsTmu20/O+Q6Kca+BtPqPbktQ8LRFIxgOsRwqBdvUZF/n7fkzzA1A6Yt8WSG53ofOdd6b8U35fCw65TA4DILZxsZOJDhNKSKjRFawo+ZWZxLh8PD6xMOQimAWYuJg7gtJv1Q==</SignatureValue><KeyInfo><X509Data><X509IssuerSerial><X509IssuerName>OID.1.2.840.113549.1.9.2=responsable: ACDMA-SAT, OID.2.5.4.45=2.5.4.45, L=COYOACAN, S=CIUDAD DE MEXICO, C=MX, PostalCode=06370, STREET=3ra cerrada de cadiz, E=oscar.martinez@sat.gob.mx, OU=SAT-IES Authority, O=SERVICIO DE ADMINISTRACION TRIBUTARIA, CN=AC UAT</X509IssuerName><X509SerialNumber>292233162870206001759766198444326234574038512436</X509SerialNumber></X509IssuerSerial><X509Certificate>MIIFuzCCA6OgAwIBAgIUMzAwMDEwMDAwMDA0MDAwMDI0MzQwDQYJKoZIhvcNAQELBQAwggErMQ8wDQYDVQQDDAZBQyBVQVQxLjAsBgNVBAoMJVNFUlZJQ0lPIERFIEFETUlOSVNUUkFDS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MBAAGjHTAbMAwGA1UdEwEB/wQCMAAwCwYDVR0PBAQDAgbAMA0GCSqGSIb3DQEBCwUAA4ICAQBcpj1TjT4jiinIujIdAlFzE6kRwYJCnDG08zSp4kSnShjxADGEXH2chehKMV0FY7c4njA5eDGdA/G2OCTPvF5rpeCZP5Dw504RZkYDl2suRz+wa1sNBVpbnBJEK0fQcN3IftBwsgNFdFhUtCyw3lus1SSJbPxjLHS6FcZZ51YSeIfcNXOAuTqdimusaXq15GrSrCOkM6n2jfj2sMJYM2HXaXJ6rGTEgYmhYdwxWtil6RfZB+fGQ/H9I9WLnl4KTZUS6C9+NLHh4FPDhSk19fpS2S/56aqgFoGAkXAYt9Fy5ECaPcULIfJ1DEbsXKyRdCv3JY89+0MNkOdaDnsemS2o5Gl08zI4iYtt3L40gAZ60NPh31kVLnYNsmvfNxYyKp+AeJtDHyW9w7ftM0Hoi+BuRmcAQSKFV3pk8j51la+jrRBrAUv8blbRcQ5BiZUwJzHFEKIwTsRGoRyEx96sNnB03n6GTwjIGz92SmLdNl95r9rkvp+2m4S6q1lPuXaFg7DGBrXWC8iyqeWE2iobdwIIuXPTMVqQb12m1dAkJVRO5NdHnP/MpqOvOgLqoZBNHGyBg4Gqm4sCJHCxA1c8Elfa2RQTCk0tAzllL4vOnI1GHkGJn65xokGsaU4B4D36xh7eWrfj4/pgWHmtoDAYa8wzSwo2GVCZOs+mtEgOQB91/g==</X509Certificate></X509Data></KeyInfo></Signature></Cancelacion>]]></urn:SolicitudFirmada>
</urn:CancelarSolicitudFirmadaRetencionesRequest>
</soapenv:Body>
</soapenv:Envelope>
Response CancelarSolicitudFirmada
Element | Description |
---|---|
OnError | false : successful transaction. true : Error processing the request. |
Error | Array of Nodes ErrorCode (indicates the error code) and ErrorMessage (error description) with the error detail |
TrackingId | If the element OnError has the value false, it will show a tracking Id of the operation. |
Response example:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CancelarSolicitudFirmadaRetencionesResponse xmlns="urn:reachcore.com:services:api:ws:pacservices:6.0">
<OnError>false</OnError>
<TrackingId>ec2fc4c0-933d-4ab3-bace-86027373c6b5</TrackingId>
</CancelarSolicitudFirmadaRetencionesResponse>
</s:Body>
</s:Envelope>
Method [GetTransactionStatusDetail
]: Consulting results per batch
Here you can know the status of the batch related to the cancelation request, whether through Web Service or per integration file.
Important
The service of consulting results per retentions batch cannot provide the final status of the retentions document, it will only list the key codes provided by the SAT. Once the cancelation request is sent to the SAT if the SAT response is a code 1202 or 1202 the status of the retentions document is assumed to be canceled.
Example of a Status Request for a cancelation batch
Element | Use | Description |
---|---|---|
ApiKey | Required | Authentication Id generated at Sovos Mexico portal. |
TrackingId | Required | Tracking Id for the procedure. You obtain this Id through a call, before the operation Cancelar , or as a response to a flat text file. |
Request Example:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cus="http://www.reachcore.com/CFDI/customHeaders" xmlns:urn="urn:reachcore.com:services:api:ws:pacservices:6.0">
<soapenv:Header>
<cus:ApiKey>?</cus:ApiKey>
</soapenv:Header>
<soapenv:Body>
<urn:TransactionStatusRetencionesRequest>
<urn:TrackingId>a537ad4a-29ef-400a-a990-f4a9bf053a58</urn:TrackingId>
</urn:TransactionStatusRetencionesRequest>
</soapenv:Body>
</soapenv:Envelope>
Response Example to a Status Request of a cancelation batch
Element | Description |
---|---|
OnError | false : successful transaction.true : Error processing the request. |
ErrorMessage | In case the element OnError has the value true, an XML structure with the description will be shown with the nodes Code and Message . |
TotalUUIDs | Total of the fiscal folios from the batch. |
UUIDsCanceled | Fiscal folios whose status is Canceled. |
UUIDsRejectedSAT | Fiscal folios than cannot be canceled by SAT mandate. |
UUIDs | Arrangement of the object TransactionDetailUUIDRetencionResponse , which is integrated by:
|
A batch is on an ended status when each of the receipts we request to be canceled is in one of the following statuses:
- Successfully delivered to the SAT (codes 1202 and 1202).
- Cannot be canceled because SAT responded with a final rejection. The final rejection reasons are the ones listed as non-retriable in the section SAT Response Codes for Cancelation.
Response Example
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<TransactionStatusRetencionesResponse xmlns="urn:reachcore.com:services:api:ws:pacservices:6.0">
<OnError>false</OnError>
<TotalUUIDs>1</TotalUUIDs>
<UUIDsCanceled>1</UUIDsCanceled>
<UUIDsRejectedSAT>0</UUIDsRejectedSAT>
<UUIDs>
<TransactionDetailUUIDRetencionResponse>
<UUID>a5ca7614-f613-4930-b385-39b1f0ceb3ee</UUID>
<Canceled>true</Canceled>
<ResultCode>1201</ResultCode>
</TransactionDetailUUIDRetencionResponse>
</UUIDs>
</TransactionStatusRetencionesResponse>
</s:Body>
</s:Envelope>
SAT Response Codes for cancelation
For every cancelation operation of a receipt, the SAT authorizes or rejects specifying a status code. On the next two tables you can find the statuses description and their meaning.
Success codes
Code | Description | Meaning |
---|---|---|
1201 | Cancelation Request received | The cancelation request for the receipt has been received by the SAT. |
1202 | UUID previously canceled | The receipt was already canceled, and its status did not change. |
Error codes
Code | Description | Meaning | Retriable? | What to do? |
---|---|---|---|---|
1203 | UUID not found or does not match the issuer | The fiscal folio requested to be canceled is not found, or it was not issued with the specified RFC. | No | Provide the correct RFC of the issuer for that receipt and make a new request. |
1205 | UUID does not exist | The SAT has not published the receipt in its portal yet, therefore it cannot be canceled. | Yes | Make sure the receipt is already delivered to the SAT and retry the cancelation. |
1301 | XML wrong formatted | The XML issued to the SAT is not corrected formatted (This is only applicable for a cancelation with a signature of origin). | No | Verify that the cancelation request was created according to the technique described in this document. |
1302 | Folio structure not valid | Some of the fiscal folios (UUID) do not fulfill the regular expression of a UUID. | Yes | Verify that the fiscal folio (UUID) is formatted correctly. |
1303 | RFC structure not valid | The RFC format does not match the expected (This is only applicable for a cancelation with a signature of origin). | No | Review the RFC sent on the cancelation request. |
1304 | The date structure is not valid | The data format does not match the expected (This is only applicable for a cancelation with a signature of origin). | No | Review the data format on the cancelation request. |
1305 | The certificate doesn't match the issuer | The RFC does not match the one used for the XML signature (This is only applicable for a cancelation with a signature of origin). | No | Verify that the cancelation request was signed with the correct digital seal certificate. |
1306 | Certificate not valid | The certificate used to sign the cancelation request is not valid. | No | Use a valid digital seal certificate |
1307 | Use of e.firma (e.signature) is not allowed | The certificate used to sign the cancelation request is an e.firma | No | Use or ask for a digital seal certificate to sign the cancelation requests. |
1308 | Revoked or expired certificate | The digital seal certificate used to sign the cancelation request has been revoked or is expired. | No | Ask the SAT for a new digital seal certificate and request the cancelation again with this new certificate. |
1309 | Signature wrong formatted or not valid | This applies only to CancelarSolicitudFirmada . It indicates that the structure XML with the list of UUID to be canceled has a wrong formatted signature or is invalid. |
No | Review the generation process of the XML signature with the list of fiscal folios to cancel. |
1310 | Cancelation reason code not valid | The authority has established that the reason for cancelation is not correct. Sovos does not know the reason for the cancelation expected by the authority, so you will have to send a new request with a different reason. | No | Verify the information given for the cancelation of the retentions document. |
1311 | UUID is not related to the cancelation code | The authority has established that the UUID specified as a substitution folio is not related to the UUID that we want to cancel. You will have to send a new request with a cancelation reason different from the previous one or remove the substitution folio of the UUID that you want to cancel. | No | Verify the information given for the cancelation of the retentions document. |
1312 | Substitution folio non-required | You are sending a Substitution folio on the cancelation request, and it is not required for cancelation. | No | Modify the cancelation request and do not specify the substitution folio. |
1313 | Request out of the annual declaration | The cancelation request is out of the period allowed to request it. | No | |
1314 | Non-valid relation | The key in the attribute MotivoCancelacion is not valid according to the allowed values. |
No | Review that the given code is one of the values 01 , 02 , 03 , or 04 . |
For more information or to clarify doubts about this guide, please send an email to MEX-soporte@sovos.com. You can also check the FAQ at the following link: Cancelation FAQ
Regresar