Skip to main content
Use the Stripe sync endpoints to discover invoices from Stripe, sync them into Exante, and monitor progress.

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

FieldTypeRequiredDescription
organization_uidstringNoOrganization to discover for. Falls back to the current user’s default organization.
statusesstring[]NoStripe invoice statuses to include. Valid values: draft, open, paid, uncollectible, void. Defaults to ["open", "paid", "uncollectible", "void"].
from_datestringNoStart of the creation date window (inclusive, YYYY-MM-DD). Defaults to today.
to_datestringNoEnd of the creation date window (inclusive, YYYY-MM-DD). Defaults to today.
include_draftbooleanNoIf true, adds draft to the statuses list. Defaults to false.

Example

{
  "organization_uid": "00000000-0000-0000-0000-000000000000",
  "statuses": ["open", "paid"],
  "from_date": "2026-01-01",
  "to_date": "2026-04-06"
}

Response

{
  "message": "Stripe invoice discovery queued successfully",
  "data": {
    "job_id": "rq-job-uuid",
    "organization_uid": "00000000-0000-0000-0000-000000000000",
    "statuses": ["open", "paid"],
    "from_date": "2026-01-01",
    "to_date": "2026-04-06"
  }
}

Behavior

  • Returns early with skipped: true and reason: discover_in_progress if 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

FieldTypeRequiredDescription
organization_uidstringNoOrganization to sync. Falls back to the current user’s default organization.
batch_sizeintegerNoMaximum number of catalog entries to process. Defaults to 50.
delay_between_itemsnumberNoSeconds to wait between processing each invoice, for Stripe API rate limiting. Defaults to 0.2.

Example

{
  "organization_uid": "00000000-0000-0000-0000-000000000000",
  "batch_size": 100,
  "delay_between_items": 0.5
}

Response

{
  "message": "Stripe invoice sync queued successfully",
  "data": {
    "job_id": "rq-job-uuid",
    "organization_uid": "00000000-0000-0000-0000-000000000000"
  }
}

Behavior

  • Returns early with skipped: true and reason: sync_in_progress if a sync is already running for the organization.
  • Processes catalog entries with pending processing 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

FieldTypeRequiredDescription
organization_uidstringNoOrganization to inspect. Falls back to the current user’s default organization.

Response

{
  "message": "Stripe sync status retrieved successfully",
  "data": {
    "organization_uid": "00000000-0000-0000-0000-000000000000",
    "discover_state": {
      "status": "completed",
      "last_started_at": "2026-04-06T11:00:00+00:00",
      "last_completed_at": "2026-04-06T11:02:00+00:00",
      "total_synced": 58,
      "total_skipped": 0,
      "error_message": null
    },
    "sync_state": {
      "status": "completed",
      "last_started_at": "2026-04-06T12:00:00+00:00",
      "last_completed_at": "2026-04-06T12:05:00+00:00",
      "total_synced": 42,
      "total_skipped": 3,
      "error_message": null
    },
    "catalog_summary": {
      "pending": 10,
      "queued": 0,
      "processing": 0,
      "synced": 42,
      "error": 3,
      "skipped": 1
    },
    "locks": {
      "discover": false,
      "sync": false
    }
  }
}

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.