Servicio batch que realiza el timbrado masivo de comprobantes sellados CFDI 4.0 en
formato XML.
En ambiente de pruebas se pueden usar certificados reales pero recomendamos hacer uso de los CSD de pruebas.
🛠Url Pruebas : http://pruebascfdi.smartweb.com.mx:8080
🧰 Url Producción : http://batchstamp.smartweb.com.mx:8080
Timbrado
Endpoint
Método | Ruta |
---|---|
POST | /BatchService.svc?wsdl |
Autenticación y Headers
Header | Value |
---|---|
Content-Type | text/xml;charset=”utf-8″ |
SOAPAction | http://tempuri.org/IBatchService/ProcessBatchV2 |
Parámetros
Propiedad | Uso | Descripción |
---|---|---|
token | Requerido | Bearer Token |
originalFileName | Requerido | Nombre del archivo zip que contiene los XML |
generatePdf | Opcional | Indica si el proceso se realizará generando PDF o no (true o false) |
pdfTemplateId | Opcional | Indica la plantilla genérica con la que requiere generar los PDF. Si tienes plantilla a la medida contactate con soporte técnico. |
content | Requerido | Archivo zip en base 64 |
Ejemplo Request
curl --request POST \ --url http://pruebascfdi.smartweb.com.mx:8080/BatchService.svc \ --header 'Content-Type: text/xml;charset="utf-8"' \ --header 'SOAPAction: http://tempuri.org/IBatchService/ProcessBatchV2' \ --data ' <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"> <soapenv:Header/> <soapenv:Body> <tem:ProcessBatchV2> <tem:token>T2lYQ0t4L0RHVk...</tem:token> <tem:originalFileName>xmlPrueba.zip</tem:originalFileName> <tem:generatePdf>true</tem:generatePdf> <tem:pdfTemplateId>cfdi40</tem:pdfTemplateId> <tem:content>UEsDBBQAAAAIAMJ18lRSfHW1fgoAAOARAAAIAAAAeG1sMS54bWydV2mTosoS/SuGXzum2VE6bs+NYhUUZFf88gIBkV0BQf31r8DpZbrn3njxOmzAzKzKzJMnk/Kvv69FPumiukmq8nWKPaPTSVQGVZiU8evUscUf8+nfP/8KDmHywlXFqa72ftlGEyvK8+p1aqyisA5bE50TpxN52KDLtZtayQZrjjWv6n41v6tUh147jl8jIcJ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Y6DVqYMBPIwxfvAyowNZvq9Fy9Pw2ZXDsBSemE+Sb20H9nCjD0/tUgR/KwohXkn5FiWH81IXHR4OF9hwCz9ECv8CfMM+JwnmFnwxq7Jf3D5+/PH765KugrYwoH4cKTGIih1B0HVGDpSWOAUYR/g8/8o8/SMKDT0ea/EEdoUcCjbwA9T5mI/icjRg9/5h5vAF/ppo85PW10Lw6SLz8gyMQMdPLwwqULZyz2MtiPspgcuNg/pSMVnLZVPm1ffJEuFyTDlaphBsOLtAXlKQIAvvCmlGMf+b8mfV7pRre+KL9QoD3kn7T/2nBG5OBF4MrYv6CPgk87j16h+7HiogehLkeRJbXQMiG65a7QlI8Y4fzHUU/2T8IqSH3796RP9z/Hv93/e8JfKj/lv+H8jsl/uDMx2rtL9B+eNb+EVlthE371UoUTeH4J3TaH8hpfwKn/QU37aPr/hkW7W+g/CXyPwF7131ohkb8+Yek+TqYPsfQF9Gv9/3P/wNQSwECFAAUAAAACADCdfJUUnx1tX4KAADgEQAACAAAAAAAAAABACAAAAAAAAAAeG1sMS54bWxQSwECFAAUAAAACADRdfJU6TFLoIAKAADgEQAACAAAAAAAAAABACAAAACkCgAAWE1MMi54bWxQSwUGAAAAAAIAAgBsAAAAShUAAAAA</tem:content> </tem:ProcessBatchV2> </soapenv:Body> </soapenv:Envelope>'
Ejemplo Response
Response Ok
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <ProcessBatchV2Response xmlns="http://tempuri.org/"> <ProcessBatchV2Result>34cbebe9-681e-4ea2-8ab9-548457d1866e</ProcessBatchV2Result> </ProcessBatchV2Response> </s:Body> </s:Envelope>
Response Error
<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">Batch999 : El archivo ya fue enviado anteriormente.</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>Batch999 : El archivo ya fue enviado anteriormente.</Message> <StackTrace> at InvoiceProcessor.Service.BatchService.ProcessBatchV2(String token, String originalFileName, String companyName, Byte[] content) in D:\a\1\s\BatchStamp\InvoiceProcessor.Service\BatchService.svc.cs:line 180
 at SyncInvokeProcessBatchV2(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>
Webhook
Webhook que deberás crear para recibir las notificaciones del servicio de timbrado por lotes.
A continuación se describen las características del evento que el servicio de timbrado estaría enviando.
POST /batch/webhook HTTP/1.1 Host: {{url_client}} Authorization: Basic dXNlcpoiYXNs Content-Type: application/json Content-Length: 70 { "urlOutput": "", "urlReport": "", "urlReportError": "" }
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.