/node-fatturazione-elettronica-aruba

Node.js client to integrate the Aruba API for electronic invoicing ("Fatturazione Elettronica") within your project.

Primary LanguageJavaScriptMIT LicenseMIT

fatturazione-elettronica-aruba

License: MIT Release npm version Coverage Status PRs Welcome FOSSA Status Known Vulnerabilities semantic-release

Node.js client to integrate the Aruba API for electronic invoicing ("Fatturazione Elettronica") within your project.

Roadmap

  • Complete support for Notifications
  • Implement MonitorCheck API
  • Add any new feature introduces by Aruba last minute

Links

Requirements

This module calls the Aruba Fatturazione Elettronica API, therefore you need a valid set of credentials with their service in order to use this module.

Install

npm install fatturazione-elettronica-aruba

How to use

const ArubaClient = require('fatturazione-elettronica-aruba');

const arubaClient = new ArubaClient();

await arubaClient.signIn({
  username: 'YOUR_ARUBA_USERNAME',
  password: 'YOUR_ARUBA_PASSWORD'
});

await arubaClient.uploadInvoice({ dataFile: 'BASE64_ENCODED_XML' });

Examples

See the examples page for additional use cases and demos.

API

Table of Contents

ArubaClient

ArubaClient constructor

Parameters

  • options Object?
    • options.env string? Aruba environment (demo or prod)

Returns Object Returns an instance of ArubaClient

signIn

Calls Aruba to generate a JWT that will be used for future calls

Parameters

Returns Promise Resolves to an boolean if successful, or an object containing the error message

refreshToken

Calls Aruba to refresh the JWT

Returns Promise Resolves to an boolean if successful, or an object containing the error message

searchInvoice

Search an invoice by username, filename, or id

Parameters
  • data (optional, default {})

Returns Promise Resolves to an boolean if successful, or an object containing the error message

getInvoiceNotifications

Get the invoice notifications

Parameters
  • data (optional, default {})

Returns Promise Resolves to an boolean if successful, or an object containing the error message

uploadInvoice

Calls Aruba to upload an invoice

Parameters
  • data Object (optional, default {})
    • data.dataFile string base64 encoded XML
    • data.signed boolean leave false if you are not sure (optional, default false)
    • data.credential string? signature creds (leave false if you are not sure)
    • data.domain string? signature domain (leave false if you are not sure)

Returns Promise Resolves with the uploadFileName if successfull

Disclaimer

This is a community driven open-source module.

License

node-fattura-elettronica-aruba is MIT licensed.

FOSSA Status

Support on Beerpay

Hey dude! Help me out for a couple of 🍻!

Beerpay Beerpay