Skip to main content

Facturapi API Client

Project description

Facturapi Logo

FacturAPI – Python Client Library

test codecov Code style: black

Español

This is a Python library for FacturAPI

FacturAPI makes it easy for developers to generate valid Invoices in Mexico (known as Factura Electrónica or CFDI).

💻 Installation

🚀 Getting started

Authenticate with your API Key

Be sure to create a free account on FacturAPI and have access to your test or live API keys.

There are two ways to configure your API Key to use the library:

  1. Environment variable: Just set an environment variable and the library will automatically use it:

    export FACTURAPI_KEY=YOUR_API_KEY
    
  2. Using the configure method: If you want to set it in the code, you can import and use the configure method:

    from facturapi import configure
    
    configure(api_key='YOUR_API_KEY')
    

Create a customer

After configuring the API Key, you can use the client to perform many actions on the resources, for example to create a Customer:

import facturapi
from facturapi.resources.customers import CustomerRequest, CustomerUpdateRequest

customer = facturapi.Customer.create(data=CustomerRequest(
    legal_name='Frida Kahlo',
    tax_id='ABCD111111CBA',
    email='frida_kahlo@test.com',
))

For more details on the data used to create a Customer and other resources, be sure to check out the docs.

More examples can be found on the examples directory.

📚 Documentation

To find more documentation and use cases about the library and Facturapi, check out the docs.

💡 Contribute

Found a bug?

Please create an issue addressing the bug and how to replicate it.

Want to contribute?

Be sure to fork the repo and send your PR! Any and all help is appreciated.

Contacts:


Developed and maintained with 💙 by Cuenca

Cuenca Logo

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

facturapi-0.0.1.dev0.tar.gz (16.6 kB view hashes)

Uploaded Source

Built Distribution

facturapi-0.0.1.dev0-py3-none-any.whl (21.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page