/node-fatturazione-elettronica-aruba

Node.js client per le API di Aruba Fattura Elettronica

Primary LanguageJavaScriptMIT LicenseMIT

fatturazione-elettronica-aruba

License: MIT build npm version Coverage Status PRs Welcome

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

Currently in beta version and under development until Aruba releases a final version of their API. The API of this module should be stable and you can start using it.

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

License

node-fattura-elettronica-aruba is MIT licensed.