Skip to content

Make.com Integration

Use Make.com (formerly Integromat) to call the thelawin.dev API from a visual scenario. The HTTP module handles the request.

Prerequisites

  • Make.com account (Free: 1,000 ops/month)
  • thelawin.dev API key (for testing: env_sandbox_demo)

Create a Scenario

1. Trigger Module

Pick a trigger for your scenario:

ModuleUse Case
Webhook (Custom webhook)Receive data from your app
Google Sheets (Watch Rows)New row = new invoice
Airtable (Watch Records)New record = new invoice
ScheduleRecurring invoices (weekly, monthly)

2. Configure the HTTP Module

Add HTTP → Make a request:

FieldValue
URLhttps://api.thelawin.dev/v1/generate
MethodPOST
Body typeRaw
Content typeJSON (application/json)
Request content(see JSON below)

Headers:

KeyValue
X-API-Keyenv_sandbox_demo

Request content (JSON):

json
{
  "format": "zugferd",
  "template": "minimal",
  "locale": "de",
  "invoice": {
    "number": "RE-2026-001",
    "date": "2026-01-15",
    "currency": "EUR",
    "seller": {
      "name": "Deine Firma GmbH",
      "street": "Musterstrasse 1",
      "city": "Berlin",
      "postal_code": "10115",
      "country": "DE",
      "vat_id": "DE123456789"
    },
    "buyer": {
      "name": "Kunde AG",
      "city": "Muenchen",
      "country": "DE"
    },
    "items": [
      {
        "description": "Beratungsleistung",
        "quantity": 8,
        "unit": "HUR",
        "unit_price": 150.00,
        "vat_rate": 19
      }
    ]
  }
}

Enable Parse response so Make splits the JSON response into fields automatically.

3. Process the PDF

The response contains pdf_base64 and filename.

Convert Base64 to a file:

Add Tools → Set variable:

  • Variable: pdf_binary
  • Value: {{base64decode(HTTP.body.pdf_base64)}}

Then use Google Drive → Upload a File or Email → Send an Email with the PDF attached.

4. Error Handling

Attach an Error Handler to the HTTP module:

  • 422: Validation error | route to logging
  • 402: Quota exceeded | route to notification
  • 5xx: Server error | retry after 60 seconds

Scenario: Airtable → ZUGFeRD → Google Drive

  1. Airtable | Watch Records (table "Invoices", filter: Status = "New")
  2. HTTP | POST to api.thelawin.dev/v1/generate with Airtable data
  3. Google Drive | Upload File (Base64 → PDF)
  4. Airtable | Update Record (Status = "Created", add PDF link)

Common Errors

ErrorCauseSolution
401 UnauthorizedAPI key missing or wrongCheck X-API-Key header
422 ValidationRequired fields missingInspect errors[].path in the response
"Parse error"Invalid JSON syntaxValidate your JSON externally
Empty PDF fileBase64 not decoded correctlyUse the base64decode() function

Next Steps

ZUGFeRD 2.4 & Factur-X 1.0.8 compliant