Back to Articles
DevTools & MoR Billing
•14 min read•Polar.sh, Lemon Squeezy & TypeScript

Polar.sh & Lemon Squeezy + Signbee: Automate B2B Contracts for DevTools (2026)

Merchant of Record (MoR) platforms like Polar.sh and Lemon Squeezy eliminate global VAT, GST, and sales tax headaches for developer tools and AI startups. But when an enterprise team buys your $4,800/year Pro or Enterprise tier, MoR checkout receipts do not satisfy GDPR Data Processing Agreements (DPAs), uptime SLAs, or IP licensing rules. Here is how to bridge MoR webhooks and Signbee in under 30 lines of TypeScript.

Quick Answer (TL;DR)

Merchant of Record B2B Legal Automation • DevTool Architecture Guide

While Polar.sh and Lemon Squeezy act as your Merchant of Record (MoR) for tax remittance and payment processing, they do not execute bilateral B2B Data Processing Agreements (DPAs), Service Level Agreements (SLAs), or Enterprise Commercial Licenses on behalf of your engineering organization. To automate B2B contracts without slowing down self-serve checkout, listen for order.created or subscription.created webhooks, filter for your Team or Enterprise product IDs, interpolate the buyer's organization details into CommonMark markdown, and dispatch via POST https://signb.ee/api/v1/send.

Standard Webhooks & HMAC verified
Instant GDPR DPA & SLA dispatch
Zero DocuSign per-envelope tax

1. The Merchant of Record Illusion: Why Tax Compliance Is Not Legal Contract Compliance

If you are launching an open-source commercial tool, an MCP server platform, a specialized AI code SDK, or a B2B SaaS micro-product in 2026, using a Merchant of Record (MoR) like Polar.sh, Lemon Squeezy, or Paddle is one of the highest-leverage architectural decisions you can make. Instead of registering for VAT in 27 European Union member states, tracking economic nexus thresholds across 45 US states, and filing quarterly GST returns in Australia and Japan, the MoR steps in as the statutory reseller on the credit card statement.

However, as soon as your developer tool moves upmarket—selling $299/month Team plans or $5,000/year Enterprise self-hosted licenses to VP of Engineering and CISO buyers—founders discover a critical structural boundary: the Merchant of Record only handles the financial transaction, not the bilateral operational covenants.

Specifically, three legal instruments can never be covered by a generic Merchant of Record buyer checkout policy:

  • GDPR Article 28 Data Processing Agreements (DPAs): When an enterprise customer sends production logs, customer PII, or proprietary source code to your API, your company (not Polar.sh or Lemon Squeezy) is the Data Processor. Enterprise privacy officers require a counter-signed DPA listing your specific cloud subprocessors (e.g., AWS, Cloudflare, Neon, Anthropic) and Standard Contractual Clauses (SCCs).
  • Service Level Agreements (SLAs) & Support Response Guarantees: Polar.sh does not guarantee that your API cluster will maintain 99.95% uptime or that your engineering team will respond to P1 severity tickets within 2 hours. Those commitments must be executed directly between your corporate entity and the customer.
  • Self-Hosted & Commercial Source-Available Licenses: Many DevTool companies on Polar.sh distribute private Docker images, commercial CLI binaries, or source-available enterprise extensions that require explicit seat counts, non-redistribution clauses, and audit rights signed by an authorized corporate officer.

Handling these agreements manually via email attachments destroys the magic of self-serve MoR checkout. By evaluating the best e-signature APIs for developers in 2026, DevTool founders can wire Polar.sh and Lemon Squeezy webhooks directly into Signbee's markdown-to-PDF engine—preserving instant self-serve checkout while automating enterprise-grade legal compliance.

2. Legal & Operational Division of Responsibility: MoR vs. Signbee

Understanding how your Merchant of Record and your Signbee e-signature layer complement each other ensures your contracts never conflict with MoR tax reseller rules. The table below maps each commercial responsibility across the stack:

Commercial / Legal FunctionMerchant of Record (Polar.sh / Lemon Squeezy)Signbee Automated E-Signature Layer
Global VAT / GST / Sales TaxCalculated, collected & remitted globally by MoRReferences MoR tax invoice ID in Order Schedule
GDPR Data Processing Agreement (DPA)Only covers checkout payment data, not app telemetryBinds Supplier & Customer with custom subprocessor list
Uptime SLA & Support CreditsExplicitly disclaimed in MoR buyer termsExecutes 99.9%+ SLA & response time schedule
IP Indemnification & Liability CapProtects the MoR entity onlyEstablishes bilateral 12-month fee liability cap
Audit Artifact for Enterprise CISOTax Receipt / Invoice PDFDual-Signed PDF + SHA-256 Certificate

