> For the complete documentation index, see [llms.txt](https://docs.kick.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kick.co/ai/cli/cli-use-case-library/transaction-management.md).

# Transaction Management

<details>

<summary><strong>Export uncategorized transactions for review</strong> (read)</summary>

To pull transactions that still need a category before you close a period, fetch JSON for the date range and filter client-side. The CLI does not support a `category=null` filter flag.

**The Script**

```bash
#!/bin/bash
# export-uncategorized.sh

WORKSPACE_ID="<workspace-id>"
SINCE="2026-01-01"
UNTIL="2026-01-31"
OUTPUT_FILE="uncategorized-$(date +%Y%m%d).json"

kick --workspace "$WORKSPACE_ID" transactions find \
  --since "$SINCE" \
  --until "$UNTIL" \
  --fields id,date,amount,counterparty,category,bank_description \
  --output json \
  | jq '[.[] | select(.category == null or .category == "")]' \
  > "$OUTPUT_FILE"

count=$(jq 'length' "$OUTPUT_FILE")

echo "Exported $count uncategorized transactions to $OUTPUT_FILE"

if [ "$count" -gt 0 ]; then
  echo "Review and update categories in Kick before closing the period"
fi
```

**How to Customize**

* Add `--limit` and follow the next-page hint in stderr when you have more rows than one page
* Pipe to CSV with `jq -r` if your team reviews in a spreadsheet
* Tighten the filter to large amounts: `select((.category == null or .category == "") and (.amount | fabs) > 1000)`

**What It Outputs**

* JSON array of uncategorized transactions
* Console message with the count

</details>

<details>

<summary><strong>Inspect a transaction before updating it</strong> (read, then write)</summary>

To review one transaction and apply a change, fetch it first. Updates require a payload file and preview confirmation.

**The Script**

```bash
#!/bin/bash
# inspect-and-update-transaction.sh

WORKSPACE_ID="<workspace-id>"
TRANSACTION_ID=12345
PAYLOAD_FILE="transaction-update.json"

echo "Current transaction (read):"
kick --workspace "$WORKSPACE_ID" transactions get "$TRANSACTION_ID" --output json | jq .

if [ ! -f "$PAYLOAD_FILE" ]; then
  echo "Create $PAYLOAD_FILE with the fields you want to change, then re-run."
  exit 1
fi

echo ""
echo "Preview update (write):"
kick --workspace "$WORKSPACE_ID" transactions update \
  --transaction-id "$TRANSACTION_ID" \
  --payload-file "$PAYLOAD_FILE"
```

**How to Customize**

* Add `--confirmation-token <token>` on a second run after you review the preview
* Log activity after the update with `kick activity list --resource-id "$TRANSACTION_ID"`

**What It Outputs**

* Full transaction JSON from the read step
* Preview output from the write step (review before confirming)

</details>

<details>

<summary><strong>Find duplicate transactions</strong> (read)</summary>

To flag likely duplicates in a period, group transactions by date, amount, and counterparty.

**The Script**

```bash
#!/bin/bash
# find-duplicates.sh

WORKSPACE_ID="<workspace-id>"
SINCE="2026-01-01"
UNTIL="2026-01-31"

echo "Finding potential duplicates..."

kick --workspace "$WORKSPACE_ID" transactions find \
  --since "$SINCE" \
  --until "$UNTIL" \
  --fields id,date,amount,counterparty \
  --output json | \
jq -r '
  group_by([.date, .amount, .counterparty]) |
  map(select(length > 1)) |
  .[] |
  "Potential duplicates:\n" +
  (map("  ID: \(.id) | \(.date) | \(.amount) | \(.counterparty)") | join("\n")) +
  "\n"
'
```

**How to Customize**

* Include `bank_description` in the group key for stricter matching
* Export matches to CSV for your reconciliation worksheet
* Narrow the date range when paging through large workspaces

**What It Outputs**

```
Potential duplicates:
  ID: 123 | 2026-01-15 | -500.00 | Amazon
  ID: 456 | 2026-01-15 | -500.00 | Amazon
```

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.kick.co/ai/cli/cli-use-case-library/transaction-management.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
