Payment Events (pyrx.payment)
Deprecated. pyrx.payment is the legacy billing provider. New workspaces use Lemon Squeezy for billing. The pyrx.payment webhook endpoint remains active for existing integrations but will be removed in a future release. Migrate to Lemon Squeezy billing events when possible.
Synapse receives subscription lifecycle events from pyrx.payment via webhooks. These events update your workspace's plan, limits, and status.
Webhook Endpoint
This endpoint is secured by a shared secret in the X-Webhook-Secret header -- see Signature Verification. The secret supports comma-separated rotation (both old and new secrets accepted simultaneously).
Events
| Event | Description | Synapse Action |
|---|---|---|
subscription.activated | New subscription created or trial converted | Update plan, set new limits, set status to active |
subscription.active | Subscription confirmed active | Same as subscription.activated |
subscription.renewed | Recurring payment succeeded | Reset monthly_emails_sent and monthly_events_used to 0, update plan |
payment.failed | Payment attempt failed | Logged as warning, workspace remains active |
subscription.past_due | Subscription past due | Logged as warning, workspace remains active |
subscription.cancelled | Subscription ended | Downgrade to free plan with free-tier limits, clear payment_subscription_id |
subscription.paused | Subscription paused by admin | Suspend workspace (status = suspended, suspended_reason set) |
Payload Schema
All payment webhook events share a common envelope:
Common Fields
| Field | Type | Description |
|---|---|---|
event_type | string | The event identifier |
timestamp | string | ISO 8601 timestamp of when the event occurred |
data.subscription_id | string | pyrx.payment subscription ID |
data.customer_id | string | pyrx.payment customer ID (maps to tenants.payment_customer_id) |
data.plan_id | string | Plan identifier (e.g., synapse_growth) |
data.amount | integer | Amount in cents |
data.currency | string | Three-letter currency code |
data.status | string | Subscription status |
Event Details
subscription.activated
Fired when a workspace owner completes checkout and payment succeeds.
Synapse action:
tenants.planupdated to the plan ID (withpyrxcrm_prefix stripped)tenants.monthly_email_limitsynced from theplanstabletenants.contacts_limitsynced from theplanstabletenants.statusset toactive
subscription.renewed
Fired on successful recurring payment.
Synapse action:
tenants.monthly_emails_sentreset to0tenants.monthly_events_usedreset to0
payment.failed / subscription.past_due
Fired when a payment attempt fails or the subscription enters a past-due state.
Synapse action:
- Logged as a warning
- Workspace remains
active-- no immediate impact on access - pyrx.payment handles retry/dunning automatically
subscription.cancelled
Fired when a subscription is cancelled (after grace period expires or voluntary cancellation).
Synapse action:
tenants.plandowngraded tofree- Limits synced from the free plan in the
planstable tenants.payment_subscription_idcleared- Existing data is preserved but new operations are limited
subscription.paused
Fired when a subscription is administratively paused.
Synapse action:
- Workspace set to read-only mode
- No new emails can be sent
- Dashboard remains accessible for data viewing
Payment events are processed asynchronously. There may be a delay of a few seconds between payment completion and plan update. The dashboard polls for plan changes after checkout to ensure the user sees the updated plan promptly.
Idempotency
Synapse handles duplicate webhook deliveries gracefully. The same event processed twice will not cause double updates (e.g., resetting monthly_emails_sent twice).
Retry Behavior
The webhook handler always returns 200 OK, even if internal processing fails. This prevents pyrx.payment from retrying indefinitely. Internal failures are logged and alerted via Sentry.