moloni

Moloni API client library for node.js ======================================

Usage no npm install needed!

<script type="module">
  import moloni from 'https://cdn.skypack.dev/moloni';
</script>

README

Moloni API client library for node.js

node-moloni aims to provide a complete, asynchronous client library for the Moloni API services (https://www.moloni.com/dev/).

Requirements

You can install node-moloni and its dependencies with npm: npm install moloni.

  • node v0.10+ (earlier versions of node were not tested but it should work as soon as 0.6)

Getting started

var Moloni = require('moloni');
var moloni = new Moloni({
    client_id: 'YOUR_CLIENT_ID',
    client_secret: 'YOUR_CLIENT_SECRET',
    username: 'YOUR_USERNAME',
    password: 'YOUR_PASSWORD'
});

Make an API call

moloni.users('getMe', function (error, result) {
    if (error)
        return console.error(error);

    console.log(result);
});

Getting something more complex done

var params = {
    ...
};

moloni.customers('insert', params, function (error, result) {
    if (error)
        return console.error(error);

    console.log(result);
});

Sandbox mode for testing

You can just pass "sandbox: true" to initialize in sandbox mode.

var moloni = new Moloni({
    client_id: 'YOUR_CLIENT_ID',
    client_secret: 'YOUR_CLIENT_SECRET',
    username: 'YOUR_USERNAME',
    password: 'YOUR_PASSWORD',
    sandbox: true
});

Contributors

TODO

Bitdeli Badge