machs-dir-selbst Public API
Connect your own systems to machs-dir-selbst, the planning tool for PV systems: read and change customers, projects, offers, your product catalog, services and bookings, and get a webhook when something changes.
Base URL
https://lmayqrxmxkxmaztaxvxu.supabase.co/functions/v1/api
Every path in this reference starts there, e.g. /v1/customers.
Authentication
Send your API key in the Authorization header: Authorization: Bearer mds_live_.... Create keys in the
planner under Einstellungen → API-Schlüssel. Each key has scopes that decide what it may read and change
(read:offers, write:offers, …); a write scope includes reading. A key only ever sees its own company's data.
How the data fits together
- A customer has projects: one per installation site, each with its roofs.
- A project has offers. An offer is made of lines (modules on the roofs, inverter, battery, wallbox, services, other material, free cost lines), and each line carries the net price it is sold for.
- An offer starts as a draft, is published to the customer, and is then accepted or declined.
- Materials (your product catalog), manufacturers and services are what offers are made of.
- Offer requests (Anfragen) come in through your configurator and lead to offers.
Conventions
- Ids are strings such as
"812"; bookings and team members have uuids. - Lists take
limit(1–200, default 50) andoffsetand answer with{ data, total, limit, offset };totalcounts all matches.sorttakes a field and a direction, e.g.sort=createdAt.desc. - Prices are in euros. Offer lines and purchase prices are net. A material has a
purchasePrice(what you pay) andsellingPrices(what it sells for at each site,netandgross).offerPriceincludes VAT. - Times are ISO 8601; dates are days on the German calendar.
- Errors look like
{ "error": "not_found", "message": "…" }with a matching HTTP status:400invalid request,401missing or wrong API key,403scope missing,404not found in your company,409not possible in the record's current state,500/502server error. Branch onerror, not onmessage.
Authentication
- HTTP: Bearer Auth
Send your API key as a Bearer token: Authorization: Bearer mds_live_.... Create keys in the planner under Einstellungen → API-Schlüssel.
Security Scheme Type: | http |
|---|---|
HTTP Authorization Scheme: | bearer |
Bearer format: | API Key |