Skip to content

deal — 取引

取引(売上・経費)のCRUD操作を行います。

サブコマンド

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

deal list

freee deal list [flags]

フラグ

フラグ必須説明
--typestring任意種別フィルタ: income / expense
--partnerstring任意取引先コードでフィルタ
--fromstring任意開始日 (YYYY-MM-DD)
--tostring任意終了日 (YYYY-MM-DD)
--statusstring任意状態フィルタ: settled / unsettled
--limitint任意1ページあたり最大件数(デフォルト: 50)
--offsetint任意ページネーション用オフセット
--allbool任意全ページを自動取得
--formatstring任意出力形式: table / json / yaml / csv
--no-headerbool任意ヘッダー行を非表示

deal show

freee deal show <id> [flags]

フラグ

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

deal create

freee deal create [flags]

フラグ

フラグ必須説明
--typestring必須種別: income / expense
--datestring必須発生日 (YYYY-MM-DD)
--amountint64必須金額
--account-item-idint64必須勘定科目ID(--account-name と排他)
--account-namestring任意勘定科目名(IDに解決)
--account-item-namestring任意--account-name のエイリアス
--partner-idint64任意取引先ID(--partner-name と排他)
--partner-namestring任意取引先名(IDに解決)
--tax-codeint64任意税区分コード
--dry-runbool任意APIを呼ばずにリクエスト内容を確認
--formatstring任意出力形式: table / json / yaml / csv

deal update

freee deal update <id> [flags]

フラグ

フラグ必須説明
--typestring任意種別: income / expense
--datestring任意発生日 (YYYY-MM-DD)
--amountint64任意金額
--account-item-idint64任意勘定科目ID
--account-namestring任意勘定科目名(IDに解決)
--account-item-namestring任意--account-name のエイリアス
--partner-idint64任意取引先ID
--partner-namestring任意取引先名(IDに解決)
--tax-codeint64任意税区分コード
--dry-runbool任意APIを呼ばずにリクエスト内容を確認

deal delete

freee deal delete <id> [--dry-run]

使用例

bash
# 取引一覧
freee deal list
ID        DATE        TYPE     AMOUNT   STATUS
12345678  2026-04-01  expense  50000    settled
12345679  2026-04-01  income   120000   unsettled
bash
# 今年の未決済取引をすべて取得
freee deal list --status unsettled --all

# 経費取引を作成(勘定科目名で指定)
freee deal create \
  --type expense \
  --date 2026-04-01 \
  --account-name 旅費交通費 \
  --partner-name 株式会社ABC \
  --amount 5000

# 取引を確認してから作成
freee deal create --type income --date 2026-04-01 \
  --account-item-id 100 --amount 100000 --dry-run

# 取引の詳細をJSON形式で取得
freee deal show 12345678 --format json

# 取引の金額を更新
freee deal update 12345678 --amount 55000

# 取引を削除
freee deal delete 12345678