Project

nfeiow

0.0
No release in over 3 years
Low commit activity in last 3 years
A simple wrapper of the NFE io API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.0
~> 0.13.1
~> 12.3.3
~> 3.0
~> 1.7
~> 0.40
~> 5.1
~> 3.8

Runtime

>= 0.73.0
 Project Readme

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

# Create an initializer and configure your nfe_company_id and nfe_api_key
Nfeiow::ClientConfiguration.configure do |config|
  config.nfe_company_id = '123'
  config.nfe_api_key = '123abc'
end

Create invoice - Api Reference

params = {
    borrower: {
        federalTaxNumber: '65043222018', # Only numbers
        name: 'José Anchieta',
        email: 'anchieta@jose.com',
        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
}

Nfeiow::Client.new.create_invoice(params)

Cancel invoice - Api Reference

Nfeiow::Client.new.cancel_invoice(invoice_id)

Download invoice (pdf) - Api Reference

Nfeiow::Client.new.download_invoice_pdf(invoice_id)

Send invoice by email - Api Reference

Nfeiow::Client.new.send_invoice_via_email(invoice_id)

License

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