Skip to main content
Webhooks allow you to receive real-time notifications when an asynchronous invoice generation job is completed or fails.

Setup

  1. Go to the Webhooks Dashboard.
  2. Register your endpoint URL (e.g., https://api.your-app.com/webhooks/FinePDF).
  3. Provide a secret key for HMAC signature verification.

Async Generation

To trigger a webhook, use the async=true query parameter when calling the generation endpoint:
POST /v1/invoices/generate?async=true
The API will return 202 Accepted immediately with a jobId.

Signature Verification

Every webhook request includes an X-FINE-Signature header. You should verify this signature to ensure the request came from FinePDF. The signature is a HMAC-SHA256 hash of the raw request body using your webhook secret.
const crypto = require('crypto');

function verify(payload, secret, signature) {
  const expected = crypto
    .createHmac('sha256', secret)
    .update(payload)
    .digest('hex');
  return expected === signature;
}

Retry Policy

If your server returns a non-2xx status code, we will retry the webhook with exponential backoff (up to 5 times).