sync:stripe
Overview
Syncs payment transactions, refunds, fees, and payouts from the Stripe API to the local PostgreSQL database. Defaults to a 7-day lookback window but accepts custom date ranges.
Usage
npm run sync:stripe [startDate] [endDate]
Arguments
| Argument | Description | Default |
|---|---|---|
startDate | Start date (YYYY-MM-DD) | 7 days ago |
endDate | End date (YYYY-MM-DD) | Today |
Prerequisites
- Repo: symphonycore-org/sc-finance-sync
- Install:
npm installfrom repo root - Environment:
STRIPE_API_KEY,DATABASE_URL
Examples
Default 7-day sync
npm run sync:stripe
Sync a specific date range
npm run sync:stripe 2026-01-01 2026-01-31
Production (via Docker)
docker exec sc-finance-sync npm run sync:stripe
Output
Prints transaction count (processed, created, updated) and any errors. Exit code 0 on success, 1 on failure.