Skip to main content

InvoiceXpress API - Python

PyPI Build Status Python 3.3, 3.4, 3.5, 3.6 MIT License

Thin Python 3 wrapper for the InvoiceXpress REST API. Currently rough and incomplete.

API docs at: https://developers.invoicexpress.com/docs/versions/2.0.0/

Included APIs

API

Done in

Invoices

v0.1.0

Estimates

to-do

Guides

to-do

Purchase Orders

to-do

Clients

v0.1.0

Items

to-do

Sequences

to-do

Taxes

to-do

Accounts

to-do

SAF-T

to-do

Installation

Automatic install via pip:

$ pip install invoicexpress-api

Usage

Setup

>>> import invoicexpress_api as ie
>>> c = ie.Client('my_account_name', 'my_api_key')

Create an invoice

>>> invoice_type = ie.invoices.Types.INVOICE_RECEIPT
>>> invoice_data = {
  "invoice": {
        "date": "17/04/2018",
        "due_date": "17/04/2018",
        "client": {
                "name": "John Doe",
                "code": "XYZ123"
        },
        "items": [
                {
                  "name": "SRV1",
                  "description": "Service 1",
                  "unit_price": 10.0,
                  "quantity": 5.0,
                  "tax": {
                          "name": "IVA23"
                          }
                }
          ]
   }
}
>>> ie.invoices.create(c, invoice_data, invoice_type)
{
    'invoice_receipt':{
        'id':12345678,
        'status':'draft',
        'archived':False,
        'type':'InvoiceReceipt',
        'sequence_number':'rascunho',
        'date':'17/04/2018',
        'due_date':'17/04/2018',
        'reference':None,
        'observations':None,
        'retention':None,
        'permalink':'https://www.app.invoicexpress.com/documents/113a4152...',
        'sum':50.0,
        'discount':0.0,
        'before_taxes':50.0,
        'taxes':11.5,
        'total':61.5,
        'currency':'Euro',
        'client':{
            'id':1234567,
            'name':'John Doe',
            'code':'XYZ123'
        },
        'items':[
            {
                'name':'SRV1',
                'description':'Service 1',
                'unit_price':'10.0',
                'unit':None,
                'quantity':'5.0',
                'tax':{
                    'id':123456,
                    'name':'IVA23',
                    'value':23.0
                },
                'discount':0.0,
                'subtotal':50.0,
                'tax_amount':11.5,
                'discount_amount':0.0,
                'total':61.5
            }
        ]
    }
}

Fetch and update an invoice

>>> inv = ie.invoices.get(c, 12345678, invoice_type)
>>> inv[invoice_type]['items'][0]['unit_price'] = 150
>>> ie.invoices.update(c, 12345678, inv, invoice_type)
>>> ie.invoices.get(c, 12345678, invoice_type)
{
    'invoice_receipt':{
        'id':12345678,
        'status':'settled',
        'archived':False,
        'type':'InvoiceReceipt',
        'sequence_number':'1/A',
        'inverted_sequence_number':'A/1',
        'sequence_id':123456,
        'date':'17/04/2018',
        'due_date':'17/04/2018',
        'reference':None,
        'observations':None,
        'retention':None,
        'permalink':'https://www.app.invoicexpress.com/documents/113a4152...',
        'saft_hash':'iyuX',
        'sum':750.0,
        'discount':0.0,
        'before_taxes':750.0,
        'taxes':172.5,
        'total':922.5,
        'currency':'Euro',
        'client':{
            'id':1234567,
            'name':'John Doe',
            'code':'XYZ123',
        },
        'items':[
            {
                'name':'SRV1',
                'description':'Service 1',
                'unit_price':'150.0',
                'unit':None,
                'quantity':'5.0',
                'tax':{
                    'id':123456,
                    'name':'IVA23',
                    'value':23.0
                },
                'discount':0.0,
                'subtotal':750.0,
                'tax_amount':172.5,
                'discount_amount':0.0,
                'total':922.5
            }
        ]
    }
}

Set invoice state and send by e-mail

>>> ie.invoices.change_state(c, 12345678, ie.invoices.States.FINAL)
>>> ie.invoices.send_email(c, 12345678, 'name@domain.tld',
                           'New invoice!',
                           'Hi John,\r\nHere is your invoice\r\nRegards,')

License

MIT License. See the LICENSE file for details.

Metadata

Release files for invoicexpress-api 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for invoicexpress-api 0.1.2
File Size Uploaded Provenance Actions
invoicexpress_api-0.1.2.tar.gz 4.7 kB Without provenance Details for invoicexpress_api-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for invoicexpress-api 0.1.2
File Interpreter ABI Platform Actions
invoicexpress_api-0.1.2-py2.py3-none-any.whl Python 3, Python 2 none any Details for invoicexpress_api-0.1.2-py2.py3-none-any.whl

Total release size: 9.8 kB

Release files / invoicexpress_api-0.1.2.tar.gz

Download URL invoicexpress_api-0.1.2.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
12dbdbb0cbb50e780420b5011846ac23dab26346908574810320ae9b33379f6d
BLAKE2b-256 checksum
How to use checksums
aa6b4725f6f0e12d445b25c9ee813c32e8e8562a2c1b2ec6c4b5c72355f12af9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / invoicexpress_api-0.1.2-py2.py3-none-any.whl

Download URL invoicexpress_api-0.1.2-py2.py3-none-any.whl
Size 5.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
bd525445cf9b0f9f4a01c45e70ecc273affde73ad9b62a2712b4ec7593ebe8ab
BLAKE2b-256 checksum
How to use checksums
f5ac636b41c4672f94770884133d73cf222ec31b42bd5d757b3279211888b136
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for invoicexpress-api 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page