Skip to main content

Webhooks Developer Preview

[!NOTE] Outbound Webhooks are currently in Developer Preview. The schemas and endpoints described below are subject to change as we finalize the implementation.
Outbound Webhooks allow you to receive real-time event data from SpendNexus in your own custom applications or internal dashboards.

Event Types

When implemented, SpendNexus will support the following event types:
  • subscription.created: Triggered when a new tool is added.
  • subscription.renewing: Triggered based on your alert rules (e.g., 7 days before renewal).
  • subscription.cost_changed: Triggered when a cost change is detected.
  • alert.triggered: A generic event for any alert rule firing.

Payload Schema (Draft)

Webhooks are sent via POST requests with a JSON body.
{
  "event": "subscription.renewing",
  "organization_id": 123,
  "timestamp": "2024-03-20T10:00:00Z",
  "data": {
    "subscription_id": 456,
    "name": "Postmark",
    "amount_cents": 1500,
    "currency": "USD",
    "renewal_date": "2024-03-27",
    "owner": {
      "name": "Jane Doe",
      "email": "[email protected]"
    }
  }
}

Security & Verification

Each webhook request will include a X-SpendNexus-Signature header. You should use this signature to verify that the request originated from SpendNexus.
  1. Retrieve the Webhook Secret from your developer settings.
  2. Concatenate the request timestamp and the JSON payload.
  3. Compute an HMAC-SHA256 hash using your secret.
  4. Compare the result with the signature header.

Setup (Coming Soon)

Webhook configuration will be available under Settings > Developers for organizations on the Scale plan.