3. Blueprint A: Wiring Polar.sh Webhooks (order.created) to Signbee

Polar.sh has rapidly become the preferred Merchant of Record for open-source maintainers, AI SDK creators, and modern developer tools. Polar implements the industry-standard Standard Webhooks specification (webhook-id, webhook-timestamp, and webhook-signature) and provides first-class custom checkout fields so you can ask enterprise buyers for their Legal Company Name and DPA Contact Email right on the Polar checkout page.

Here is the complete Next.js App Router webhook handler that validates incoming Polar.sh subscription.created or order.created events and immediately dispatches a combined Commercial Enterprise License + GDPR DPA via Signbee:

src/app/api/webhooks/polar/route.tsPolar.sh + Signbee TypeScript
import { NextResponse } from "next/server";
import { validateEvent, WebhookVerificationError } from "@polar-sh/sdk/webhooks";

export async function POST(req: Request) {
  const rawBody = await req.text();
  const headers = Object.fromEntries(req.headers.entries());

  let event;
  try {
    event = validateEvent(rawBody, headers, process.env.POLAR_WEBHOOK_SECRET!);
  } catch (err) {
    if (err instanceof WebhookVerificationError) {
      return NextResponse.json({ error: "Invalid Polar webhook signature" }, { status: 403 });
    }
    throw err;
  }

  // Trigger B2B Enterprise License + DPA when an order or subscription is created
  if (event.type === "order.created" || event.type === "subscription.created") {
    const payload = event.data;
    const productName = payload.product?.name || "Enterprise DevTool Plan";

    // Optional: Only trigger formal e-signature contracts on Team / Enterprise tiers
    const isEnterpriseTier =
      productName.toLowerCase().includes("enterprise") ||
      productName.toLowerCase().includes("team") ||
      (payload.amount && payload.amount >= 9900); // $99+ plans

    if (!isEnterpriseTier) {
      return NextResponse.json({ skipped: "Self-serve indie tier" });
    }

    const customerEmail = payload.customer?.email || payload.user?.email;
    const customerName =
      payload.customer?.name ||
      payload.customFieldData?.legal_entity_name ||
      customerEmail;
    const legalEntity =
      (payload.customFieldData?.legal_entity_name as string) ||
      payload.customer?.billingAddress?.organization ||
      customerName;

    const amountFormatted = ((payload.amount || 0) / 100).toFixed(2);
    const currency = (payload.currency || "usd").toUpperCase();
    const effectiveDate = new Date().toISOString().split("T")[0];

    const markdownAgreement = `# Enterprise Commercial License, SLA & Data Processing Agreement

**Effective Date:** ${effectiveDate}  
**Software Licensor:** HyperScale DevTools Ltd. ("Licensor" & "Data Processor")  
**Customer Legal Entity:** ${legalEntity} ("Customer" & "Data Controller")  
**Merchant of Record Reference:** Polar.sh Order #${payload.id} (${currency} ${amountFormatted})

---

## 1. Relationship with Merchant of Record (Polar.sh)

Customer has purchased a commercial subscription to **${productName}** through Licensor's authorized Merchant of Record, **Polar Software Inc. ("Polar.sh")**. While Polar.sh administers payment collection and statutory tax remittance, this Agreement governs the direct bilateral software license, intellectual property rights, uptime SLA, and data processing obligations between Licensor and Customer.

## 2. Commercial License Grant & Seat Allocation

| Plan Tier | Polar Order ID | Billing Amount | SLA Target | Support Response |
|---|---|---|---|---|
| ${productName} | ${payload.id} | ${currency} ${amountFormatted} | 99.95% Uptime | < 2 Hours (P1 Priority) |

Licensor grants Customer a non-exclusive, worldwide, commercial license to deploy and use the Software across Customer's internal engineering environments during the active subscription term.

## 3. GDPR Article 28 Data Processing Addendum (DPA)

1. **Scope & Processing Instructions:** Licensor shall process Customer Personal Data and repository telemetry solely on documented instructions from Customer in accordance with GDPR Article 28.
2. **Technical & Organizational Security:** Licensor enforces TLS 1.3 encryption in transit, AES-256 encryption at rest, strict tenant isolation, and annual third-party penetration testing.
3. **Authorized Subprocessors:** Customer authorizes Licensor's core infrastructure subprocessors (Amazon Web Services, Cloudflare Inc., and Neon Inc.). Licensor shall provide 30 days prior notice of any subprocessor changes.

## 4. Limitation of Liability & Governing Law

Each party's aggregate cumulative liability arising out of or related to this Agreement shall not exceed the total subscription fees paid by Customer in the twelve (12) months preceding the claim. Governed by the laws of the State of Delaware.`;

    const signbeeRes = await fetch("https://signb.ee/api/v1/send", {
      method: "POST",
      headers: {
        "Authorization": `Bearer ${process.env.SIGNBEE_API_KEY}`,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        title: `Enterprise License & DPA — ${legalEntity} (${effectiveDate})`,
        markdown: markdownAgreement,
        sender_name: "Legal & Compliance — HyperScale DevTools Ltd.",
        sender_email: "legal@hyperscaledev.io",
        recipient_name: String(customerName),
        recipient_email: String(customerEmail),
        expires_in_days: 14,
        webhook_url: `${process.env.NEXT_PUBLIC_APP_URL}/api/webhooks/signbee`,
      }),
    });

    const result = await signbeeRes.json();
    return NextResponse.json({ dispatched: true, signbee_document_id: result.document_id });
  }

  return NextResponse.json({ received: true });
}

