POST /api/integrations/stripe/sync/discover
Discovers Stripe invoices matching the given filters and catalogs them in StripeInvoiceCatalog. This does not create Exante records — it only populates the catalog for later sync.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
organization_uid | string | No | Organization to discover for. Falls back to the current user’s default organization. |
statuses | string[] | No | Stripe invoice statuses to include. Valid values: draft, open, paid, uncollectible, void. Defaults to ["open", "paid", "uncollectible", "void"]. |
from_date | string | No | Start of the creation date window (inclusive, YYYY-MM-DD). Defaults to today. |
to_date | string | No | End of the creation date window (inclusive, YYYY-MM-DD). Defaults to today. |
include_draft | boolean | No | If true, adds draft to the statuses list. Defaults to false. |
Example
Response
Behavior
- Returns early with
skipped: trueandreason: discover_in_progressif discovery is already running for the organization. - Discovery runs as a background task. Use the status endpoint to track progress.
- Each discovered invoice is upserted into the catalog. Running discovery again with the same filters refreshes existing catalog entries.
POST /api/integrations/stripe/sync
Processes pending catalog entries and syncs them into Exante invoices.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
organization_uid | string | No | Organization to sync. Falls back to the current user’s default organization. |
batch_size | integer | No | Maximum number of catalog entries to process. Defaults to 50. |
delay_between_items | number | No | Seconds to wait between processing each invoice, for Stripe API rate limiting. Defaults to 0.2. |
Example
Response
Behavior
- Returns early with
skipped: trueandreason: sync_in_progressif a sync is already running for the organization. - Processes catalog entries with
pendingprocessing status. Entries that error are skipped and can be retried later. - Sync runs as a background task. Use the status endpoint to track progress.
GET /api/integrations/stripe/sync/status
Returns the current sync state, catalog summary, and active lock indicators.
Query params
| Field | Type | Required | Description |
|---|---|---|---|
organization_uid | string | No | Organization to inspect. Falls back to the current user’s default organization. |
Response
Fields
discover_state— the last discovery run’s status, timestamps, and counters. Tracked independently from sync.sync_state— the last sync run’s status, timestamps, and counters. Tracked independently from discovery.catalog_summary— counts of catalog entries grouped by processing status, giving a real-time view of the pipeline.locks— whether a discovery or sync background task is currently running.