Servicio que permite cancelar facturas de retenciones e información de pagos a través de un Web Service. Esto se realiza enviando un archivo XML o utilizando Certificados de Sellos Digitales (CSD).
🛠Url Pruebas : https://pruebascfdi.smartweb.com.mx
🧰 Url Producción : https://cfdi.smartweb.com.mx
CancelaUno()
Método utilizado para la cancelación de un único UUID.
Endpoint
Método | Ruta |
---|---|
POST | /Cancelacion/CancelacionRetencion.svc |
Header
Header | Value |
---|---|
SOAPAction | http://tempuri.org/ICancelacionRetencion/CancelaUno |
Content-Type | text/xml; charset=utf-8 |
Parámetros Body
Propiedad | Uso | Descripción |
---|---|---|
xmlCancelacion | Requerido | XML de Cancelación de Retenciones. |
tokenAutenticacion | Requerido | Bearer Token |
Ejemplo Request
curl --location --request POST 'http://pruebascfdi.smartweb.com.mx/Cancelacion/CancelacionRetencion.svc' \ --header 'Content-Type: text/xml; charset=utf-8' \ --header 'SOAPAction: http://tempuri.org/ICancelacionRetencion/CancelaUno' \ --data-raw '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"> <soapenv:Header/> <soapenv:Body> <tem:CancelaUno> <!--Optional:--> <tem:tokenAutenticacion>T2lYQ0t4...</tem:tokenAutenticacion> <!--Optional:--> <tem:xmlCancelacion><![CDATA[<Cancelacion xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Fecha="2022-09-06T23:18:45" RfcEmisor="EKU9003173C9" xmlns="http://www.sat.gob.mx/esquemas/retencionpago/1"><Folios><Folio UUID="f5d3c8cf-1dfc-41cc-9b38-363c70282d55" Motivo="02" FolioSustitucion="" /></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>T4tgeJTgDNUJvrorZboNYuAbIZo=</DigestValue></Reference></SignedInfo><SignatureValue>cdy2p/DZHMcSZOfbgUCe2/5wxcqxfElIdeY7G9IpmKhKK+9wjI6jOJPVJ4nhGA54f1RFaQEOwC1mwprPYMtFgItb5WgGpVpmR3vjdZqkEAcYLgvNiOoDq/noJWyywN75l+uq9WLrS7tcokGhibwbrnpFrVUZjEOoOUUEWzZjqdDfZtQIcMfKxAvEe92XV5WJqAvc6OnUOiBp0K1NEjrEnXix1Fi8Xjvod8nG/aJ7N+SD7hQ4ckMddB9qEjZlrsBvPSQygjoYOG2rV4YXkOCdpTsAISXSsPOl3QdIOBTR+Kakdi7TwJ6o8V66MYnUOreTYjdbUhRb+71r3kZNFAH0Sw==</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>MIIFuzCCA6OgAwIBAgIUMzAwMDEwMDAwMDA0MDAwMDI0MzQwDQYJKoZIhvcNAQELBQAwggErMQ8wDQYDVQQDDAZBQyBVQVQxLjAsBgNVBAoMJVNFUlZJQ0lPIERFIEFETUlOSVNUUkFDSU9OIFRSSUJVVEFSSUExGjAYBgNVBAsMEVNBVC1JRVMgQXV0aG9yaXR5MSgwJgYJKoZIhvcNAQkBFhlvc2Nhci5tYXJ0aW5lekBzYXQuZ29iLm14MR0wGwYDVQQJDBQzcmEgY2VycmFkYSBkZSBjYWRpejEOMAwGA1UEEQwFMDYzN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Rz+wa1sNBVpbnBJEK0fQcN3IftBwsgNFdFhUtCyw3lus1SSJbPxjLHS6FcZZ51YSeIfcNXOAuTqdimusaXq15GrSrCOkM6n2jfj2sMJYM2HXaXJ6rGTEgYmhYdwxWtil6RfZB+fGQ/H9I9WLnl4KTZUS6C9+NLHh4FPDhSk19fpS2S/56aqgFoGAkXAYt9Fy5ECaPcULIfJ1DEbsXKyRdCv3JY89+0MNkOdaDnsemS2o5Gl08zI4iYtt3L40gAZ60NPh31kVLnYNsmvfNxYyKp+AeJtDHyW9w7ftM0Hoi+BuRmcAQSKFV3pk8j51la+jrRBrAUv8blbRcQ5BiZUwJzHFEKIwTsRGoRyEx96sNnB03n6GTwjIGz92SmLdNl95r9rkvp+2m4S6q1lPuXaFg7DGBrXWC8iyqeWE2iobdwIIuXPTMVqQb12m1dAkJVRO5NdHnP/MpqOvOgLqoZBNHGyBg4Gqm4sCJHCxA1c8Elfa2RQTCk0tAzllL4vOnI1GHkGJn65xokGsaU4B4D36xh7eWrfj4/pgWHmtoDAYa8wzSwo2GVCZOs+mtEgOQB91/g==</X509Certificate></X509Data></KeyInfo></Signature></Cancelacion>]]> </tem:xmlCancelacion> </tem:CancelaUno> </soapenv:Body> </soapenv:Envelope>' '
Ejemplo Response
<s:envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:body> <cancelaunoresponse xmlns="http://tempuri.org/"> <cancelaunoresult><?xml version="1.0"?><Acuse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Fecha="2022-09-13T21:51:18.5159115" RfcEmisor="EKU9003173C9" WorkProcessId="32553413-8d26-463d-af27-876c225d0aee" xmlns="http://www.sat.gob.mx/esquemas/retencionpago/1"><Folios><UUID>F5D3C8CF-1DFC-41CC-9B38-363C70282D55</UUID><EstatusUUID>1202</EstatusUUID><Motivo>02</Motivo></Folios><Signature Id="SelloSAT" 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/2001/04/xmldsig-more#hmac-sha512" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116"><XPath>not(ancestor-or-self::*[local-name()='Signature'])</XPath></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha512" /><DigestValue>xPUDIZZcAn1bgCQ5wamNauK/ga78wIVJl4kCRODQdtW0fTT0rqwKYzszfa1UL7IUDYeKPKxD1e9+CXwEIe/Eow==</DigestValue></Reference></SignedInfo><SignatureValue>o4sp0T2BktRa+B9k/092SXx9zpavj+Yv+i3qnw4tn/K7HTaqmyBOTHm9jzU5MV3Idq37ZubsItnip/kDWOiI9Q==</SignatureValue><KeyInfo><KeyName>30001000000400001215</KeyName><KeyValue><RSAKeyValue><Modulus>nbtVtkPquCMLdpgeClMrTmxzCjyjn8P9YrBlW9jXC/FcXozIYHvzctK1pRxRxLTKlChc9fjluht9ffDfGOWim/4AlTrCiG6om7ItkHbLGMQrABp8qGY+SPmq1xtZ7qbbgoTFCtzP3pN9Z4uSDhdnrF2655sdmDzHJYE9MirNLM4SIdSFsabA31CCAMaWpB4TO6ZmExLp+wUiUyeIFWswc5G5KvmS/lU5tbXLK7zBDDUVjN0K1r/0iaZIZzPMxQcgfgYBrfLGZ3916MkmF28iBk5l1sfNTKS9S445QHKc+6oTP4UDDnjN/K14YWX449BAMxKcelEpjZlBQs1a1eNVcQ==</Modulus><Exponent>AQAB</Exponent></RSAKeyValue></KeyValue></KeyInfo></Signature></Acuse></cancelaunoresult> </cancelaunoresponse> </s:body> </s:envelope>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <s:Fault> <faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</faultcode> <faultstring xml:lang="en-US">There is an error in XML document (1, 2).</faultstring> <detail> <ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <HelpLink i:nil="true"/> <InnerException> <HelpLink i:nil="true"/> <InnerException i:nil="true"/> <Message><Cancelacion xmlns='ttp://www.sat.gob.mx/esquemas/retencionpago/1'> was not expected.</Message> <StackTrace> at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderCancelacion.Read18_Cancelacion()</StackTrace> <Type>System.InvalidOperationException</Type> </InnerException> <Message>There is an error in XML document (1, 2).</Message> <StackTrace> at SuFacturacion.WebServices.WSGeneral.guardarBitacoraErrorCancelacionRetencion(Cancelacion cancelacion, Exception ex, String _nSmetodo) in D:\a\1\s\SuFacturacion.WebServices\WSGeneral\WSGeneral.cs:line 742
 at SuFacturacion.WebServices.Cancelacion.CancelacionRetencion.CancelaUnoProcess(String tokenAutenticacion, String xmlCancelacion) in D:\a\1\s\SuFacturacion.WebServices\Cancelacion\CancelacionRetencion.svc.cs:line 108
 at SuFacturacion.WebServices.Cancelacion.CancelacionRetencion.CancelaUno(String tokenAutenticacion, String xmlCancelacion) in D:\a\1\s\SuFacturacion.WebServices\Cancelacion\CancelacionRetencion.svc.cs:line 27
 at SyncInvokeCancelaUno(Object , Object[] , Object[] )
 at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
 at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
 at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
 at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)
 at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace> <Type>System.InvalidOperationException</Type> </ExceptionDetail> </detail> </s:Fault> </s:Body> </s:Envelope>
