Skip to content

API Web

Rafael Dorantes edited this page May 23, 2023 · 2 revisions

CFDI

Creacion de CFDI

cfdi = {
                    "Serie": "R",
                    "Currency": "MXN",
                    "ExpeditionPlace": "78116",
                    "PaymentConditions": "CREDITO A SIETE DIAS",
                    "CfdiType": "I",
                    "PaymentForm": "03",
                    "PaymentMethod": "PUE",
                    "Receiver": {
                        "Rfc": "XAXX010101000",
                        "Name": "RADIAL SOFTWARE SOLUTIONS",
                        "CfdiUse": "P01"
                    },
                    "Items": [
                        {
                            "ProductCode": "10101504",
                            "IdentificationNumber": "EDL",
                            "Description": "Estudios de viabilidad",
                            "Unit": "NO APLICA",
                            "UnitCode": "MTS",
                            "UnitPrice": 50.0,
                            "Quantity": 2.0,
                            "Subtotal": 100.0,
                            "Taxes": [{
                                          "Total": 16.0,
                                          "Name": "IVA",
                                          "Base": 100.0,
                                          "Rate": 0.16,
                                          "IsRetention": false
                                      }],
                            "Total": 116.0
                        },
                        {
                            "ProductCode": "10101504",
                            "IdentificationNumber": "001",
                            "Description": "SERVICIO DE COLOCACION",
                            "Unit": "NO APLICA",
                            "UnitCode": "E49",
                            "UnitPrice": 100.0,
                            "Quantity": 15.0,
                            "Subtotal": 1500.0,
                            "Discount": 0.0,
                            "Taxes": [{
                                          "Total": 240.0,
                                          "Name": "IVA",
                                          "Base": 1500.0,
                                          "Rate": 0.16,
                                          "IsRetention": false
                                      }],
                            "Total": 1740.0
                        }
                    ]
                }

facturama.cfdis.create(cfdi)

Cancelación

facturama.cfdis.remove(cfdi['Id'])

Descarga en el formato deseado xml, html ó pdf

facturama.cfdis.save_pdf( "factura.pdf",  cfdi['Id'])
facturama.cfdis.save_xml( "factura.xml",  cfdi['Id'])

Consulta tus facturas en cualquier momento mediante una palabra clave ó algun atributo en específico

facturama.cfdis.list_by_rfc("ESO1202108R2")
facturama.cfdis.list_by_keyword("Software")

Envia tu CFDI por Email

facturama.cfdis.send_by_mail(cfdi['Id'], "[email protected]", "Factura del servicio" )

Clone this wiki locally