Documents
An offer has two kinds of documents:
- Stored documents: what the planner's documents tab (Dokumente) lists — the datasheets of its parts, the grid operator's forms, the plans generated from it (parts list, string plan, circuit diagram, Kommissionsliste) and the files your team uploaded. You list and download them, and you add, rename, replace and remove them.
- Rendered documents: the offer as a PDF, the grid operator's registration forms, the string plan and the circuit diagram. They are rendered on demand from the offer as it stands, so a fresh call always reflects the current configuration. The two plans can be stored on the offer as well.
Every document endpoint of an offer needs the read:documents scope, and
read:offers because it reads the offer. Changing the stored documents needs
write:offers instead.
The files of a project (Dateien, Mein Bereich) are something else: see Project files.
Stored documents
curl https://ejgemvrnkezmnhucjdvx.supabase.co/functions/v1/api/v1/offers/812/documents -H "Authorization: Bearer mds_live_your_key"
{
"data": [
{
"id": "5121",
"name": "Datenblatt Wechselrichter",
"description": null,
"type": "MATERIAL_INVERTER",
"generator": null,
"fileName": "Datenblatt Wechselrichter.pdf",
"contentType": "application/pdf",
"sizeBytes": 482113,
"contentSha256": "9f2c4e7a1b3d5f60718293a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4",
"shownToCustomer": true,
"createdAt": "2026-11-20T09:14:03.512+00:00",
"downloadUrl": "https://…/storage/v1/object/sign/documents/…?token=…&download=Datenblatt%20Wechselrichter.pdf",
"downloadUrlExpiresAt": "2026-11-23T11:00:00.000Z"
}
]
}
The documents come in the order of the planner's tab: the generated plans, the grid operator's forms, the parts' datasheets by part, then the rest.
- Download a file with a plain
GETon itsdownloadUrl— no API key needed, and the file comes withfileNameas its name. The link works for one hour. Don't store it, since anyone with the link gets the file; list the documents again for fresh links. It isnullwhen the file is missing. typesays what a document is:MATERIAL_*a datasheet or certificate of a part of that kind,NETWORK_CARRIERa form of the grid operator,ADDITIONALeverything else. A plan generated from the offer has itsgeneratorset:PARTS_LIST,STRING_PLAN,CIRCUIT_DIAGRAMorCOMMISSION_LIST.contentSha256identifies the file's content. To keep a copy in step, download only the values you don't have yet; two documents with the same value are the same file. The webhookoffer.documents_changedsays when to look again.shownToCustomersays whether the customer sees the document with their offer. A draft shows them nothing; an accepted offer leaves out the datasheets of parts the customer did not order.
One document alone, for instance for a fresh link, is
GET /v1/offers/{id}/documents/{documentId}.
Adding and changing stored documents
Send a file as a form (multipart/form-data), with the file in file:
curl https://ejgemvrnkezmnhucjdvx.supabase.co/functions/v1/api/v1/offers/812/documents -H "Authorization: Bearer mds_live_your_key" -F "file=@netzanmeldung.pdf" -F "name=Netzanmeldung, unterschrieben" -F "type=NETWORK_CARRIER"
The answer is the new document, as in the list above.
- The file is a PDF, JPEG, PNG, WebP or HEIC of at most 20 MiB. Its type is told from its content, not from its name.
name(at most 100 characters) anddescription(at most 500) are optional. Without a name the document takes the file's, without its extension.typeisADDITIONAL(the default) orNETWORK_CARRIERfor a form of the grid operator. The electrical contractor the project is released to sees the forms, but not the additional files.
The other changes:
| Call | What it does |
|---|---|
PATCH /v1/offers/{id}/documents/{documentId} | Changes the name or the description. |
PUT /v1/offers/{id}/documents/{documentId}/file | Puts another file in its place, sent as the same kind of form. Id, name and type stay. |
DELETE /v1/offers/{id}/documents/{documentId} | Removes the document. |
Who sees a change
The offer can be in any state. On a draft only your team sees the documents. On a published or accepted offer the customer sees every change at once, and the offer's history in the planner names the change and your API key. No mail is sent. So an offer is not the place for internal files.
The Kommissionsliste belongs to the shipments and is renewed with them: it
can be read, but not changed or removed (409 document_read_only).
Repeating a call
An offer holds a file once. Sending the very same file again answers
409 document_already_in_offer with the document's id in documentId:
{
"error": "document_already_in_offer",
"message": "This offer has this very file already.",
"documentId": "5121"
}
So when you do not know whether a call went through (a timeout, a 5xx), send it
again: a 409 with documentId means it did. Send large files one after
another; a batch of them at the same moment can exceed what the server takes and
fail with a 5xx.
Errors
| Status | Error | What to do |
|---|---|---|
400 | validation_error | The body is no form, the file is missing or empty, or a field is not valid; the message names it. |
404 | not_found | The offer or the document does not exist in your company. |
409 | document_already_in_offer | The offer has this file; documentId names the document. |
409 | document_read_only | The document is the Kommissionsliste. |
413 | file_too_large | The file has more than 20 MiB. |
415 | file_type_not_allowed | Send a PDF, JPEG, PNG, WebP or HEIC. |
429 | rate_limited | The key has stored 1000 files within the hour. Wait the seconds in Retry-After. |
The offer as a PDF
curl https://ejgemvrnkezmnhucjdvx.supabase.co/functions/v1/api/v1/offers/812/pdf -H "Authorization: Bearer mds_live_your_key" --output angebot.pdf
The PDF has the sections your company chose in the planner under Einstellungen → Dokumentgenerierung → Kundenangebot (overview, costs, economics, datasheets, your own pages), in that order. It shows the offer as the customer gets it:
- an accepted offer with what the customer ordered;
- any other published offer as it was offered: on each roof the module
variant marked
recommended, theactivebattery and wallbox, the recommended emergency power, and no optional extras.
Rendering takes a few seconds, for a long offer up to a minute.
| Status | Error | What to do |
|---|---|---|
409 | offer_not_published | A draft has no PDF. Publish the offer first. |
409 | offer_selection_required | A roof has several module variants and none is marked recommended. Mark one, or wait for the customer's order. |
409 | offer_pdf_not_set_up | Your company has not chosen the PDF's sections yet. Choose them in the planner. |
404 | not_found | The offer does not exist in your company. |
500 | generation_failed | Rendering failed — the message carries the detail. |
Grid operator forms
The forms for an offer, with everything defaulted:
curl -X POST https://ejgemvrnkezmnhucjdvx.supabase.co/functions/v1/api/v1/offers/812/network-carrier-documents -H "Authorization: Bearer mds_live_your_key" -H "Content-Type: application/json" -d '{}' --output documents.zip
With an empty body you get the grid operator set on the offer's project and all of that operator's forms, in the order the operator configured. That is the same set the planner produces by default, so most integrations never need to name an id at all.
Looking up the ids
Every id the request can carry is readable through the API.
The operators and their forms — GET /v1/grid-operators:
curl https://ejgemvrnkezmnhucjdvx.supabase.co/functions/v1/api/v1/grid-operators -H "Authorization: Bearer mds_live_your_key"
{
"data": [
{
"id": "7",
"name": "Stadtwerke München",
"documents": [
{ "id": "1", "name": "Anmeldung Erzeugungsanlage", "pass": "OFFER", "orderPriority": 1 },
{ "id": "4", "name": "Datenblatt Wechselrichter", "pass": "INVERTER", "orderPriority": 2 }
]
}
],
"total": 1,
"limit": 50,
"offset": 0
}
A document's pass says how often it is rendered: OFFER once per offer,
INVERTER once per inverter on the offer, BATTERY once per battery.
The electrical contractors you can name on the forms —
GET /v1/electrical-firms. Their ids go in electronicsFirmId.
Which operator a site belongs to — a project's networkCarrierId
(GET /v1/projects/{id}). This is the operator a document request defaults to.
Everything for one offer at once —
GET /v1/offers/{id}/network-carrier-documents/options:
{
"gridOperator": { "id": "7", "name": "Stadtwerke München", "documents": [] },
"documents": [{ "id": "1", "name": "Anmeldung Erzeugungsanlage", "pass": "OFFER", "orderPriority": 1 }],
"electricalFirms": [{ "id": "3", "name": "Elektro Huber GmbH", "firmNumber": "EL-2019-4471" }],
"moduleConfigurations": [
{ "id": "19", "roofName": "Süddach", "moduleName": "Vitovolt 300-DG M440HC", "selected": true, "roofActive": true }
],
"batteries": [{ "id": "88", "name": "Vitocharge VX3 8 kWh", "selected": true }]
}
selected marks what the planner UI preselects, so mirroring the planner's
default output is a matter of passing the selected entries back. The module
configuration ids are the only ones with no other route — they live inside the
offer's roofs — so this is where moduleConfigurationIds comes from.
Choosing what goes on the forms
curl -X POST https://ejgemvrnkezmnhucjdvx.supabase.co/functions/v1/api/v1/offers/812/network-carrier-documents -H "Authorization: Bearer mds_live_your_key" -H "Content-Type: application/json" -d '{
"networkCarrierId": "7",
"documentIds": ["1", "4"],
"plannedGoingLiveDate": "2026-09-01",
"electronicsFirmId": "3",
"moduleConfigurationIds": ["19"],
"batteryId": "88",
"includeCertificates": true,
"includeDatasheets": true,
"includeMergedDocument": true
}' --output documents.zip
documentIdsmay be any subset of the operator's forms. They always come out in the operator's configured order, whatever order you send.moduleConfigurationIdspicks the module a roof counts with in the technical data, one per roof (a roof can offer several). A roof you leave out — and every roof when you omit it — counts with itsselectedconfiguration.batteryIdpicks which battery theBATTERY-pass forms describe. Omit it and the offer's selected battery is used when there is exactly one candidate; sendnullfor none.includeCertificates/includeDatasheetsappend the product PDFs, andincludeMergedDocumentadds one combined PDF alongside the individual files.
The response is the ZIP archive itself, not JSON.
Errors
| Status | Error | What to do |
|---|---|---|
400 | network_carrier_not_set | The project has no grid operator. Pass networkCarrierId, or set one on the project. |
400 | no_documents_configured | The operator has no forms configured (or is not yours). Check GET /v1/grid-operators. |
400 | unknown_document_ids | One or more documentIds are not configured for that operator; the message lists the valid ones. |
404 | not_found | The offer does not exist in your company. |
500 | generation_failed | Rendering failed — the message carries the generator's detail. |
String plan
curl https://ejgemvrnkezmnhucjdvx.supabase.co/functions/v1/api/v1/offers/812/string-plan -H "Authorization: Bearer mds_live_your_key" --output string-plan.pdf
No body and no options: it renders how the offer's modules are wired into the inverters' MPP trackers, as a PDF.
Circuit diagram
curl https://ejgemvrnkezmnhucjdvx.supabase.co/functions/v1/api/v1/offers/812/circuit-diagram -H "Authorization: Bearer mds_live_your_key" --output circuit-diagram.pdf
The Schaltschema as a PDF, one page per inverter, with what the planner's dialog
preselects: an accepted offer as the customer ordered it, any other offer with
the active battery and wallbox and the recommended emergency power. It carries
the customer's name and the address of the site. An offer whose modules are not
wired to an inverter has nothing to draw (409 strings_not_configured).
Storing a plan
curl https://ejgemvrnkezmnhucjdvx.supabase.co/functions/v1/api/v1/offers/812/documents/generate -H "Authorization: Bearer mds_live_your_key" -H "Content-Type: application/json" -d '{ "generator": "CIRCUIT_DIAGRAM" }'
Generates the plan (STRING_PLAN or CIRCUIT_DIAGRAM) and stores it as a
document of the offer. An offer that has a document of that plan gets it renewed,
under the same id (200); otherwise it is added (201). So the call can run
after every change of the offer without piling up versions. Without a name the
document is named as in the planner, for example Schaltschema_Müller_2026-11-30.
The parts list is put together in the planner and cannot be generated here.
Datasheets and default documents
An offer made in the planner starts with your default documents, and its datasheets are taken over with one click. For an offer made through the API two calls do the same:
curl -X POST https://ejgemvrnkezmnhucjdvx.supabase.co/functions/v1/api/v1/offers/812/documents/datasheets -H "Authorization: Bearer mds_live_your_key"
curl -X POST https://ejgemvrnkezmnhucjdvx.supabase.co/functions/v1/api/v1/offers/812/documents/defaults -H "Authorization: Bearer mds_live_your_key"
Both answer with the documents that were added (data), how many files the offer
had already (alreadyInOffer) and the files that could not be taken over
(skipped). They add what is missing and remove nothing, so call them again after
the offer has changed.
datasheets needs read:materials as well. It takes a parts:
parts | Datasheets of |
|---|---|
OFFERED | every part offered, with all alternatives. The default before the acceptance. |
RECOMMENDED | the recommended modules, the active battery and wallbox, and the parts without alternatives. |
ORDERED | what the customer ordered. The default on an accepted offer, and only possible there (409 offer_not_accepted). |
On an accepted offer the customer does not see datasheets of parts they did not order, whichever you add.
How a product gets its documents is in Catalog files and pictures.