Look closely at Section 1 of the generated markdown contract above: it explicitly harmonizes the Merchant of Record structure with your direct B2B obligations. It acknowledges that Polar Software Inc. processed the payment and VAT invoice while establishing a clean, legally enforceable bridge between your software company and the enterprise customer for the SLA, IP license, and GDPR DPA.

4. Blueprint B: Wiring Lemon Squeezy HMAC Webhooks to Signbee

If your SaaS or developer product runs on Lemon Squeezy (now part of the Stripe ecosystem), webhook verification uses an X-Signature HMAC-SHA256 digest over the raw request body, and custom metadata passed during checkout creation is delivered inside meta.custom_data.

Below is the production TypeScript handler for Lemon Squeezy's subscription_created and order_created webhooks using constant-time cryptographic verification (crypto.timingSafeEqual) before triggering Signbee:

src/app/api/webhooks/lemonsqueezy/route.tsLemon Squeezy + Signbee TypeScript
import { NextResponse } from "next/server";
import crypto from "crypto";

export async function POST(req: Request) {
  const rawBody = await req.text();
  const signatureHeader = req.headers.get("x-signature") || "";
  const secret = process.env.LEMONSQUEEZY_WEBHOOK_SECRET!;

  // 1. Constant-time HMAC-SHA256 verification
  const hmac = crypto.createHmac("sha256", secret).update(rawBody).digest("hex");
  const digestBuffer = Buffer.from(hmac, "utf8");
  const signatureBuffer = Buffer.from(signatureHeader, "utf8");

  if (
    digestBuffer.length !== signatureBuffer.length ||
    !crypto.timingSafeEqual(digestBuffer, signatureBuffer)
  ) {
    return NextResponse.json({ error: "Invalid X-Signature" }, { status: 401 });
  }

  const event = JSON.parse(rawBody);
  const eventName: string = event.meta?.event_name;

  if (eventName === "order_created" || eventName === "subscription_created") {
    const attrs = event.data?.attributes || {};
    const customData = event.meta?.custom_data || {};

    const buyerEmail: string = attrs.user_email;
    const buyerName: string = attrs.user_name || buyerEmail;
    const companyName: string = customData.company_legal_name || buyerName;
    const variantName: string = attrs.variant_name || attrs.product_name || "Enterprise Tier";
    const totalFormatted: string = attrs.total_formatted || "$2,400.00";
    const orderNumber = attrs.order_number || event.data?.id;
    const today = new Date().toISOString().split("T")[0];

    // 2. Dispatch post-checkout B2B Master Subscription Agreement via Signbee
    const response = await fetch("https://signb.ee/api/v1/send", {
      method: "POST",
      headers: {
        "Authorization": `Bearer ${process.env.SIGNBEE_API_KEY}`,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        title: `B2B Subscription Agreement & SLA — ${companyName}`,
        markdown: `# B2B Software Subscription Agreement & SLA

**Date:** ${today}  
**Lemon Squeezy Order Reference:** #${orderNumber}  
**Customer:** ${companyName} (${buyerEmail})  
**Plan & Commercial Commitment:** ${variantName} (${totalFormatted})

## 1. Scope of Commercial License
This Agreement supplements the payment transaction processed via Lemon Squeezy LLC (Merchant of Record) and establishes direct commercial SLA, confidentiality, and GDPR data processing obligations between Vendor and **${companyName}**.

## 2. Confidentiality & Security Commitments
Both parties agree to maintain strict confidentiality regarding proprietary API keys, architecture documentation, and benchmark data shared under this subscription.`,
        sender_name: "Operations & Legal — DevStack AI Inc.",
        sender_email: "contracts@devstack.ai",
        recipient_name: buyerName,
        recipient_email: buyerEmail,
        expires_in_days: 10,
      }),
    });

    const data = await response.json();
    return NextResponse.json({ ok: true, document_id: data.document_id });
  }

  return NextResponse.json({ ok: true });
}

