node-freee-api
Install
$ npm install freee-api
Overview
freee API v1.0 API Client.
var Freee = require('freee-api');
Freee.configure({
appId: config.appId,
secret: config.secret,
callback: config.callback
});
var url = Freee.getAuthorizeURL();
Freee.fetchToken(req.query.code, function(err, token) {
req.session.token = token;
});
var freee = new Freee(req.session.token);
if (freee.token.isExpired()) {
freee.token.refresh(function(err, token) {
req.session.token = token;
});
}
freee.me(function(err, user) {
});
freee.companies(function(err, companies) {
});
freee.walletables(companyId, function(err, walletables) {
});
freee.walletTxns(params, function(err, walletTxns) {
});
freee.accountItems(companyId, function(err, accountItems) {
});
freee.deals(companyId, function(err, deals) {
});
freee.items(companyId, function(err, items) {
});
freee.partners(companyId, function(err, partners) {
});
freee.taxes(companyId, function(err, taxes) {
});
freee.transfers(companyId, function(err, transfers) {
});
Run example app
- create new application from here and get appId and Secret.
- Set callback url to
http://localhost:9000/callback
. - Run below commands.
$ git clone git@github.com:hokaccha/node-freee-api.git
$ cd node-freee-api
$ npm install
$ cd example/webapp
$ echo APP_ID=your-app-id >> .env
$ echo SECRET=your-app-secret >> .env
$ node app.js
TODO
License
MIT