May 12, 2026 · Developer Guide

How to Add E-Signatures to Your SaaS Product (Without Building a Template Engine)

Your users need to sign documents inside your product. You don't need DocuSign's template system, a PDF library, or a drag-and-drop editor. You need one API call. Here's the complete playbook for SaaS founders and developers.

Michael Beckett
Michael Beckett

Founder, Signbee

TL;DR

You already have all the data you need to generate documents — it's in your database. Pull it out, format it as markdown, send it to a signing API, get a signing URL, redirect your user. No template engine, no PDF library, no document editor. The entire integration is one API call + one webhook handler. Signbee handles PDF generation, email delivery, signature capture, and audit trails at $0.50/doc.

The template engine trap

I've talked to dozens of SaaS founders who spent 2-6 months building document signing features. The pattern is always the same:

Month 1-2Build a template editor with drag-and-drop fields
Month 3Integrate a PDF library (WeasyPrint, Puppeteer, wkhtmltopdf)
Month 4Build variable substitution and conditional logic
Month 5Implement signature capture and audit trails
Month 6Realize the feature is 40% of their codebase

This is the template engine trap. You set out to add a simple "sign this document" button, and you end up maintaining a document management system that has nothing to do with your core product.

The escape is straightforward: generate documents programmatically from data you already have, and let a signing API handle everything else.

The API-first approach

Your SaaS product already stores the data that goes into documents. A CRM has client names and deal values. An HR tool has employee details and salary figures. A property management app has tenant names and lease terms. You don't need a template editor — you need string interpolation.

Generate a contract from your database — then send for signature
// Your app already has this data
const deal = await db.deals.findUnique({
  where: { id: dealId },
  include: { client: true, company: true },
});

// Generate the contract as markdown
const markdown = `# Service Agreement

**Provider:** ${deal.company.name}
**Client:** ${deal.client.name}
**Value:** $${deal.value.toLocaleString()}/month
**Start Date:** ${deal.startDate.toLocaleDateString()}

## Scope of Work
${deal.scope}

## Payment Terms
Payment is due within 30 days of invoice date.
Late payments incur a 1.5% monthly fee.

## Term
This agreement runs for ${deal.termMonths} months
from the start date above.
`;

// Send for signature — one API call
const response = await fetch("https://signb.ee/api/v1/send", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": `Bearer ${process.env.SIGNBEE_API_KEY}`,
  },
  body: JSON.stringify({
    markdown,
    recipient_name: deal.client.name,
    recipient_email: deal.client.email,
    webhook_url: "https://yourapp.com/webhooks/signbee",
  }),
});

const { document_id, signing_url } = await response.json();

// Save the document reference and redirect
await db.deals.update({
  where: { id: dealId },
  data: { documentId: document_id, status: "awaiting_signature" },
});

// Option A: Redirect user to signing page
// Option B: Embed signing_url in an iframe
// Option C: Send via email (Signbee does this automatically)

No template engine. No PDF library. No drag-and-drop editor. The markdown is generated from your existing data models, and Signbee handles everything from PDF rendering to email delivery to signature capture and audit trail generation.

Three embedding strategies

Once you have a signing_url from the API, there are three ways to present it to your user:

StrategyBest for
Email (default)Async signing, external users
RedirectIn-flow signing, onboarding
Iframe embedSeamless UX, never leave your app

For most SaaS products, the redirect strategy is the sweet spot. The signer clicks "Sign Agreement" in your app, gets redirected to the signing page, signs, and gets redirected back. Signbee supports a redirect_url parameter that sends the signer back to your app after signing:

Redirect strategy — signer returns to your app after signing
const response = await fetch("https://signb.ee/api/v1/send", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": `Bearer ${process.env.SIGNBEE_API_KEY}`,
  },
  body: JSON.stringify({
    markdown: contractMarkdown,
    recipient_name: "Jane Smith",
    recipient_email: "jane@client.com",
    redirect_url: "https://yourapp.com/deals/123/signed",
    webhook_url: "https://yourapp.com/webhooks/signbee",
  }),
});

const { signing_url } = await response.json();
// Redirect the user: window.location.href = signing_url
// After signing, they land on /deals/123/signed in your app

White-label vs API-first: which approach?

SaaS builders often debate between white-label e-signature providers (where you rebrand their UI) and API-first providers (where you control the flow). Here's how they compare:

