Webhooks
Set a webhook URL and choose events on your listing. When a customer connects your app, AffilStack sends you those events for their account — only the ones their permissions cover.
Events
generation.completed— needscontent:readcrm_contact.created— needscrm:readreferral.converted— needsreferrals:readearning.recorded— needsearnings:read
Delivery
Each event is a JSON POST:
{
"event": "crm_contact.created",
"data": {
"id": 123,
"email": "buyer@example.com"
}
}
Headers include X-AffilStack-Event and X-AffilStack-Signature, an HMAC-SHA256 of the raw body using your app's webhook signing secret (on your add-on's page). Always check it:
$expected = hash_hmac('sha256', $rawBody, $webhookSecret);
if (! hash_equals($expected, $_SERVER['HTTP_X_AFFILSTACK_SIGNATURE'] ?? '')) {
http_response_code(401);
exit;
}
Reply with any 2xx within a few seconds. Failed deliveries are retried up to 5 times over several hours.
Your webhook URL must be a public https:// address.