CancelaUnoCSD()
Método utilizado para la cancelación de un único UUID utilizando el certificado y llave privada del emisor.
Endpoint
Método | Ruta |
---|---|
POST | /Cancelacion/CancelacionRetencion.svc |
Header
Header | Value |
---|---|
SOAPAction | http://tempuri.org/ICancelacionRetencion/CancelaUnoCSD |
Parámetros Body
Propiedad | Uso | Descripción |
---|---|---|
tokenAutenticacion | Requerido | Bearer Token |
CSDCer | Requerido | Certificado del emisor en Base64 |
CSDKey | Requerido | Key del emisor en Base64 |
password | Requerido | Contraseña del certificado |
RFCEmisor | Requerido | RFC del emisor |
UUID | Requerido | UUID del Documento |
motivo | Requerido | Motivo de cancelación |
folioSustitucion | Opcional | UUID folio sustitución |
Ejemplo Request
curl --location --request POST 'http://pruebascfdi.smartweb.com.mx/Cancelacion/CancelacionRetencion.svc' \ --header 'SOAPAction: http://tempuri.org/ICancelacionRetencion/CancelaUnoCSD' \ --header 'Content-Type: text/xml; charset=utf-8' \ --data-raw '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"> <soapenv:Header/> <soapenv:Body> <tem:CancelaUnoCSD> <!--Optional:--> <tem:tokenAutenticacion>T2lYQ0t...</tem:tokenAutenticacion> <!--Optional:--> <tem:CSDCer>MIIFuzCCA6OgAwIBAgIUMzAwMDEwMDAwMDA0MDAwMDI0MzQwDQYJKoZIhvcNAQELBQAwggErMQ8wDQYDVQQDDAZBQyBVQVQxLjAsBgNVBAoMJVNFUlZJQ0lPIERFIEFETUlOSVNUUkFDSU9OIFRSSUJVVEFSSUExGjAYBgNVBAsMEVNBVC1JRVMgQXV0aG9yaXR5MSgwJgYJKoZIhvcNAQkBFhlvc2Nhci5tYXJ0aW5lekBzYXQuZ29iLm14MR0wGwYDVQQJDBQzcmEgY2VycmFkYSBkZSBjYWRpejEOMAwGA1UEEQwFMDYzNzAxCzAJBgNVBAYTAk1YMRkwFwYDVQQIDBBDSVVEQUQgREUgTUVYSUNPMREwDwYDVQQHDAhDT1lPQUNBTjERMA8GA1UELRMIMi41LjQuNDUxJTAj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AIvUmkfjwfEModH7iwwaNtZFlT2rlzeshbP++UCEtqbwvveDRhmr5sMYkl+duEOca5156fcRy4tQ8Y3moNcKFKzHGMenShEIHz+W5KE=</tem:CSDKey> <!--Optional:--> <tem:password>12345678a</tem:password> <!--Optional:--> <tem:RFCEmisor>EKU9003173C8</tem:RFCEmisor> <!--Optional:--> <tem:UUID>f5d3c8cf-1dfc-41cc-9b38-363c70282d55</tem:UUID> <!--Optional:--> <tem:motivo>02</tem:motivo> <!--Optional:--> <tem:folioSustitucion></tem:folioSustitucion> </tem:CancelaUnoCSD> </soapenv:Body> </soapenv:Envelope>'
Ejemplo Response
<s:envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:body> <cancelaunocsdresponse xmlns="http://tempuri.org/"> <cancelaunocsdresult><?xml version="1.0"?><Acuse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Fecha="2022-09-13T21:54:20.9604507" RfcEmisor="EKU9003173C9" WorkProcessId="5d5309fa-dbca-4d6b-9810-3a37924ced67" xmlns="http://www.sat.gob.mx/esquemas/retencionpago/1"><Folios><UUID>F5D3C8CF-1DFC-41CC-9B38-363C70282D55</UUID><EstatusUUID>1202</EstatusUUID><Motivo>02</Motivo></Folios><Signature Id="SelloSAT" 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/2001/04/xmldsig-more#hmac-sha512" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116"><XPath>not(ancestor-or-self::*[local-name()='Signature'])</XPath></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha512" /><DigestValue>Lr2Wwo2/3gPWIysrl6jpue1Gy2DNIPmQW2njZs4alXWriQrRVQ2B5ucttiTFE7pXZHs7Fdjre+PUwVqsQVVyHw==</DigestValue></Reference></SignedInfo><SignatureValue>mdtwoJFQwobS5iIHvS7woFtjWImYp6EKDJpC1PJw2Vs8idFx7uSkNns3zeZwu9WLeI3OODWUy8mblc1Q40MCoA==</SignatureValue><KeyInfo><KeyName>30001000000400001215</KeyName><KeyValue><RSAKeyValue><Modulus>nbtVtkPquCMLdpgeClMrTmxzCjyjn8P9YrBlW9jXC/FcXozIYHvzctK1pRxRxLTKlChc9fjluht9ffDfGOWim/4AlTrCiG6om7ItkHbLGMQrABp8qGY+SPmq1xtZ7qbbgoTFCtzP3pN9Z4uSDhdnrF2655sdmDzHJYE9MirNLM4SIdSFsabA31CCAMaWpB4TO6ZmExLp+wUiUyeIFWswc5G5KvmS/lU5tbXLK7zBDDUVjN0K1r/0iaZIZzPMxQcgfgYBrfLGZ3916MkmF28iBk5l1sfNTKS9S445QHKc+6oTP4UDDnjN/K14YWX449BAMxKcelEpjZlBQs1a1eNVcQ==</Modulus><Exponent>AQAB</Exponent></RSAKeyValue></KeyValue></KeyInfo></Signature></Acuse></cancelaunocsdresult> </cancelaunocsdresponse> </s:body> </s:envelope>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <s:Fault> <faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</faultcode> <faultstring xml:lang="en-US">SuFacturacion CR1305.Certificado no corresponde al emisor</faultstring> <detail> <ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <HelpLink i:nil="true"/> <InnerException i:nil="true"/> <Message>SuFacturacion CR1305.Certificado no corresponde al emisor</Message> <StackTrace> at SuFacturacion.WebServices.WSGeneral.guardarBitacoraErrorCancelacionRetencion(Cancelacion cancelacion, Exception ex, String _nSmetodo) in D:\a\1\s\SuFacturacion.WebServices\WSGeneral\WSGeneral.cs:line 742
 at SuFacturacion.WebServices.Cancelacion.CancelacionRetencion.CancelaUnoProcess(String tokenAutenticacion, String xmlCancelacion) in D:\a\1\s\SuFacturacion.WebServices\Cancelacion\CancelacionRetencion.svc.cs:line 108
 at SuFacturacion.WebServices.Cancelacion.CancelacionRetencion.CancelaUnoCSD(String tokenAutenticacion, String CSDCer, String CSDKey, String password, String RFCEmisor, String UUID, String motivo, String folioSustitucion) in D:\a\1\s\SuFacturacion.WebServices\Cancelacion\CancelacionRetencion.svc.cs:line 33
 at SyncInvokeCancelaUnoCSD(Object , Object[] , Object[] )
 at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
 at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
 at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
 at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)
 at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace> <Type>System.Web.Services.Protocols.SoapException</Type> </ExceptionDetail> </detail> </s:Fault> </s:Body> </s:Envelope>
