DLL Import API
Starting January 1, 2022, all cancellation requests must contain the reason for canceling the CFDI. In the event that the cancellation reason is "01 - Voucher issued with errors in relation" the UUID of the voucher that replaces the voucher to be canceled must be specified.
In order not to change the SOAP data contract and avoid compatibility problems with the services implemented by our clients, in the Solución Factible cancellation services it will be possible to include a cancellation string instead of the UUID, which includes the UUID to be cancelled, reason for cancellation and the related UUD that replaces the receipt to be cancelled.
For more details consult the catalog of Allowed reasons for cancellation.
To use these methods in your project, you only have to add the dll_cfdi.zip library. To find out how to add it, please follow this link: Documentación DLL's .
Due to changes in the CFDI cancellation process, the process to cancel receipts using the DLL is through the importCFDI method, using a connector file.
ProgID | SF.CFDI |
Summary of methods
String |
enviarCFDI(String user, String pass, String disenoMail, String asunto, String mensajePersonalizado,
String zip, String xmlEnvios, int produccion) Send the printed representation of a CFDI to one or more recipients. |
String |
importarCFDI(String user, String pass, String pathToConector, int produccion) Receive data to import into one or more receipts. |
String |
generarPDF(String user, String pass, String diseno, String uuid,
String folio, String serie, String dirDescargaPDF, int produccion) Returns the printed representation of a CFDI in PDF format. |
String |
obtenerDatos(String user, String pass, String uuid, String folio, String serie, int produccion) Searches for the data of a CFDI by folio and series or by fiscal folio (UUID) and returns it. |
String |
importarCFDIBase64(String user, String pass, String contenidoBase64, int produccion) Receives the contents of a connector file encoded Base64 |
Detailed description of the methods
enviarCFDI (sendCFDI)
String enviarCFDI(String user, String pass, String disenoMail, String asunto, String mensajePersonalizado, String zip, String xmlEnvios, int produccion)
- Sends the printed representation of a CFDI to one or more recipients and returns a String with the server's response in XML format.
- Parameters:
String user
- The username (usually an email) used to authenticate and connect to your deployment.String pass
- User password.String disenoMail
- Layout identifier to use for the message format.String asunto
- Message header.String mensajePersonalizado
- Message content.String zip
- Indicates whether message attachments will be compressed to zip ("true" o "false")String xmlEnvios
- Data corresponding to shipments and recipients. This parameter must be provided as an XML where the following information will be loaded as follows:
xmlEnvios examplesint produccion
- Only the values: 1 and 0 are accepted. Indicates the server to which the request will be made; 0=TESTING 1=PRODUCTION
- Come back:
- A String containing the server's response in XML format.
- Sample answer
importarCFDI (importCFDI)
String importarCFDI(String user, String pass, String pathToConector, int produccion)
- Receives data to import it into one or more vouchers and returns the server's response in XML format.
- Parameters:
String user
- The username (usually an email) used to authenticate and connect to your deployment.String pass
- The user password.String pathToConector
- Path to the connector file to be sent.int produccion
- Only the values: 1 and 0 are accepted. Indicates the server to which the request will be made.; 0=TESTING 1=PRODUCTION
- Come back:
- Un String containing the server's response in XML format.
Example of cancellation with connector file
See the reasons for cancellation here
- Sample Answer
generarPDF (generate PDF)
String generarPDF(String user, String pass, String diseno, String uuid, String folio, String serie, String dirDescargaPDF, int produccion)
- Returns the printed representation of a CFDI in PDF format and returns a String with the server's response in XML format.
- Parameters:
String user
- The username (usually an email) used to authenticate and connect to your deployment.String pass
- The user password.String uuid
- The UUID of the receipt you want to download (can be null if the folio and series are sent).String folio
- Commercial folio number of the CFDI.String serie
- Commercial series name of the CFDI.String dirDescargaPDF
- Path where the downloaded PDF will be saved.int produccion
- Only the values: 1 and 0 are accepted. Indicates the server to which the request will be made; 0=TESTING 1=PRODUCTION
- Come back:
- Un String containing the server's response in XML format.
- Sample Answer
obtenerDatos (getData)
String obtenerDatos(String user, String pass, String uuid, String folio, String serie, int produccion)
- Searches for the data of a CFDI by folio and series or by fiscal folio (UUID) and returns it.
- Parameters:
String user
- The username (usually an email) used to authenticate and connect to your deployment.String pass
- The user password.String folio
- Commercial folio number of the CFDI.String serie
- Commercial series name of the CFDI.int produccion
- Only the values: 1 and 0 are accepted. Indicates the server to which the request will be made.; 0=TESTING 1=PRODUCTION
- Come back:
- Un String containing the server's response in XML format.
- Sample Answer
importarCFDIBase64 (import CFDI Base64)
String importarCFDI(String user, String pass, String contenidoBase64, int produccion)
- Receives the content of a base64-encoded connector file to import one or more vouchers, returns the server response in XML format.
- Parameters:
String user
- The username (usually an email) used to authenticate and connect to your deployment.String pass
- The user password..String contenidoBase64
- Encoded content of the connector file on Base64that is going to be sent.int produccion
- Only the values: 1 and 0 are accepted. Indicates the server to which the request will be made; 0=TESTING 1=PRODUCTION
- Come back:
- Un String containing the server's response in XML format.
- Sample Answer
-
General Header Response Codes
General header response codes may contain more specific descriptions in the message.
- 200 — The creation process has been completed successfully.
- 500 — Errors have occurred that prevented the process from being completed. Please try again.
- 501 — Database connection error. Please retry.
- 502 — Errors have occurred while trying to retrieve data or store it in the database.
- 503 — The concurrent database access license limit has been reached.
- 601 — Authentication error, please verify username and password.
- 602 — The user account is blocked.
- 603 — The account password has expired.
- 604 — You have exceeded the maximum allowed number of failed authentication attempts, the account will be locked.
- 610 — The requested action is not supported in the implementation because it has not been configured for that purpose or it is not possible to perform it. In the import method, this means that the implementation does not have a Receipt Import Connector configured.
- 611 — Not all the parameters required to perform the operation have been specified. In the case of the import method, this means that the Import Connector assigned to this implementation cannot be used through this Webservice due to limitations inherent to the connector.
- 612 — Malformed file. The file format or binary sequence does not correspond to what is expected.
- 613 — The number sequence has reached the end.
- 620 — You do not have permission to perform the action.
- 621 — Invalid argument.
- 622 — Operation not supported for implementation.
- 623 — Data not found.
- 624 — Violation of uniqueness constraint.
- 625 — The action cannot be completed because it requires a previous action to be executed.
- 626 — Deployment configuration error.
- 630 — The implementation contract has expired.
- 631 — The payment date for the implementation contract has expired.
- 632 — The fair use limit for the implementation has been exceeded.
- 633 — The implementation is currently inactive.
-
CFDI Import Status Codes
- 1 — The creation process has been completed successfully.
- -1 — Errors have occurred that prevented the creation process from being completed.
-
Operation codes for CFDI import
- -1 — Parseo.
- 0 — Cancellation.
- 1 — Creation.
- 2 — Cannot be modified.