5. Gating Self-Hosted License Keys & Private GitHub Repos Until Signature Completion

When selling high-value source-available codebases, self-hosted Kubernetes Helm charts, or enterprise CLI binaries, releasing the download token before the customer signs your Non-Redistribution and IP License Agreement exposes your intellectual property to immediate leakage.

By listening for Signbee's outbound document.signed webhook, you can automate a two-stage fulfillment gate:

  1. Stage 1 (Payment Completed on Polar.sh / Lemon Squeezy): Provision the customer's dashboard account in a pending_legal_signature state and display an embedded banner linking directly to the Signbee signing ceremony URL.
  2. Stage 2 (Signbee Fires document.signed): The instant the buyer signs the agreement, Signbee posts the signed status, signer IP, and SHA-256 hash to your /api/webhooks/signbee endpoint. Your backend then calls the GitHub REST API to invite their username to your private enterprise repository or activates their production license key.
src/app/api/webhooks/signbee/route.tsPost-Signature License Provisioning
import { NextResponse } from "next/server";

export async function POST(req: Request) {
  const payload = await req.json();

  // Signbee fires document.signed as soon as Party B completes the ceremony
  if (payload.event === "document.signed") {
    const {
      document_id,
      recipient_email,
      signed_pdf_url,
      sha256_hash,
      signed_at,
    } = payload.data;

    // 1. Archive the signed PDF URL and cryptographic SHA-256 hash in your database
    console.log(`[Compliance] Verified SHA-256 (${sha256_hash}) for ${recipient_email}`);

    // 2. Unlock enterprise license key or trigger GitHub private repo invite
    await fetch("https://api.polar.sh/v1/customer-portal/license-keys/activate-enterprise", {
      method: "POST",
      headers: {
        "Authorization": `Bearer ${process.env.POLAR_ACCESS_TOKEN}`,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        customer_email: recipient_email,
        compliance_audit: {
          signbee_document_id: document_id,
          sha256_hash,
          signed_at,
          signed_pdf_url,
        },
      }),
    });

    return NextResponse.json({ provisioned: true });
  }

  return NextResponse.json({ acknowledged: true });
}

6. Why DevTool Founders Pair Modern MoRs with Signbee Instead of DocuSign

Founders who build with Next.js, TypeScript, Polar.sh, and Lemon Squeezy care deeply about developer ergonomics and unit economics. When evaluating legacy providers in our DocuSign API pricing analysis and 2026 e-signature API pricing comparison, three friction points consistently stand out:

  • Markdown-As-Code vs. Binary PDF Templates: In a DevTool company, your DPA, SLA, and Commercial License should live in your Git repository as version-controlled .md files reviewed via Pull Requests—not trapped inside a proprietary web GUI where someone has to manually drag signature boxes around every time you add a new subprocessor.
  • Zero Per-Envelope Tax on Self-Serve Growth: If you sell a $99/month Team plan via Polar.sh, paying a legacy vendor $3.50 per envelope plus $4,800/year in base API platform fees makes automated contract dispatch prohibitively expensive. Explore our affordable e-signature API integration guide and free e-signature API benchmarks to see how flat developer tiers protect your SaaS margins.
  • Zero Self-Hosting Maintenance Burden: While some engineering teams experiment with self-hosted containers (covered in our open-source e-signature API comparison), maintaining PostgreSQL backups, KMS signing keys, and SMTP deliverability reputation for an e-signature microservice distracts from your core product. Signbee gives you a stateless API with optional white-label e-signature API branding out of the box.
MoR PlatformPrimary Webhook EventSignature Verification HeaderCustom Legal Metadata Field
Polar.shorder.created / subscription.createdwebhook-signature (Standard Webhooks)event.data.customFieldData
Lemon Squeezyorder_created / subscription_createdX-Signature (HMAC-SHA256)event.meta.custom_data
Paddle Billingtransaction.completedPaddle-Signature (ts + h1 HMAC)event.data.custom_data

7. Production Deployment Checklist for MoR + Signbee Contract Pipelines

