SDKs & Libraries

Official and community integrations for the thelawin.dev API.

Official SDKs

Ruby

Available now

gem install thelawin
View on RubyGems →

JavaScript / TypeScript

Available now

npm install github:steviee/thelawin-clients#path:typescript
View on GitHub →

Python

Available now

pip install git+https://github.com/steviee/thelawin-clients.git#subdirectory=python
View on GitHub →

All 8 SDKs Available

TypeScript, Python, Ruby, Kotlin, Java, Swift, Dart, and C# SDKs are available on GitHub. Package registry publishing (npm, PyPI, Maven Central, etc.) follows with the stable release.

REST API

The API uses standard REST conventions and can be called from any language with HTTP support. See the API Reference for full documentation.

Example with curl

curl -X POST https://api.thelawin.dev/v1/generate \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $THELAWIN_API_KEY" \
  -d @invoice.json

Example with fetch (JavaScript)

const response = await fetch('https://api.thelawin.dev/v1/generate', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-Key': process.env.THELAWIN_API_KEY
  },
  body: JSON.stringify({
    template: 'minimal',
    invoice: { /* ... */ }
  })
});

const { pdf_base64 } = await response.json();
// Decode Base64 to save as file

Example with requests (Python)

import requests
import base64
import os

response = requests.post(
    'https://api.thelawin.dev/v1/generate',
    headers={
        'Content-Type': 'application/json',
        'X-API-Key': os.environ['THELAWIN_API_KEY']
    },
    json={
        'template': 'minimal',
        'invoice': { ... }
    }
)

pdf_bytes = base64.b64decode(response.json()['pdf_base64'])
with open('invoice.pdf', 'wb') as f:
    f.write(pdf_bytes)

MCP Integration

For AI assistant integration, see the MCP Server documentation.