Marlin uses webhooks to push event notifications to your server. When something meaningful happens — an invoice is paid, a subscription is canceled, a payment is confirmed — Marlin sends an HTTP POST request to the URL you register in the dashboard. Your handler receives the event, verifies its authenticity, and acts on it.Documentation Index
Fetch the complete documentation index at: https://yanhgming.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Webhook payload structure
Every webhook request body is a JSON-serializedWebhookEvent object.
data field contains the full resource object relevant to the event — an Invoice, Subscription, Customer, or payment record. See Webhook event types for the shape of each data payload.
The marlin-signature header
Marlin signs every webhook request with HMAC-SHA256. The signature is sent in the marlin-signature request header using the format:
t— Unix timestamp (seconds) of when the event was sentv1— HMAC-SHA256 hex digest of<timestamp>.<raw_body>using your webhook secret
Set up a webhook endpoint
Add your endpoint URL in Settings
In the Marlin dashboard, go to Settings → Webhooks and enter the public HTTPS URL of your handler.
Copy your webhook secret
After saving the URL, copy the webhook signing secret displayed on the page. It starts with
whsec_. Store it as an environment variable — you will not be able to view it again.Deploy a handler that verifies the signature
Your endpoint must read the raw request body (not parsed JSON) and validate the
marlin-signature header before processing the event. Use the verifyWebhook helper from @marlin/sdk or implement HMAC verification manually. See Verify webhook signatures.Marlin retries failed deliveries with exponential backoff. You can inspect the delivery history and retry status for any event under Settings → Webhooks → Deliveries in the dashboard.