CancelaUnoPFX()
Método utilizado para la cancelación de un único UUID utilizando el archivo .PFX del emisor.
Endpoint
Método | Ruta |
---|---|
POST | /Cancelacion/CancelacionRetencion.svc |
Visita nuestra herramienta: Generador de Certificado PFX.
Header
Header | Value |
---|---|
SOAPAction | http://tempuri.org/ICancelacionRetencion/CancelaUnoPFX |
Parámetros Body
Propiedad | Uso | Descripción |
---|---|---|
tokenAutenticacion | Requerido | Bearer Token |
Pfx | Requerido | PFX del emisor en Base64 |
password | Requerido | Contraseña del PFX |
RFCEmisor | Requerido | RFC del emisor |
UUID | Requerido | UUID del Documento |
motivo | Requerido | Motivo de cancelación |
folioSustitucion | Opcional | UUID folio sustitución |
Ejemplo Request
curl --location 'https://pruebascfdi.smartweb.com.mx/Cancelacion/CancelacionRetencion.svc' \ --header 'SOAPAction: http://tempuri.org/ICancelacionRetencion/CancelaUnoPFX' \ --header 'Content-Type: text/xml; charset=utf-8' \ --data '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"> <soapenv:Header/> <soapenv:Body> <tem:CancelaUnoPFX> <!--Optional:--> <tem:tokenAutenticacion>T2lYQ0t4...</tem:tokenAutenticacion> <!--Optional:--> <tem:Pfx>MIIL9QIBAzCCC7EGCSqGSIb3DQEHAaCCC6IEggueMIILmjCCBhsGCSqGSIb3DQEHAaCCBgwEggYIMIIGBDCCBgAGCyqGSIb3DQEMCgEDoIIFzDCCBcgGCiqGSIb3DQEJFgGgggW4BIIFtDCCBbAwggOYoAMCAQICFDMwMDAxMDAwMDAwNTAwMDAzNDE2MA0GCSqGSIb3DQEBCwUAMIIBKzEPMA0GA1UEAwwGQUMgVUFUMS4wLAYDVQQKDCVTRVJWSUNJTyBERSBBRE1JTklTVFJBQ0lPTiBUUklCVVRBUklBMRowGAYDVQQLDBFTQVQtSUVTIEF1dGhvcml0eTEoMCYGCSqGSIb3DQEJARYZb3NjYXIubWFydGluZXpAc2F0LmdvYi5teDEdMBsGA1UECQwUM3JhIGNlcnJhZGEgZGUgY2FsaXoxDjAMBgNVBBEMBTA2MzcwMQswCQYDVQQGEwJNWDEZMBcGA1UECAwQQ0lVREFEIERFIE1FWElDTzERMA8GA1UEBwwIQ09ZT0FDQU4xETAPBgNVBC0TCDIuNS40LjQ1MSUwIwYJKoZIhvcNAQkCExZyZXNwb25zYWJsZTogQUNETUEtU0FUMB4XDTIzMDUxODExNDM1MVoXDTI3MDUxODExNDM1MVowgdcxJzAlBgNVBAMTHkVTQ1VFTEEgS0VNUEVSIFVSR0FURSBTQSBERSBDVjEnMCUGA1UEKRMeRVNDVUVMQSBLRU1QRVIgVVJHQVRFIFNBIERFIENWMScwJQYDVQQKEx5FU0NVRUxBIEtFTVBFUiBVUkdBVEUgU0EgREUgQ1YxJTAjBgNVBC0THEVLVTkwMDMxNzNDOSAvIFZ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Optional:--> <tem:password>12345678a</tem:password> <!--Optional:--> <tem:RFCEmisor>EKU9003173C9</tem:RFCEmisor> <!--Optional:--> <tem:UUID>f5d3c8cf-1dfc-41cc-9b38-363c70282d55</tem:UUID> <!--Optional:--> <tem:motivo>02</tem:motivo> <!--Optional:--> <tem:folioSustitucion></tem:folioSustitucion> </tem:CancelaUnoPFX> </soapenv:Body> </soapenv:Envelope>'
Ejemplo Response
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <CancelaUnoPFXResponse xmlns="http://tempuri.org/"> <CancelaUnoPFXResult><?xml version="1.0"?><Acuse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Fecha="2023-10-16T16:46:39.6972877" RfcEmisor="EKU9003173C9" WorkProcessId="2505243a-bede-4526-8c15-76f7203068cd" xmlns="http://www.sat.gob.mx/esquemas/retencionpago/1"><Folios><UUID>F5D3C8CF-1DFC-41CC-9B38-363C70282D55</UUID><EstatusUUID>1205</EstatusUUID><Motivo>02</Motivo></Folios><Signature Id="SelloSAT" 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/2001/04/xmldsig-more#hmac-sha512" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116"><XPath>not(ancestor-or-self::*[local-name()='Signature'])</XPath></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha512" /><DigestValue>mCJXATKJlfXAAXwDky6jGoOTJZirX2CuGZD+evWXka85OWs8KrkxeyVduat+RllFss9a1q/bQ7ifmxGIxe8LMA==</DigestValue></Reference></SignedInfo><SignatureValue>L+5NoBeJ/WjZOkRuaGQhNQOo0Q6HKM+2W5sc3WtIdEoJT0sNXoyi24ZxAxKk3P6yVK4tq9oeSP1iLpGYcLpp5w==</SignatureValue><KeyInfo><KeyName>30001000000500002554</KeyName><KeyValue><RSAKeyValue><Modulus>hUcUOoGEtSDAlrF8KegQkGKY8aDAe9tNRkf48uj1+YirDP4cMEd8YEelQY1jLu1GINYKf9N9XxmOfHdL4FUr+cuOgrBviaGWcIsJfZ80IGpvox6kUSHoRt+h32yQayW0HuNOp0b3yiBp9Y6jTdYTFTAVzgzUjf4LfVt8n5FejVZ2xERIyROnGgbK8A4xBsPpFazHQkK2PCiYe+LYBm0Ux9UZYkYJ9Mu9rL5c51Sjgq8JJekorp0BzfKadRrSEFyD2Z6GwB0RswjLZQspojZGxUnqlbldvO6TjFUV4MT7EV8P7f2VTS0yr4qSwx0y080zoK10CbIoJXfsFROHypFj5w==</Modulus><Exponent>AQAB</Exponent></RSAKeyValue></KeyValue></KeyInfo></Signature></Acuse></CancelaUnoPFXResult> </CancelaUnoPFXResponse> </s:Body> </s:Envelope>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <s:Fault> <faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</faultcode> <faultstring xml:lang="en-US">SuFacturacion CR1305.Certificado no corresponde al emisor</faultstring> <detail> <ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <HelpLink i:nil="true"/> <InnerException i:nil="true"/> <Message>SuFacturacion CR1305.Certificado no corresponde al emisor</Message> <StackTrace> at SuFacturacion.WebServices.WSGeneral.guardarBitacoraErrorCancelacionRetencion(Cancelacion cancelacion, Exception ex, String _nSmetodo) in D:\a\1\s\SuFacturacion.WebServices\WSGeneral\WSGeneral.cs:line 745
 at SuFacturacion.WebServices.Cancelacion.CancelacionRetencion.CancelaUnoProcess(String tokenAutenticacion, String xmlCancelacion) in D:\a\1\s\SuFacturacion.WebServices\Cancelacion\CancelacionRetencion.svc.cs:line 108
 at SuFacturacion.WebServices.Cancelacion.CancelacionRetencion.CancelaUnoPFX(String tokenAutenticacion, String Pfx, String password, String RFCEmisor, String UUID, String motivo, String folioSustitucion) in D:\a\1\s\SuFacturacion.WebServices\Cancelacion\CancelacionRetencion.svc.cs:line 122
 at SyncInvokeCancelaUnoPFX(Object , Object[] , Object[] )
 at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
 at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
 at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
 at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)
 at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace> <Type>System.Web.Services.Protocols.SoapException</Type> </ExceptionDetail> </detail> </s:Fault> </s:Body> </s:Envelope>
