Skip to content
/ FACe_lib Public

FACe interface to simplify the interaction with the FACe's WS

Notifications You must be signed in to change notification settings

gisce/FACe_lib

Repository files navigation

FACe lib

It provides a FACe interface to simplify the interaction with the FACe's WS

How to install

Just install it using pip:

$ pip install FACe_lib

Usage

Initialize the face interface passing the desired PEM certificate and an email to receive notifications from FACe servers:

from face.face import FACe

our_certificate = 'path_to/cert.pem'

face = FACe(certificate=our_certificate, email='[email protected]')

Call the requested service (see all available methods), ie:

result = face.nifs.list()

Integrated FACe services

Invoices

Fetch Invoice

result = face.invoices.fetch(invoice="213091309123")
print (result.errors)
print (result.data)

Send Invoice by Filepath

result = face.invoices.send_by_filename(invoice="an_invoice.xsig")
print (result.errors)
print (result.data)

Send Invoice

result = face.invoices.send_by_filename("Facturae.xsig", b64content)
print (result.errors)
print (result.data)

Cancel Invoice

result = face.invoices.send(invoice="213091309123", reason="Mistake at generation process")
print (result.errors)
print (result.data)

List Invoice States

result = face.invoices.list_states(invoice="213091309123")
print (result.errors)
print (result.data)

Administrations

List Administrations

result = face.administrations.list()
print (result.errors)
print (result.data)

NIFs

List NIFs

result = face.nifs.list()
print (result.errors)
print (result.data)