Webhooks
Get real-time notifications when important events happen in the Seamless OS platform. Webhooks eliminate the need to poll the API,your endpoint receives an HTTPS POST immediately after subscriptions are created, payments complete, or usage thresholds are exceeded.Quick start
Webhooks deliver complete resource snapshots using a simple, consistent format. Each event includes everything you need to update your systems or trigger business logic.Basic integration
- Set up your endpoint to receive HTTPS POST requests
- Parse the JSON payload and extract the
eventId
for deduplication - Return HTTP 200 to acknowledge receipt
- Process events asynchronously to avoid blocking webhook delivery
Essential pattern
Event structure
All webhook payloads use the same envelope format with complete resource snapshots:Envelope fields
Field | Description |
---|---|
eventId | Unique identifier for this logical event (stable across delivery retries) |
type | Dot-namespaced event identifier (domain.action) |
occurredAt | When the underlying business event happened |
data | Complete snapshot of the affected resource at that moment |
Connect API integration
Webhook payloads contain the same resource data available through the Connect API endpoints. Thedata
object matches the schema you’d receive from GET requests, enabling seamless integration between real-time events and API calls.
Example correlations:
subscription.created
→ GET/subscriptions/{subscriptionId}
paymentLink.expired
→ GET/payment-links/{paymentLinkId}
order.submitted
→ GET/orders/{orderId}
Delivery guarantees
Reliability: At-least-once delivery with exponential backoff retries over approximately 24 hours for failed deliveries. Idempotency: Use theeventId
field as your deduplication key. The same eventId
will be sent for all retry attempts of the same logical event.
Ordering: Events are not guaranteed to arrive in strict chronological order across different resource types. Within a single resource, events generally follow causal order, but your integration should handle events idempotently.
Payload format: Typically includes the complete resource snapshot where applicable.
Implementation guide
Recommended processing flow
- Parse and validate the JSON payload structure
- Check for duplicates using
eventId
before any processing - Acknowledge immediately with HTTP 200 status
- Queue for async processing to handle business logic outside the webhook handler
- Perform side effects out-of-band (database updates, notifications, etc.)
Idempotency best practices
- Use
eventId
as your deduplication key - it’s stable across retries - Check before processing - always verify if the event was already handled
- Mark as processed only after success - prevents dropped events on failures
- Set TTL on locks - prevents stuck locks from crashes or timeouts
- Clean up on failure - remove locks to allow retries after errors
Error handling
We only inspect the HTTP status code—the response body is ignored. Return HTTP 2xx status codes only after successfully queuing or processing the event. Non-2xx responses trigger automatic retries with exponential backoff. Best practices:- Return 200 for successfully processed events (including duplicates)
- Return 4xx for malformed payloads (stops retries)
- Return 5xx for temporary failures (triggers retries)
- Response body content is not read or processed
Troubleshooting
Missing events: Verify your endpoint returns HTTP 200 and processes requests quickly (under 10 seconds). Duplicate processing: Always checkeventId
before performing non-idempotent operations.
Event ordering: Design your integration to handle events in any order, don’t rely on strict chronological delivery.
Large payloads: Events include complete resource snapshots, which may be substantial for complex orders or subscriptions.