CancelacionMasiva()
Método utilizado para la cancelación de múltiples UUIDs utilizando un XML de cancelación previamente firmado.
Para lograr un mejor rendimiento, es recomendable enviar un archivo XML con un máximo de 500 UUID de CFDI para su cancelación.
Endpoint
Método | Ruta |
---|---|
POST | /Cancelacion/CancelacionRetencion.svc |
Header
Header | Value |
---|---|
SOAPAction | http://tempuri.org/ICancelacionRetencion/CancelacionMasiva |
Parámetros Body
Propiedad | Uso | Descripción |
---|---|---|
tokenAutenticacion | Requerido | Bearer Token |
xmlCancelacion | Requerido | XML de Cancelación de Retenciones. |
Si desconoces la estructura del XML de cancelación, mira el siguiente video: ¿Cómo crear XML de Cancelación para CFDI y Retenciones?. También puede ser útil: Herramienta para Firmar XML.
Ejemplo Request
curl --location 'https://pruebascfdi.smartweb.com.mx/Cancelacion/CancelacionRetencion.svc' \ --header 'SOAPAction: http://tempuri.org/ICancelacionRetencion/CancelacionMasiva' \ --header 'Content-Type: text/xml; charset=utf-8' \ --data-raw '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"> <soapenv:Header/> <soapenv:Body> <tem:CancelacionMasiva> <!--Optional:--> <tem:tokenAutenticacion>T2lYQ0t4...</tem:tokenAutenticacion> <!--Optional:--> <tem:xmlCancelacion><![CDATA[<?xml version="1.0" encoding="utf-8" ?> <Cancelacion xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Fecha="2023-09-18T10:18:45" RfcEmisor="EKU9003173C9" xmlns="http://www.sat.gob.mx/esquemas/retencionpago/1"> <Folios> <Folio UUID="a9c3c50b-8d7e-46e2-be49-25a6dd86f56a" Motivo="02"/> </Folios> <Folios> <Folio UUID="df0050cd-688b-40a3-a45d-45bd2284de0a" 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>7g+i6NsFvQtMh28JxSJ7qLRedcs=</DigestValue> </Reference> </SignedInfo> <SignatureValue>NlF+X7rTjTJgGXg08bDrcs6sd07XGvC813BSPiOx/majPrfKHRU8AEpP6g6wi+y4pJK3cP62oWimAjTYM82KkFJVxXYzMU6xO5yoOEj1ifgPOhpv8AMDjEv1BykkzR4qlg2ItSP37ovZ1fbwFnqz7YpjygsBvCeKldqiU+dlYFFWiZgDoqgt8BzuVNcVXDlXdENch2Nt8UON34hPgVIoorQ3jgvsMdLlIrNz7Go1CJ0TuKsKbLBsgU8zZ0MJM2UAj6Hd0p7dMQ6TYlre95JmLRfQIiyh38GoD9ER28gHNr0QQo14FkqHYObIeMTpdBHHMISz6qj/IN3sVnGlEJRUkQ==</SignatureValue> <KeyIn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cfkg1ZrgueffwRLws9yOcRWLb02sDOPzGIm/jEFicVYt2Hw1qdRE5xmTZ7AGG0UHs+unkGjpCVeJ+BEBn0JPLWVvDKHZAQMj6s5Bku35+d/MyATkpOPsGT/VTnsouxekDfikJD1f7A1ZpJbqDpkJnss3vQIDAQABox0wGzAMBgNVHRMBAf8EAjAAMAsGA1UdDwQEAwIGwDANBgkqhkiG9w0BAQsFAAOCAgEAFaUgj5PqgvJigNMgtrdXZnbPfVBbukAbW4OGnUhNrA7SRAAfv2BSGk16PI0nBOr7qF2mItmBnjgEwk+DTv8Zr7w5qp7vleC6dIsZFNJoa6ZndrE/f7KO1CYruLXr5gwEkIyGfJ9NwyIagvHHMszzyHiSZIA850fWtbqtythpAliJ2jF35M5pNS+YTkRB+T6L/c6m00ymN3q9lT1rB03YywxrLreRSFZOSrbwWfg34EJbHfbFXpCSVYdJRfiVdvHnewN0r5fUlPtR9stQHyuqewzdkyb5jTTw02D2cUfL57vlPStBj7SEi3uOWvLrsiDnnCIxRMYJ2UA2ktDKHk+zWnsDmaeleSzonv2CHW42yXYPCvWi88oE1DJNYLNkIjua7MxAnkNZbScNw01A6zbLsZ3y8G6eEYnxSTRfwjd8EP4kdiHNJftm7Z4iRU7HOVh79/lRWB+gd171s3d/mI9kte3MRy6V8MMEMCAnMboGpaooYwgAmwclI2XZCczNWXfhaWe0ZS5PmytD/GDpXzkX0oEgY9K/uYo5V77NdZbGAjmyi8cE2B2ogvyaN2XfIInrZPgEffJ4AB7kFA2mwesdLOCh0BLD9itmCve3A1FGR4+stO2ANUoiI3w3Tv2yQSg4bjeDlJ08lXaaFCLW2peEXMXjQUk7fmpb5MNuOUTW6BE=</X509Certificate> <X509IssuerSerial> <X509IssuerName>CN=AC UAT, O=SERVICIO DE ADMINISTRACION TRIBUTARIA, OU=SAT-IES Authority, E=oscar.martinez@sat.gob.mx, STREET=3ra cerrada de caliz, PostalCode=06370, C=MX, ST=CIUDAD DE MEXICO, L=COYOACAN, OID.2.5.4.45=2.5.4.45, OID.1.2.840.113549.1.9.2=responsable: ACDMA-SAT</X509IssuerName> <X509SerialNumber>3330303031303030303030353030303033343136</X509SerialNumber> </X509IssuerSerial> </X509Data> </KeyInfo> </Signature> </Cancelacion>]]></tem:xmlCancelacion> </tem:CancelacionMasiva> </soapenv:Body> </soapenv:Envelope>'
Ejemplo Response
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <CancelacionMasivaResponse xmlns="http://tempuri.org/"> <CancelacionMasivaResult>76A79DDD-5E40-4467-B4C9-8A183756025D</CancelacionMasivaResult> </CancelacionMasivaResponse> </s:Body> </s:Envelope>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <s:Fault> <faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</faultcode> <faultstring xml:lang="en-US">There is an error in XML document (1, 41).</faultstring> <detail> <ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <HelpLink i:nil="true"/> <InnerException> <HelpLink i:nil="true"/> <InnerException i:nil="true"/> <Message><Cancelacion xmlns='http://cancelacfd.sat.gob.mx'> was not expected.</Message> <StackTrace> at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderCancelacion.Read18_Cancelacion()</StackTrace> <Type>System.InvalidOperationException</Type> </InnerException> <Message>There is an error in XML document (1, 41).</Message> <StackTrace> at SuFacturacion.WebServices.WSGeneral.guardarBitacoraErrorCancelacionRetencion(Cancelacion cancelacion, Exception ex, String _nSmetodo) in D:\a\1\s\SuFacturacion.WebServices\WSGeneral\WSGeneral.cs:line 745
 at SuFacturacion.WebServices.Cancelacion.CancelacionRetencion.CancelacionMasiva(String tokenAutenticacion, String xmlCancelacion) in D:\a\1\s\SuFacturacion.WebServices\Cancelacion\CancelacionRetencion.svc.cs:line 57
 at SyncInvokeCancelacionMasiva(Object , Object[] , Object[] )
 at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
 at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
 at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
 at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)
 at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace> <Type>System.InvalidOperationException</Type> </ExceptionDetail> </detail> </s:Fault> </s:Body> </s:Envelope>
