Skip to content

manual-journal — 振替伝票

振替伝票のCRUD操作を行います。シンプルモード(1:1仕訳)とJSONモード(複数行仕訳)に対応します。

サブコマンド

サブコマンド説明
list振替伝票一覧を表示
show <id>振替伝票の詳細を表示
create振替伝票を作成
update <id>振替伝票を更新
delete <id>振替伝票を削除

manual-journal list

freee manual-journal list [flags]

フラグ

フラグ必須説明
--fromstring任意開始日 (YYYY-MM-DD)
--tostring任意終了日 (YYYY-MM-DD)
--entry-sidestring任意仕訳側フィルタ: debit / credit
--account-item-idint64任意勘定科目IDフィルタ
--partner-idint64任意取引先IDフィルタ
--adjustmentstring任意決算整理フィルタ: only / without
--min-amountint64任意金額下限フィルタ
--max-amountint64任意金額上限フィルタ
--item-idint64任意品目IDフィルタ
--section-idint64任意部門IDフィルタ
--txn-numberstring任意仕訳番号フィルタ
--limitint任意1ページあたり最大件数(デフォルト: 50)
--offsetint任意ページネーション用オフセット
--allbool任意全ページを自動取得
--formatstring任意出力形式: table / json / yaml / csv
--no-headerbool任意ヘッダー行を非表示

manual-journal show

freee manual-journal show <id> [flags]

フラグ

フラグ必須説明
--formatstring任意出力形式: table / json / yaml / csv

manual-journal create

シンプルモードとJSONモードは排他です。どちらか一方を使用してください。

freee manual-journal create [flags]

共通フラグ

フラグ必須説明
--datestring必須発生日 (YYYY-MM-DD)
--adjustmentbool任意決算整理仕訳としてマーク
--dry-runbool任意APIを呼ばずにリクエスト内容を確認
--formatstring任意出力形式: table / json / yaml / csv

シンプルモード フラグ(1:1仕訳)

フラグ必須説明
--debit-account-idint64任意借方勘定科目ID(--debit-account-name と排他)
--debit-account-namestring任意借方勘定科目名(IDに解決)
--credit-account-idint64任意貸方勘定科目ID(--credit-account-name と排他)
--credit-account-namestring任意貸方勘定科目名(IDに解決)
--amountint64任意金額
--tax-codeint64任意税区分コード(シンプルモードでは必須)
--descriptionstring任意摘要

JSONモード フラグ(複数行仕訳)

フラグ必須説明
--details-jsonstring任意仕訳明細をJSON文字列で指定
--details-filestring任意仕訳明細をJSONファイルパスで指定

manual-journal update

freee manual-journal update <id> [flags]

シンプルモード・JSONモードのフラグは create と同様です。フラグ未指定の明細は現在の値を維持します。

追加フラグ

フラグ必須説明
--datestring任意発生日 (YYYY-MM-DD)
--adjustmentbool任意決算整理仕訳フラグ
--dry-runbool任意APIを呼ばずにリクエスト内容を確認

manual-journal delete

freee manual-journal delete <id> [--dry-run]

使用例

bash
# シンプルモード:1:1仕訳を作成
freee manual-journal create \
  --date 2026-04-01 \
  --debit-account-name 旅費交通費 \
  --credit-account-name 未払費用 \
  --amount 5000 \
  --tax-code 1 \
  --description "出張交通費"

# JSONモード:複数行仕訳を作成
freee manual-journal create \
  --date 2026-04-01 \
  --details-json '[
    {"entry_side":"debit","account_item_id":210,"amount":10000,"tax_code":1,"description":"交通費"},
    {"entry_side":"debit","account_item_id":220,"amount":5000,"tax_code":1,"description":"宿泊費"},
    {"entry_side":"credit","account_item_id":400,"amount":15000,"tax_code":0,"description":"仮払精算"}
  ]'

# ファイルから仕訳明細を読み込む
freee manual-journal create --date 2026-04-01 --details-file ./entries.json

# 振替伝票一覧
freee manual-journal list --from 2026-04-01 --to 2026-04-30
ID     DATE        ADJUSTMENT  LINES
55001  2026-04-01  false       2
55002  2026-04-01  false       3
bash
# 振替伝票の詳細
freee manual-journal show 55001
ID:         55001
Date:       2026-04-01
Adjustment: No
Details:
  [1] debit  Account:210 Amount:5000 VAT:500  Tax:1 "出張交通費"
  [2] credit Account:400 Amount:5000 VAT:500  Tax:1 "出張交通費"

JSONモード バリデーション

借方合計と貸方合計が一致しない場合はエラーになります。 明細行の合計は最大100行です。各行に tax_code が必須です。