Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

会計 freee APIのjavascript SDK(β版)です。

License

Notifications You must be signed in to change notification settings

freee/freee-accounting-sdk-javascript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

このリポジトリは 2024 年 9 月にサポートを終了します。 詳細は「freee 会計 SDK / freee-accounting-sdk-javascript のメンテナンス終了について」をご覧ください。

Installation

use npm

npm install freee-accounting-client --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file, that's to say your javascript file where you actually use this library):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false,
      },
    },
  ];
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var FreeeAccountingClient = require("freee-accounting-client");

var defaultClient = FreeeAccountingClient.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications["oauth2"];
oauth2.accessToken = accessToken; // assign access token here.

var api = new FreeeAccountingClient.AccountItemsApi();

var parameters = new FreeeAccountingClient.AccountItemParams(); // {AccountItemParams} 勘定科目の作成

var callback = function (error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log("API called successfully. Returned data: " + data);
  }
};
api.createAccountItem(parameters, callback);

Documentation for API Endpoints

All URIs are relative to https://api.freee.co.jp/api/1

Class Method HTTP request Description
FreeeAccountingClient.AccountItemsApi createAccountItem POST /account_items 勘定科目の作成
FreeeAccountingClient.AccountItemsApi getAccountItem GET /account_items/{id} 勘定科目の詳細情報の取得
FreeeAccountingClient.AccountItemsApi getAccountItems GET /account_items 勘定科目一覧の取得
FreeeAccountingClient.AccountItemsApi updateAccountItem PUT /account_items/{id} 勘定科目の更新
FreeeAccountingClient.BanksApi getBanks GET /banks 連携サービス一覧の取得
FreeeAccountingClient.CompaniesApi getCompanies GET /companies 事業所一覧の取得
FreeeAccountingClient.CompaniesApi getCompany GET /companies/{id} 事業所の詳細情報の取得
FreeeAccountingClient.CompaniesApi updateCompany PUT /companies/{id} 事業所情報の更新
FreeeAccountingClient.DealsApi createDeal POST /deals 取引(収入/支出)の作成
FreeeAccountingClient.DealsApi getDeal GET /deals/{id} 取引(収入/支出)の取得
FreeeAccountingClient.DealsApi getDeals GET /deals 取引(収入/支出)一覧の取得
FreeeAccountingClient.DealsApi updateDeal PUT /deals/{id} 取引(収入/支出)の更新
FreeeAccountingClient.ExpenseApplicationLineTemplatesApi getExpenseApplicationLineTemplates GET /expense_application_line_templates 経費科目一覧の取得
FreeeAccountingClient.ExpenseApplicationsApi createExpenseApplication POST /expense_applications 経費申請の作成
FreeeAccountingClient.ExpenseApplicationsApi destroyExpenseApplication DELETE /expense_applications/{id} 経費申請の削除
FreeeAccountingClient.ExpenseApplicationsApi updateExpenseApplication PUT /expense_applications/{id} 経費申請の更新
FreeeAccountingClient.InvoicesApi destroyInvoice DELETE /invoices/{id} 請求書の削除
FreeeAccountingClient.InvoicesApi updateInvoice PUT /invoices/{id} 請求書の更新
FreeeAccountingClient.ItemsApi createItem POST /items 品目の作成
FreeeAccountingClient.ItemsApi getItems GET /items 品目一覧の取得
FreeeAccountingClient.JournalsApi downloadJournal GET /journals/reports/{id}/download ダウンロード実行
FreeeAccountingClient.JournalsApi getJournalStatus GET /journals/reports/{id}/status ステータス確認
FreeeAccountingClient.JournalsApi getJournals GET /journals ダウンロード要求
FreeeAccountingClient.ManualJournalsApi createManualJournal POST /manual_journals 振替伝票の作成
FreeeAccountingClient.ManualJournalsApi destroyManualJournal DELETE /manual_journals/{id} 振替伝票の削除
FreeeAccountingClient.ManualJournalsApi getManualJournal GET /manual_journals/{id} 振替伝票の取得
FreeeAccountingClient.ManualJournalsApi getManualJournals GET /manual_journals 振替伝票一覧の取得
FreeeAccountingClient.ManualJournalsApi updateManualJournal PUT /manual_journals/{id} 振替伝票の更新
FreeeAccountingClient.PartnersApi createPartner POST /partners 取引先の作成
FreeeAccountingClient.PartnersApi getPartners GET /partners 取引先一覧の取得
FreeeAccountingClient.PartnersApi updatePartner PUT /partners/{id} 取引先の更新
FreeeAccountingClient.PaymentsApi createDealPayment POST /deals/{id}/payments 取引(収入/支出)の支払行作成
FreeeAccountingClient.PaymentsApi destroyDealPayment DELETE /deals/{id}/payments/{payment_id} 取引(収入/支出)の支払行削除
FreeeAccountingClient.PaymentsApi updateDealPayment PUT /deals/{id}/payments/{payment_id} 取引(収入/支出)の支払行更新
FreeeAccountingClient.ReceiptsApi createReceipt POST /receipts ファイルボックス 証憑ファイルアップロード
FreeeAccountingClient.RenewsApi createDealRenew POST /deals/{id}/renews 取引(収入/支出)に対する+更新の作成
FreeeAccountingClient.RenewsApi deleteDealRenew DELETE /deals/{id}/renews/{renew_id} 取引(収入/支出)の+更新の削除
FreeeAccountingClient.RenewsApi updateDealRenew PUT /deals/{id}/renews/{renew_id} 取引(収入/支出)の+更新の更新
FreeeAccountingClient.SectionsApi createSection POST /sections 部門の作成
FreeeAccountingClient.SectionsApi destroySection DELETE /sections/{id} 部門の削除
FreeeAccountingClient.SectionsApi getSections GET /sections 部門一覧の取得
FreeeAccountingClient.SectionsApi updateSection PUT /sections/{id} 部門の更新
FreeeAccountingClient.SegmentTagsApi createSegmentTag POST /segments/{segment_id}/tags セグメントの作成
FreeeAccountingClient.SegmentTagsApi destroySegmentsTag DELETE /segments/{segment_id}/tags/{id} セグメントタグの削除
FreeeAccountingClient.SegmentTagsApi getSegmentTags GET /segments/{segment_id}/tags セグメントタグ一覧の取得
FreeeAccountingClient.SegmentTagsApi updateSegmentTag PUT /segments/{segment_id}/tags/{id} セグメントタグの更新
FreeeAccountingClient.SelectablesApi getFormsSelectables GET /forms/selectables フォーム用選択項目情報の取得
FreeeAccountingClient.TagsApi createTag POST /tags メモタグの作成
FreeeAccountingClient.TagsApi getTags GET /tags メモタグ一覧の取得
FreeeAccountingClient.TaxesApi getTaxCodes GET /taxes/codes 税区分コード一覧の取得
FreeeAccountingClient.TaxesApi getTaxes GET /taxes 税区分一覧の取得 (deprecated)
FreeeAccountingClient.TransfersApi createTransfer POST /transfers 取引(振替)の作成
FreeeAccountingClient.TransfersApi getTransfers GET /transfers 取引(振替)一覧の取得
FreeeAccountingClient.TrialBalanceApi getTrialBs GET /reports/trial_bs 貸借対照表の取得
FreeeAccountingClient.TrialBalanceApi getTrialBsThreeYears GET /reports/trial_bs_three_years 貸借対照表(3期間比較)の取得
FreeeAccountingClient.TrialBalanceApi getTrialBsTwoYears GET /reports/trial_bs_two_years 貸借対照表(前年比較)の取得
FreeeAccountingClient.TrialBalanceApi getTrialPl GET /reports/trial_pl 損益計算書の取得
FreeeAccountingClient.TrialBalanceApi getTrialPlSections GET /reports/trial_pl_sections 損益計算書(部門比較)の取得
FreeeAccountingClient.TrialBalanceApi getTrialPlThreeYears GET /reports/trial_pl_three_years 損益計算書(3期間比較)の取得
FreeeAccountingClient.TrialBalanceApi getTrialPlTwoYears GET /reports/trial_pl_two_years 損益計算書(前年比較)の取得
FreeeAccountingClient.UsersApi getUsersCapabilities GET /users/capabilities ログインユーザの権限の取得
FreeeAccountingClient.UsersApi getUsersMe GET /users/me ログインユーザ情報の取得
FreeeAccountingClient.WalletTxnsApi createWalletTxn POST /wallet_txns 明細の作成
FreeeAccountingClient.WalletTxnsApi getWalletTxns GET /wallet_txns 明細一覧の取得
FreeeAccountingClient.WalletablesApi createWalletable POST /walletables 口座の作成
FreeeAccountingClient.WalletablesApi getWalletables GET /walletables 口座一覧の取得