Skip to content

eliaskress/flowcheck-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

FlowCheck Examples

Example code for the FlowCheck API — one API for Stripe payouts and bank data.

FlowCheck connects your Stripe payouts and bank accounts (via Plaid) into a single, clean API. Check balances, track payouts, reconcile transactions, and catch discrepancies. Setup takes 20 minutes.

Quick Start

1. Get an API key

# Register (no auth required)
curl -X POST https://developer.usepopup.com/api/v0/auth/register \
  -H "Content-Type: application/json" \
  -d '{"email": "dev@example.com"}'

# Complete checkout, then check status
curl "https://developer.usepopup.com/api/v0/auth/register/status?token=YOUR_TOKEN"
# → { "data": { "status": "active", "api_key": "fc_test_..." } }

2. Check your balance

curl https://developer.usepopup.com/api/v0/balance \
  -H "Authorization: Bearer fc_test_your_key_here"
{
  "data": {
    "stripe": { "available": 142350, "pending": 28900, "currency": "usd" },
    "bank": { "available": 138200, "current": 145000, "currency": "usd" }
  }
}

All amounts are in cents.

Using the TypeScript SDK

npm install @flowcheck/sdk
import { FlowCheck } from "@flowcheck/sdk";

const fc = new FlowCheck("fc_live_your_key_here");

// Check balances
const { data: balance } = await fc.balance();
console.log(`Stripe: $${balance.stripe.available / 100}`);
console.log(`Bank:   $${balance.bank.available / 100}`);

// List recent payouts
const { data: payouts } = await fc.payouts({ status: "paid", limit: 10 });
for (const p of payouts) {
  console.log(`${p.id}: $${p.amount / 100}${p.reconciliation.status}`);
}

// Reconciliation health
const { data: summary } = await fc.reconciliationSummary();
console.log(`Health score: ${summary.health_score}/100`);
console.log(`Matched: ${summary.matched}/${summary.total_payouts}`);

// Check for problems
const { data: discrepancies } = await fc.discrepancies({ status: "open" });
for (const d of discrepancies) {
  console.log(`${d.type}: ${d.description}`);
}

Using with Claude Code (MCP)

FlowCheck has an MCP server that gives Claude Code direct access to your financial data.

Setup

claude mcp add --transport stdio \
  --env FLOWCHECK_API_KEY=fc_live_your_key \
  flowcheck -- npx -y @flowcheck/mcp-server

Or add to your project's .mcp.json:

{
  "mcpServers": {
    "flowcheck": {
      "command": "npx",
      "args": ["-y", "@flowcheck/mcp-server"],
      "env": {
        "FLOWCHECK_API_KEY": "${FLOWCHECK_API_KEY}"
      }
    }
  }
}

Then just ask

  • "What's my current balance across Stripe and my bank?"
  • "Show me unmatched payouts from the last 30 days"
  • "Are there any discrepancies I should look at?"
  • "Give me a financial position summary"
  • "Set up a webhook for payout discrepancy events"

Claude Code calls the FlowCheck tools directly — no code to write.

Examples

Example Description
examples/balance.ts Check Stripe + bank balances
examples/reconciliation.ts Monitor reconciliation health and investigate mismatches
examples/webhooks.ts Register a webhook and verify signatures
examples/cashflow.ts Daily cash flow breakdown
examples/agent.ts AI agent financial summary

API Reference

Endpoints

Endpoint Description
GET /v0/balance Stripe + bank balances in one call
GET /v0/cashflow Daily inflow/outflow (7d, 30d, 90d)
GET /v0/payouts List payouts with reconciliation status
GET /v0/payouts/:id Single payout with match details
GET /v0/transactions Bank transactions from Plaid
GET /v0/discrepancies Missing deposits, amount mismatches
GET /v0/reconcile/summary 30-day reconciliation health score
GET /v0/reconcile/:payout_id Per-payout reconciliation detail
GET /v0/agent/position Financial summary for AI agents
GET /v0/agent/alerts Active alerts for AI agents
POST /v0/connect/stripe Connect Stripe account
POST /v0/connect/plaid/link-token Start Plaid bank connection
POST /v0/connect/plaid/exchange Complete Plaid connection
GET /v0/webhooks List webhook endpoints
POST /v0/webhooks Register webhook (HMAC-signed)
DELETE /v0/webhooks/:id Remove webhook

Pricing

Plan Price Credits/mo Rate Limit
Trial Free (7 days) 100 60/min
Starter $4.99/mo 1,000 300/min
Growth $19/mo 5,000 600/min
Pro $49/mo 15,000 600/min
Scale Custom Custom 6,000/min

1 credit = 1 API request. Webhook deliveries are free. Sandbox is always free.

Links

About

Example code and quick-start guides for the FlowCheck API — Stripe + Plaid reconciliation in one API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors