Skip to main content

Documentation

Webhooks

Inbound store notifications and outbound webhook delivery.

Webhooks

Stackhouse-Billing both receives webhooks from the stores and sends its own outbound webhooks to your backend when subscription state changes.

Inbound store webhooks

MethodEndpointNotes
POST/v1/billing/webhooks/appleApp Store Server Notifications V2 signedPayload
POST/v1/billing/webhooks/googleGoogle Cloud Pub/Sub push envelope
POST/v1/billing/webhooks/stripe?app_id=…Stripe signed webhook (Stripe-Signature header)

Outbound webhook signature

Each delivery carries:

  • X-StackhouseBilling-Signature: t=<unix>,v1=<hex hmac-sha256>
  • X-StackhouseBilling-Event: <EVENT_TYPE>

Signature is computed over <unix>.<raw-body> using the endpoint secret.

Event types

Subscription lifecycle events include INITIAL_PURCHASE, RENEWAL, CANCELLATION, UNCANCELLATION, PRODUCT_CHANGE, BILLING_ISSUE, EXPIRATION, and TEST.

Experiment lifecycle events include EXPERIMENT_IMPRESSION and EXPERIMENT_CONVERSION, fired when the customer resolution or tracking endpoints are called. Experiment events are also stored independently in billing_experiment_events regardless of whether an outbound webhook endpoint is configured.

End-to-end delivery flow

Rendering diagram…

Retry backoff

Failed deliveries are retried up to 5 times with exponential backoff:

Rendering diagram…