ConsultaAcuseCancelacion()
Método para consultar el estado de UUIDs cancelados previamente, especialmente útil para verificar facturas canceladas a través de nuestro servicio de cancelación masiva.
El tiempo de disponibilidad de los acuses de cancelación devueltos por este servicio varía en proporción a la cantidad de UUID enviados para su cancelación.
Endpoint
Método | Ruta |
---|---|
POST | /Cancelacion/CancelacionRetencion.svc |
Header
Header | Value |
---|---|
SOAPAction | http://tempuri.org/ICancelacionRetencion/ConsultaAcuseCancelacion |
Parámetros Body
Propiedad | Uso | Descripción |
---|---|---|
tokenAutenticacion | Requerido | Bearer Token |
folioSeguimiento | Requerido | Folio que se consultara |
Ejemplo Request
curl --location --request POST 'http://pruebascfdi.smartweb.com.mx/Cancelacion/CancelacionRetencion.svc' \ --header 'SOAPAction: http://tempuri.org/ICancelacionRetencion/ConsultaAcuseCancelacion' \ --header 'Content-Type: text/xml; charset=utf-8' \ --data-raw '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"> <soapenv:Header/> <soapenv:Body> <tem:ConsultaAcuseCancelacion> <tem:tokenAutenticacion>T2lYQ0t...</tem:tokenAutenticacion> <tem:folioSeguimiento>f5d3c8cf-1dfc-41cc-9b38-363c70282d55</tem:folioSeguimiento> </tem:ConsultaAcuseCancelacion> </soapenv:Body> </soapenv:Envelope>'
Ejemplo Response
<s:envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:body> <?xml version="1.0"?><Acuse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Fecha="2022-09-13T23:05:17.947556" RfcEmisor="EKU9003173C9" WorkProcessId="ad979c7c-74cb-460f-bfc3-4edd8d0ad40e" xmlns="http://www.sat.gob.mx/esquemas/retencionpago/1"><Folios><UUID>F5D3C8CF-1DFC-41CC-9B38-363C70282D55</UUID><EstatusUUID>1202</EstatusUUID><Motivo>02</Motivo></Folios><Signature Id="SelloSAT" 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/2001/04/xmldsig-more#hmac-sha512" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116"><XPath>not(ancestor-or-self::*[local-name()='Signature'])</XPath></Transform></Transforms><DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha512" /><DigestValue>K7CisDmAy+gpPwK7y1jbnZoq/nkYLmo9AVkaY7Has/9l9+WPM37JGP3v5SKrhzPKnY0XiyNcWXKLbrez2bLv6Q==</DigestValue></Reference></SignedInfo><SignatureValue>oGQ5TXwoc81+k/JRiF/AIwFM6Np+FZDzcTx6yM688EXfT+jSXSyNsypknlu170HwRnJX5pVFFV2+Q2xy/SbZmQ==</SignatureValue><KeyInfo><KeyName>30001000000400001215</KeyName><KeyValue><RSAKeyValue><Modulus>nbtVtkPquCMLdpgeClMrTmxzCjyjn8P9YrBlW9jXC/FcXozIYHvzctK1pRxRxLTKlChc9fjluht9ffDfGOWim/4AlTrCiG6om7ItkHbLGMQrABp8qGY+SPmq1xtZ7qbbgoTFCtzP3pN9Z4uSDhdnrF2655sdmDzHJYE9MirNLM4SIdSFsabA31CCAMaWpB4TO6ZmExLp+wUiUyeIFWswc5G5KvmS/lU5tbXLK7zBDDUVjN0K1r/0iaZIZzPMxQcgfgYBrfLGZ3916MkmF28iBk5l1sfNTKS9S445QHKc+6oTP4UDDnjN/K14YWX449BAMxKcelEpjZlBQs1a1eNVcQ==</Modulus><Exponent>AQAB</Exponent></RSAKeyValue></KeyValue></KeyInfo></Signature></Acuse> </s:body> </s:envelope>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <s:Fault> <faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</faultcode> <faultstring xml:lang="en-US">SuFacturacion CR1006. Mensaje SAT.Folio de seguimiento no existe.</faultstring> <detail> <ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <HelpLink i:nil="true"/> <InnerException i:nil="true"/> <Message>SuFacturacion CR1006. Mensaje SAT.Folio de seguimiento no existe.</Message> <StackTrace> at SuFacturacion.WebServices.WSGeneral.guardarBitacoraErrorCancelacionRetencion(Cancelacion cancelacion, Exception ex, String _nSmetodo) in D:\a\1\s\SuFacturacion.WebServices\WSGeneral\WSGeneral.cs:line 742
 at SuFacturacion.WebServices.Cancelacion.CancelacionRetencion.ConsultaAcuseCancelacion(String tokenAutenticacion, String folioSeguimiento) in D:\a\1\s\SuFacturacion.WebServices\Cancelacion\CancelacionRetencion.svc.cs:line 80
 at SyncInvokeConsultaAcuseCancelacion(Object , Object[] , Object[] )
 at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
 at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
 at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
 at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc)
 at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace> <Type>System.Web.Services.Protocols.SoapException</Type> </ExceptionDetail> </detail> </s:Fault> </s:Body> </s:Envelope>
En SW® somos mejores para TI, es por ello que tu opinión es muy importante, por favor ayúdanos calificando este articulo y dejando tus comentarios.