# Reconciliation and Cleanup

<details>

<summary><strong>Daily Unreconciled Transaction Alert</strong></summary>

**The Script**

bash

```bash
#!/bin/bash
# daily-recon-alert.sh

WEBHOOK_URL="https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK"

count=$(kick transactions list \
  --filter="reconciled=false" \
  --format=json | jq 'length')

if [ "$count" -gt 0 ]; then
  oldest=$(kick transactions list \
    --filter="reconciled=false" \
    --format=json | jq -r 'sort_by(.date) | .[0].date')
  
  message="⚠️ *$count unreconciled transactions*\nOldest: $oldest\n<https://app.kick.co/transactions|View>"
  
  curl -X POST "$WEBHOOK_URL" \
    -H 'Content-Type: application/json' \
    -d "{\"text\":\"$message\"}"
  
  echo "Alert sent: $count unreconciled transactions"
else
  echo "✓ All transactions reconciled"
fi
```

**How to Customize**

* Change notification channel (email, Teams, Discord)
* Add threshold: only alert if count > 10
* Schedule with cron to run daily

**What It Outputs**

```
⚠️ 23 unreconciled transactions
Oldest: 2026-01-15
```

</details>

<details>

<summary><strong>Find Transactions Missing Required Fields</strong></summary>

**The Script**

bash

```bash
#!/bin/bash
# find-incomplete-transactions.sh

FROM_DATE="2026-01-01"
TO_DATE="2026-01-31"
OUTPUT_FILE="incomplete-transactions.csv"

echo "date,amount,counterparty,missing_fields" > "$OUTPUT_FILE"

kick transactions list \
  --from="$FROM_DATE" \
  --to="$TO_DATE" \
  --format=json | \
jq -r '.[] |
  select(.memo == null or .class == null or .category == null) |
  [
    .date,
    .amount,
    .counterparty,
    ([
      (if .memo == null then "memo" else empty end),
      (if .class == null then "class" else empty end),
      (if .category == null then "category" else empty end)
    ] | join("; "))
  ] |
  @csv' >> "$OUTPUT_FILE"

count=$(tail -n +2 "$OUTPUT_FILE" | wc -l)

echo "Found $count transactions with missing fields"
echo "Exported to $OUTPUT_FILE"
```

**How to Customize**

* Change required fields based on your workflow
* Add amount threshold
* Auto-assign default values

**What It Outputs**

```
Found 15 transactions with missing fields
Exported to incomplete-transactions.csv
```

</details>


---

# Agent Instructions: 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:

```
GET https://docs.kick.co/ai/kick-cli/cli-use-case-library/reconciliation-and-cleanup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
