Nfeiow

NFE.io wrapper to create, cancel, download (pdf) and send invoices via email.

Installation

Add this line to your application's Gemfile:

gem 'nfeiow'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install nfeiow

Usage

Initialize

client = Nfeiow::Client.new(company_id, api_key)

Connection details

client.connection

Create invoice - Api Reference

params = {
    borrower: {
        federalTaxNumber: '65043222018', # Only numbers
        name: 'José Anchieta',
        email: '[email protected]',
        address: {
        country: 'BRA',
        postalCode: '86055620', # Only numbers
        street: 'Rua Ulrico Zuinglio',
        number: '870',
        additionalInformation: 'Apto. 550',
        district: 'Gleba Palhano',
        city: {
            code: 4113700,
            name: 'Londrina'
        },
        state: 'PR'
        }
    },
    cityServiceCode: '8599699',
    cnaeCode: '8599699',
    description: 'Cursos online.',
    servicesAmount: 99.9
}

client.create_invoice(params)

Cancel invoice - Api Reference

client.cancel_invoice(invoice_id)

Download invoice (pdf) - Api Reference

client.download_invoice_pdf(invoice_id)

Send invoice by email - Api Reference

client.send_invoice_via_email(invoice_id)

License

The gem is available as open source under the terms of the MIT License.