Operations

Start Stripe customer and invoice syncs through the Execution API, scoped to your connected account and a date range.

Summary

The Execution API runs named business operations, such as a Stripe invoice sync, against your own workspace. GET /operations lists what you can run and the inputs each operation accepts. POST /operations/{operationId}/runs queues a run and returns a run id to poll.

Every input an operation accepts is either applied to the work or refused with an error. The API never accepts a value and then ignores it.

Capabilities

  • List the catalog with each operation's input schema.
  • Sync customers from your connected Stripe account, incrementally or from the full history.
  • Sync invoices from your connected Stripe account, optionally limited to a range of creation dates.
  • Confirm that a sync targets the account you expect by naming it in stripeAccountId.
  • Retry a trigger safely with an Idempotency-Key.

Prerequisites

  • A credential with operations.write to start runs, operations.read to list operations and runs.read to read runs. See Authentication.
  • A connected Stripe account in Marketplace for the Stripe sync operations.
  • An Idempotency-Key header on every POST /operations/{operationId}/runs request.

Concepts

The workspace comes from the credential

Inputs never name a workspace. A body that includes teamId, or any field the operation does not declare, is rejected with 400.

One Stripe account per workspace

Each workspace connects one Stripe account for sync. stripeAccountId does not select a different account. It confirms the connected one: if the value is not the account connected to your workspace, or Stripe is not connected, the request is rejected with 422 and nothing is queued. The sync also stops with a permanent error if the workspace's connected account changes between the request and the run.

Date ranges are UTC calendar days

startDate and endDate are calendar dates (YYYY-MM-DD) in UTC and match on when Stripe created the invoice.

InputWhat the run reads
NeitherThe regular incremental sync: invoices created since the last successful sync.
startDate onlyInvoices created from 00:00:00 UTC on startDate onward, then the regular catch-up.
endDate onlyEvery invoice created up to 23:59:59.999 UTC on endDate.
BothOnly invoices created from 00:00:00 UTC on startDate through 23:59:59.999 UTC on endDate.

A run with an endDate is a bounded backfill. It reads only that window and leaves the regular nightly sync's progress alone, so it does not make the data count as up to date in Marketplace activity.

Workflow

  1. List operations and read the input schema:

    curl --request GET \
      --url https://api.eigenn.io/v1/operations \
      --header "Authorization: Bearer $EIGENN_API_TOKEN"
  2. Queue a bounded invoice sync for January 2026:

    curl --request POST \
      --url https://api.eigenn.io/v1/operations/integration.sync.invoices/runs \
      --header "Authorization: Bearer $EIGENN_API_TOKEN" \
      --header "Content-Type: application/json" \
      --header "Idempotency-Key: invoices-2026-01" \
      --data '{"input": {"stripeAccountId": "acct_123", "startDate": "2026-01-01", "endDate": "2026-01-31"}}'
  3. Keep the returned runId and read it with GET /runs/{runId}. A run starts as queued, becomes running when the worker picks it up, and ends as succeeded or failed. A run is marked failed only after the worker's retries are used up, so a run that is still running may yet recover. A succeeded run's result holds processed, the number of records synced, and a skipped reason when the sync had nothing to do, such as a disabled entity. A failed run's error holds a fixed code and message, not the provider's error text.

  4. To repeat the same request safely, send the same Idempotency-Key and body. The original run is returned with 202.

Behavior specification

Operation inputs

OperationInputRule
integration.sync.customersstripeAccountIdOptional. Must be the connected account, otherwise 422.
integration.sync.customersfullSyncOptional boolean. true re-reads all customer history.
integration.sync.invoicesstripeAccountIdOptional. Must be the connected account, otherwise 422.
integration.sync.invoicesstartDateOptional calendar date. Must not be after endDate or in the future, otherwise 400.
integration.sync.invoicesendDateOptional calendar date. Makes the run a bounded backfill.

Status codes

StatusWhen
202The run was queued, or the same idempotency key and body were already accepted.
400The input is invalid: unknown field, teamId, malformed date, start after end, or start in the future.
403The credential lacks the operation's scope.
404No operation has that id.
409The idempotency key was already used with a different body.
422The input names one of your records that does not match your workspace, such as a stripeAccountId that is not your connected account.

Diagrams

"Starting a scoped Stripe sync"

Rendering diagram…

Screenshots

Not applicable: this page describes an API rather than an application screen.

Verification

  1. Call GET /operations and confirm both sync operations list stripeAccountId; the invoice sync also lists startDate and endDate.
  2. Queue an invoice sync with your connected account and a one-month window. Expect 202 and a runId.
  3. Repeat the request with the same Idempotency-Key. Expect 202 with the same runId.
  4. Send a stripeAccountId that is not your connected account. Expect 422 and no new run in GET /runs.
  5. Send a startDate in the future, or after endDate. Expect 400.
  6. After the sync has had time to run, confirm that only invoices created inside the window were added.