Skip to content

Webhooks

Receive and verify signed events for grants, sync, account resources, orders, and reauthorization.

Finatic posts JSON events to an HTTPS endpoint you control. Deliveries are scoped to the company account and account grant that own the subscription.

Configure subscriptions

Create and manage endpoints in Settings → Webhooks after you sign in. Configure an HTTPS URL, a live or sandbox environment, subscribed event types, and a signing secret.

The public event catalog is available at GET /api/v1/webhooks/catalog. Subscription management stays in the authenticated dashboard.

Event catalog

The canonical catalog groups events for account grants, account synchronization, account resources, orders, and connection reauthorization. Use the catalog response rather than hard-coding the available set.

Common events include:

  • account.grant.created, account.grant.updated, and account.grant.revoked
  • account.sync.started, account.sync.succeeded, and account.sync.failed
  • account.balance.updated, account.position.updated, and account.transaction.created
  • order.created, order.updated, order.filled, order.cancelled, and order.rejected
  • connection.reauth.required

Order lifecycle

Every new order emits order.created first, followed by its state event. An order that Finatic first sees already filled, rejected, cancelled, or expired (for example a fast fill discovered on the first sync) produces two events for the same order:

  1. order.created, then
  2. order.filled, order.rejected, or order.cancelled.

The two events have different eventId values, and the order.created event carries the earlier resourceMetadata.updatedAt and resourceMetadata.eventTime, so consumers that order by those fields apply created first. Both events describe the same order row, so the order object in order.created can already show the final status. Orders first seen in a working state emit order.created only, and later status changes emit order.updated or the matching state event. Retries and replays reuse the original eventId, so a replayed order never produces a second order.created.

Request shape

1{ 2 "schemaVersion": "v1", 3 "eventId": "evt_01HX...", 4 "eventType": "order.filled", 5 "createdAt": "2026-06-08T20:15:00Z", 6 "environment": "live", 7 "companyAccountId": "acct_company_123", 8 "accountId": "acct_financial_456", 9 "grantId": "grant_789", 10 "resource": { 11 "resourceType": "order", 12 "resourceId": "order_abc", 13 "accountId": "acct_financial_456", 14 "grantId": "grant_789" 15 }, 16 "data": { 17 "status": "FILLED", 18 "symbol": "AAPL" 19 } 20} 21

Route and authorize with companyAccountId, accountId, and grantId. Provider connection IDs are internal and must never become public tenancy keys.

Order side

side on orders, order legs, and fills is BUY, SELL, or UNKNOWN. UNKNOWN means the broker reported an order whose side Finatic could not prove (for example a broker action Finatic does not map yet). It is never a guessed BUY or SELL. Do not act on an UNKNOWN side as if it were a trade direction; treat it as "direction not known" and, for copy-trading or other order-mirroring workflows, skip or hold the event until a later event or read carries a proven side.

Headers

1Content-Type: application/json 2User-Agent: Finatic-Webhooks/3.0 3Finatic-Event-Id: <eventId> 4Finatic-Timestamp: <createdAt> 5X-Finatic-Event: <eventType> 6X-Finatic-Event-Id: <eventId> 7X-Finatic-Timestamp: <createdAt> 8X-Finatic-Delivery: live|test 9

When available, deliveries also include delivery and trace IDs. When a subscription secret is configured, both signature headers contain the same value:

1Finatic-Signature: sha256=<hex> 2X-Finatic-Signature: sha256=<hex> 3

Verify signatures

The signature is HMAC-SHA256 over the exact UTF-8 bytes Finatic posted. Read and verify the raw body before parsing or reserializing it. Reject an absent, malformed, or mismatched signature.

1import { createHmac, timingSafeEqual } from 'node:crypto'; 2 3export async function POST(request: Request) { 4 const rawBody = await request.text(); 5 const signature = request.headers.get('x-finatic-signature') ?? ''; 6 const expected = 'sha256=' + createHmac( 7 'sha256', 8 process.env.FINATIC_WEBHOOK_SECRET!, 9 ) 10 .update(rawBody, 'utf8') 11 .digest('hex'); 12 13 const valid = 14 signature.length === expected.length && 15 timingSafeEqual(Buffer.from(signature), Buffer.from(expected)); 16 17 if (!valid) return new Response('invalid signature', { status: 401 }); 18 19 // Enqueue the verified event and return quickly. 20 return new Response('ok', { status: 200 }); 21}

Retries and idempotency

Finatic treats any HTTP 2xx response as success. On timeouts, transport errors, or non-2xx responses, it retries with exponential backoff and jitter up to the configured attempt limit.

  • Store eventId as an idempotency key before applying side effects.
  • Acknowledge verified events quickly and process expensive work asynchronously.
  • Preserve ordering state per resource when order-sensitive workflows require it (see Ordering events). Treat order.created as the start of an order's history, and do not reject a state event that arrives with an eventTime equal to its order.created.
  • Keep live and test delivery processing isolated.

Ordering events

Finatic emits order and fill events as soon as the broker reports them, and broker polls reconcile afterwards, so deliveries for one resource can arrive out of order and an event can restate state you already hold. Treat eventId only as an idempotency key; it does not carry order.

Order-sensitive consumers should order by the freshness fields in data.resourceMetadata:

  • sequence: a per-resource source sequence, present only when Finatic proved one for that broker. When present, apply an event only if its sequence is higher than the last one you applied for the same resourceId.
  • updatedAt and eventTime: use these when sequence is absent. Ignore an event older than the state you already applied.
  • version: when present, the same rule as sequence.

Every new order emits order.created first, even when it was first seen already filled, rejected, or cancelled (see Order lifecycle). Both events come from the same row, and order.created carries the earlier eventTime and updatedAt, so ordering by these fields applies it first. When the two timestamps are equal, apply order.created before the state event and treat the state event as newer, not stale.

An event whose fields are all equal to what you already applied is a safe no-op. Fields can be absent when a broker does not provide them; never treat an absent field as zero.

Testing

  • Use sandbox subscriptions while integrating.
  • Use dashboard test sends to validate endpoint routing and signature handling.
  • Verify the raw-body path; a parsed-and-reserialized body must fail signature verification.
  • Confirm tenant routing with companyAccountId, accountId, and grantId.
  • Confirm duplicate delivery of the same eventId does not repeat side effects.

Next steps