This repository contains the Python client library for the Invoiced API.
The Invoiced package can be installed like this:
pip install invoiced
- Python 3.7+
requests
andinflection
libraries
First, you must instantiate a new client
import 'invoiced'
client = invoiced.Client("{API_KEY}")
Then, API calls can be made like this:
# retrieve invoice
invoice = client.Invoice.retrieve("{INVOICE_ID}")
# mark as paid
payment = client.Payment.create(
amount= invoice.balance,
method= "check",
applied_to= {
'type': 'invoice',
'invoice': invoice.id,
'amount': invoice.balance
})
If you want to use the sandbox API instead then you must set the second argument on the client to True
like this:
import 'invoiced'
client = invoiced.Client("{API_KEY}", True)
The test suite can be run with python setup.py test
. If you want to capture code coverage too with coverage.py then use python -m coverage run setup.py test
and view the report with python -m coverage report
.
Contributions must pass the Flake8 code linter.
The package can be uploaded to pypi with the following commands:
python setup.py sdist
twine upload dist/* --repository invoiced