🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more
Socket
Book a DemoInstallSign in
Socket

node-tw-e-invoice

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-tw-e-invoice

An unofficial Node.js interface of Taiwan MOF E-Invoice API . 台灣財政部電子發票 API 的 非官方 Node.js 介面。

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

node-tw-e-invoice

An unofficial Node.js interface of Taiwan MOF E-Invoice API . 台灣財政部電子發票 API 的 非官方 Node.js 介面。

npm i node-tw-e-invoice --save

Feature

  • Request by action
  • Request parameters schema validation
  • Provide serial number generator
  • Auto convert to Unix timestap
  • Auto generate signature

Not implement :

  • Real HTTP Request

    Retrun Promise contain path,method & param values .

  • Request Individual statistics information

Example

require('dotenv').config();
const {TaiwanEInvoice, InquirerIdentity, CarrierCardType}= require('node-tw-e-invoice');
const {Serial}= require('node-tw-e-invoice').APIUtil;

//Create TaiwanEInvoice instance
const EInvoice = new TaiwanEInvoice(process.env.APP_ID,process.env.API_KEY);

// Create serial number generator
const serial = new Serial();


EInvoice.inquirer(process.env.UUID,InquirerIdentity.Common)//Declare identity
.action('qryCarrierAgg',{//Request by action
  serial:serial.next(),
  cardType: CarrierCardType.Mobile,
  cardNo:'/AB56P5Q',
  timeStamp:new Date(),
  cardEncrypt:'password'
}).then((values)=>{//Return Promise
  let {path,method,param}  = values;
  param.timeStamp += 10;
  console.log(param)
  //start sending a request ...
}).catch((err)=>{
  let {name, details} = err;//Get error if schema validate fail
  console.log(name);
  console.log(details[0].message);
});

Documentation

  • Check out the Using Guides
  • Check out the API Doc

Official specifications

Keywords

e-invoice

FAQs

Package last updated on 21 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts