npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@rantalainen/fennoa-api-client

v0.0.2

Published

FennoaApiClient is a third party Fennoa API client.

Downloads

3

Readme

fennoa-api-client

FennoaApiClient is a third party Fennoa API client.

:warning: This tool is in early stages and is subject to change.

Installation

Add to project's package.json:

npm install @rantalainen/fennoa-api-client

Setup

Import to NodeJS project

const { FennoaApiClient } = require('@rantalainen/fennoa-api-client');

Import to TypeScript project

import { FennoaApiClient } from '@rantalainen/fennoa-api-client';

Setup client with options

In order to obtain an API key, please contact Fennoa Sales or Fennoa Support. An API key is needed to access all API functions.

const fennoa = new FennoaApiClient({
  // Mandatory options:
  fennoaUser: 'selected_company_identifier',
  fennoaPassword: 'api_key',

  // Optional options (and default values):
  apiBaseUrl: 'https://app.fennoa.com/api',
  timeout: 120000
});

Implemented methods

The following api methods have been implemented:

  • customers Customers
  • sales Sales invoices

Getter examples

Each resource type has getAll() and getById(1234) getters (below examples with customers):

const customers = await fennoa.customers.getAll(); // array of customers
const customer = await fennoa.customers.getById(1234); // single customer

Sales examples

Here is an example of creating, approving and sending a new sales invoice to a customer:

const invoice = {
  name: 'Customer Inc',
  address: 'Mariankatu 2',
  postalcode: '00170',
  city: 'Helsinki',
  country: 'FI',
  invoice_date: '2018-12-12',
  due_date: '2018-12-26',
  row: [
    {
      name: 'My product',
      description: 'Describe product here',
      price: 14.5,
      quantity: 3,
      vatpercent: 14
    },
    {
      name: 'My service',
      description: 'Describe service here',
      price: 56.66,
      quantity: 12.5,
      vatpercent: 24
    }
  ]
};

// Create a new sales invoice to Fennoa
const newInvoiceId = await fennoa.sales.createInvoice(invoice);
console.log(`Sales invoice #${newInvoiceId} created`);

// Approve created sales invoice and send it to customer
await fennoa.sales.approveInvoice(newInvoiceId);
await fennoa.sales.sendInvoice(newInvoiceId);
console.log(`Sales invoice #${newInvoiceId} approved and sent to customer`);

Create a new sales invoice using FORM DATA:

const newInvoiceId = await fennoa.sales.createInvoiceByFormData(formData);

Create a new sales invoice from Finvoice XML data:

const newInvoiceId = await fennoa.sales.createInvoiceByFinvoiceXML(xml);

Resources

  • Fennoa website: https://www.fennoa.com/
  • Fennoa API Documentation: https://www.fennoa.com/api-documentation/
  • Fennoa login page: https://app.fennoa.com/login

Changelog

  • 0.0.1 First release
  • 0.0.2 Switching FormData type import