To deploy this architecture cleanly across your staging and production environments, follow this four-point checklist:

  1. Version-Control Your Markdown DPA & SLA Templates: Store your base CommonMark templates inside your codebase (src/legal/enterprise-dpa-2026.md) so every change to your subprocessor list or uptime SLA is tracked by Git commit hashes.
  2. Filter by Product Tier or Price Threshold: Do not force $9/month hobbyist developers to sign a 4-page Enterprise MSA. Inspect payload.product.name or payload.amount >= 9900 in your webhook handler so only Team, Business, and Enterprise plans trigger Signbee dispatches.
  3. Include the MoR Order Reference in the Contract Header: Always inject the Polar.sh order.id or Lemon Squeezy order_number into the title and first paragraph of your CommonMark payload so the customer's procurement team can reconcile their tax invoice with the executed legal agreement in one glance.
  4. Archive the Public Verification Link: Store https://signb.ee/verify/[document_id] inside your user database and expose a “Download Signed DPA & SLA Certificate” button directly inside your app's billing settings tab.

Frequently Asked Questions: Polar.sh, Lemon Squeezy & Signbee

Why do DevTool startups using a Merchant of Record like Polar.sh or Lemon Squeezy still need B2B e-signatures?

A Merchant of Record (MoR) such as Polar.sh, Lemon Squeezy, or Paddle acts as the financial reseller of your software to calculate, collect, and remit global VAT, GST, and US state sales taxes. However, the MoR is not the data processor, infrastructure operator, or intellectual property licensor of your application. When an enterprise engineering team buys an annual Team or Enterprise plan, their security and legal departments require a signed Data Processing Agreement (DPA under GDPR Article 28), a Service Level Agreement (SLA), and a Commercial Enterprise License executed directly between your company and the buyer.

How do I connect Polar.sh webhooks to Signbee to auto-send DPAs and Enterprise agreements?

In your Polar.sh organization settings, register a webhook endpoint listening to order.created and subscription.created. Polar signs all webhook payloads using the Standard Webhooks specification (webhook-id, webhook-timestamp, and webhook-signature headers). In your Next.js route handler, verify the payload with @polar-sh/sdk/webhooks, inspect the product benefit tier or custom checkout field, interpolate the buyer's email and organization metadata into a CommonMark markdown agreement, and call POST https://signb.ee/api/v1/send with your Signbee Bearer token.

How do I verify Lemon Squeezy webhook signatures before calling the Signbee API?

Lemon Squeezy signs every webhook request using an HMAC-SHA256 digest transmitted in the X-Signature HTTP header. In Node.js or Next.js App Router, read the raw request body via req.text(), compute crypto.createHmac('sha256', process.env.LEMONSQUEEZY_WEBHOOK_SECRET).update(rawBody).digest('hex'), and compare it against the X-Signature header using crypto.timingSafeEqual. Once verified, inspect meta.event_name for order_created or subscription_created and trigger your Signbee contract dispatch.

Should the Merchant of Record or the software vendor be listed as Party A on the Data Processing Agreement (DPA)?

Your software company (the Supplier/Developer) must be listed as Party A on the Data Processing Agreement (DPA), Service Level Agreement (SLA), and Master Software License, while referencing the Merchant of Record (Polar.sh or Lemon Squeezy) as the authorized billing and tax collection agent for the Order Schedule. Under GDPR and CCPA, your infrastructure processes the customer's source code, telemetry, or end-user data, meaning your legal entity—not the payment reseller—holds statutory subprocessor and security obligations.

Can I gate GitHub repository access, license keys, or Discord roles until the Signbee contract is signed?

Yes. While Polar.sh and Lemon Squeezy can automatically grant basic tier benefits upon payment, many B2B DevTools hold back production enterprise license keys, private GitHub organization invitations, or dedicated Slack/Discord support channels until the counterparty signs their Enterprise MSA or DPA. When Signbee fires the document.signed webhook back to your server, you can programmatically invoke the Polar Benefits API or Lemon Squeezy License Key API to activate the customer's production credentials.

How does Signbee compare to DocuSign or PandaDoc for developer-first MoR billing stacks?

Developer-first founders choose Polar.sh and Lemon Squeezy specifically to avoid legacy enterprise bloat, complex ERP tax integrations, and opaque sales-led pricing. Pairing a modern Merchant of Record with DocuSign reintroduces XML/SOAP-era coordinate tagging, OAuth RSA key ceremonies, and $3.00+ per-envelope fees. Signbee matches the developer experience of Polar.sh: you send raw CommonMark Markdown over a single JSON POST endpoint, Party A is signed automatically via your API key, and Party B signs in a clean browser flow backed by an immutable SHA-256 certificate.

Ship Enterprise-Ready DPAs & SLAs with Your MoR Checkout

Connect Polar.sh or Lemon Squeezy webhooks to Signbee in minutes. Send markdown, get cryptographically verified PDFs, and close enterprise deals without manual legal bottlenecks.