@flowcheck/sdk
Advanced tools
+1
-1
| { | ||
| "name": "@flowcheck/sdk", | ||
| "version": "0.2.1", | ||
| "version": "0.2.2", | ||
| "description": "TypeScript SDK for the FlowCheck API — Stripe payouts, Shopify orders, and bank data in one API", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
+73
-4
| # @flowcheck/sdk | ||
| TypeScript SDK for the [FlowCheck API](https://developer.usepopup.com) — unified access to Stripe revenue and bank transaction data. | ||
| TypeScript SDK for the [FlowCheck API](https://developer.usepopup.com) — unified access to Stripe payouts, Shopify orders, and bank transaction data. | ||
@@ -17,5 +17,14 @@ ## Install | ||
| const fc = new FlowCheck("fc_live_..."); | ||
| // Get cash flow for the last 30 days | ||
| const { data } = await fc.cashflow("30d"); | ||
| console.log(`Net: $${data.net / 100}`); | ||
| console.log(`Net: $${data.net / 100}`); | ||
| // List Shopify payouts only | ||
| const shopify = await fc.payouts({ source: "shopify" }); | ||
| console.log(`${shopify.data.length} Shopify payouts`); | ||
| // Check for unmatched payouts | ||
| const summary = await fc.reconciliationSummary(); | ||
| console.log(summary.data.summary); | ||
| ``` | ||
@@ -57,2 +66,4 @@ | ||
| ### Auth | ||
| | Method | HTTP | Description | | ||
@@ -62,15 +73,36 @@ |--------|------|-------------| | ||
| | `registrationStatus(token)` | `GET /auth/register/status` | Check registration / get API key | | ||
| ### Financial Data | ||
| | Method | HTTP | Description | | ||
| |--------|------|-------------| | ||
| | `balance()` | `GET /balance` | Stripe + bank balances | | ||
| | `cashflow(window?)` | `GET /cashflow` | Revenue, expenses, net by day | | ||
| | `payouts(params?)` | `GET /payouts` | Stripe payouts with match status | | ||
| | `payouts(params?)` | `GET /payouts` | Stripe + Shopify payouts with match status | | ||
| | `payout(id)` | `GET /payouts/:id` | Single payout with bank match | | ||
| | `transactions(params?)` | `GET /transactions` | Bank transactions from Plaid | | ||
| | `discrepancies(params?)` | `GET /discrepancies` | Missing or mismatched amounts | | ||
| | `reconciliationSummary()` | `GET /reconcile/summary` | 30-day financial health score | | ||
| | `reconciliationSummary()` | `GET /reconcile/summary` | 30-day reconciliation summary | | ||
| | `reconciliation(payoutId)` | `GET /reconcile/:id` | Per-payout reconciliation detail | | ||
| ### Agent | ||
| | Method | HTTP | Description | | ||
| |--------|------|-------------| | ||
| | `agentPosition()` | `GET /agent/position` | Full financial snapshot for AI agents | | ||
| | `agentAlerts()` | `GET /agent/alerts` | Active issues for AI agents | | ||
| ### Integrations | ||
| | Method | HTTP | Description | | ||
| |--------|------|-------------| | ||
| | `connectStripe(restrictedKey)` | `POST /connect/stripe` | Connect Stripe account | | ||
| | `connectShopify(shop, accessToken)` | `POST /connect/shopify` | Connect Shopify store | | ||
| | `createPlaidLinkToken()` | `POST /connect/plaid/link-token` | Start Plaid bank connection | | ||
| | `exchangePlaidToken(publicToken)` | `POST /connect/plaid/exchange` | Complete Plaid connection | | ||
| ### Webhooks | ||
| | Method | HTTP | Description | | ||
| |--------|------|-------------| | ||
| | `webhooks()` | `GET /webhooks` | List webhook endpoints | | ||
@@ -80,2 +112,22 @@ | `createWebhook(url, events)` | `POST /webhooks` | Register webhook endpoint | | ||
| ### Billing | ||
| | Method | HTTP | Description | | ||
| |--------|------|-------------| | ||
| | `upgradePlan(plan)` | `POST /billing/upgrade` | Get checkout URL to upgrade (works at 0 credits) | | ||
| | `topUp()` | `POST /billing/topup` | Buy 100 credits for $5 | | ||
| ## Filtering payouts by source | ||
| ```typescript | ||
| // All payouts | ||
| const all = await fc.payouts(); | ||
| // Stripe only | ||
| const stripe = await fc.payouts({ source: "stripe" }); | ||
| // Shopify only | ||
| const shopify = await fc.payouts({ source: "shopify" }); | ||
| ``` | ||
| ## Pagination | ||
@@ -106,2 +158,8 @@ | ||
| } | ||
| if (err.status === 402) { | ||
| console.log("Out of credits — upgrade or top up"); | ||
| // Programmatic upgrade: | ||
| const { data } = await fc.upgradePlan("starter"); | ||
| console.log(`Upgrade at: ${data.checkout_url}`); | ||
| } | ||
| console.log(err.body); // full error response | ||
@@ -111,4 +169,15 @@ } | ||
| ## Get an API key | ||
| Sign up at [developer.usepopup.com](https://developer.usepopup.com) to get your API key. 7-day free trial with 100 credits included. | ||
| ## Links | ||
| - [API Documentation](https://developer.usepopup.com/docs) | ||
| - [OpenAPI Spec](https://developer.usepopup.com/.well-known/openapi.json) | ||
| - [MCP Server](https://www.npmjs.com/package/@flowcheck/mcp-server) | ||
| - [llms.txt](https://developer.usepopup.com/llms.txt) | ||
| ## License | ||
| MIT |
33326
5.6%178
63.3%