FactorWhite-labelAPI-first
Signing pageProvider's UI + your logoBuild your own or use provider's
Email brandingYour domain + colorsVaries by provider
Integration effortDays-weeks (config heavy)Hours (code light)
FlexibilityLimited to provider's optionsFull control over UX flow
Typical cost$200-$500/mo + per-docPer-doc only ($0.50)

Signbee bridges both approaches. The signing page is clean and minimal — it doesn't look like "Signbee" is signing your documents. But you also get full API control to build custom signing flows if you need them. No monthly fees, no user seats, just $0.50 per document. For a deeper comparison of providers, see our best e-signature APIs for developers guide.

Handling the webhook lifecycle

The signing URL is only half the integration. You also need to update your SaaS product when the document is signed, viewed, or declined. Here's the webhook handler pattern:

Webhook handler — update deal status on signature events
app.post("/webhooks/signbee", async (req, res) => {
  const { event, data } = req.body;

  switch (event) {
    case "document.signed":
      await db.deals.update({
        where: { documentId: data.document_id },
        data: {
          status: "signed",
          signedAt: new Date(data.timestamp),
          signedPdfUrl: data.signed_pdf_url,
        },
      });
      // Trigger onboarding, activate subscription, etc.
      await activateClientAccount(data.document_id);
      break;

    case "document.viewed":
      await db.deals.update({
        where: { documentId: data.document_id },
        data: { status: "viewed", viewedAt: new Date(data.timestamp) },
      });
      break;

    case "document.declined":
      await db.deals.update({
        where: { documentId: data.document_id },
        data: { status: "declined" },
      });
      // Notify the account owner
      await notifyDealOwner(data.document_id, "declined");
      break;
  }

  res.sendStatus(200);
});

This is where the real value lives for SaaS builders. The webhook lets you trigger downstream workflows — activating accounts, starting subscriptions, sending welcome emails, updating CRM stages — all automatically when a document is signed. For implementation details, see the webhooks guide.

Cost comparison for SaaS builders

E-signature pricing matters at scale. If your SaaS sends 500 documents per month, here's what you're looking at:

Provider500 docs/mo cost
DocuSign API~$1,250/mo
PandaDoc~$65/mo + per-doc
HelloSign API~$500/mo
Docuseal (self-hosted)$0 + server costs
Signbee$250/mo

For a detailed pricing breakdown across all providers and volume tiers, see the full pricing comparison.

What about self-hosted options?

Docuseal is a popular open-source option. You host it on your own infrastructure and avoid per-document fees. But the trade-off is real: you're running a Ruby on Rails app, managing a PostgreSQL database, handling backups, monitoring uptime, and maintaining security patches. For SaaS builders who want to focus on their core product, the operational overhead usually outweighs the cost savings.

The break-even point depends on your volume. Below 1,000 documents per month, a managed API like Signbee is cheaper when you factor in engineering time. Above 5,000 per month, self-hosting might make sense if you have a dedicated DevOps team. For most SaaS products in the 100-2,000 doc/month range, API-first is the clear winner.

Integration checklist for SaaS builders

1. Generate documents from your dataString interpolation, not templates
2. Send via API with webhook URLOne POST request
3. Store document_id in your databaseLink to your deal/user/contract
4. Handle webhook eventssigned, viewed, declined
5. Update UI status in real-timeShow signing progress to users
6. Add retry logic for rate limitsExponential backoff on 429s

Frequently Asked Questions

Do I need to build a template engine?

No. Your SaaS already stores the data that goes into documents (client names, deal values, dates). Generate document content programmatically as markdown, send it to Signbee's API, and the PDF is created automatically. No template editor, no drag-and-drop fields.

Can I embed signing inside my app?

Yes. Signbee returns a signing_url that you can open as a redirect (recommended) or embed in an iframe. Use the redirect_url parameter to send signers back to your app after they sign.

How does Signbee compare to DocuSign for SaaS integration?

DocuSign requires OAuth, envelope templates, and 80+ lines of SDK code. Signbee uses an API key and one endpoint — 15 lines of code. At 500 docs/month, DocuSign costs ~$1,250/mo vs Signbee's $250/mo. See our full comparison.

Should I self-host with Docuseal instead?

Only if you send 5,000+ docs/month and have a dedicated DevOps team. Below that, the operational overhead of running and maintaining a self-hosted signing platform exceeds the per-document savings. See our open-source comparison.

Add signing to your SaaS in 30 minutes — 5 free docs/month, $0.50 after.

Last updated: May 12, 2026 · Michael Beckett is the founder of Signbee and B2bee Ltd.

Related resources