Skip to main content

Catalog files and pictures

A product of your catalog has a datasheet, documents such as a manual, and pictures; batteries and inverters have certificates as well. A manufacturer has a logo, and an offer has pictures at its top, such as a visualisation of the roof. You send the files as forms (multipart/form-data); where they are stored is not yours to choose, and no endpoint takes a storage path.

FilesReadWrite
Of a productread:materialswrite:materials
A manufacturer's logoread:manufacturerswrite:manufacturers
Pictures of an offerread:offerswrite:offers

Every file is answered with a downloadUrl that fetches it without an API key for one hour, and with contentSha256, which identifies its content.

The files of a product​

curl https://ejgemvrnkezmnhucjdvx.supabase.co/functions/v1/api/v1/materials/inverters/70/files -H "Authorization: Bearer mds_live_your_key"
{
"datasheet": {
"fileName": "Datenblatt SUN2000-10KTL-M1.pdf",
"contentType": "application/pdf",
"sizeBytes": 482113,
"contentSha256": "9f2c4e7a1b3d5f60718293a4b5c6d7e8f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4",
"downloadUrl": "https://…/storage/v1/object/sign/documents/…?token=…&download=Datenblatt%20SUN2000-10KTL-M1.pdf",
"downloadUrlExpiresAt": "2026-11-30T11:00:00.000Z"
},
"certificates": [
{ "certificate": "VDE_AR_N_4105", "name": "VDE-AR-N 4105", "file": null },
{ "certificate": "ZNAS_VDE_AR_N_4105", "name": "zNAS VDE-AR-N 4105", "file": null }
],
"documents": [],
"pictures": []
}

The type in the path is the one of the product's own endpoints: pv-modules, batteries, inverters, wallboxes, equipment, misc, subconstruction or emergency-powers.

Datasheet and certificates​

A product has one datasheet and one file per certificate, so you set them:

curl -X PUT https://ejgemvrnkezmnhucjdvx.supabase.co/functions/v1/api/v1/materials/inverters/70/datasheet -H "Authorization: Bearer mds_live_your_key" -F "file=@sun2000.pdf"

curl -X PUT https://ejgemvrnkezmnhucjdvx.supabase.co/functions/v1/api/v1/materials/inverters/70/certificates/VDE_AR_N_4105 -H "Authorization: Bearer mds_live_your_key" -F "file=@vde-4105.pdf"

Sending the file that is there changes nothing, so a nightly run can simply send all of them. DELETE on the same path takes the file out.

Documents​

curl https://ejgemvrnkezmnhucjdvx.supabase.co/functions/v1/api/v1/materials/inverters/70/documents -H "Authorization: Bearer mds_live_your_key" -F "file=@montageanleitung.pdf" -F "name=Montageanleitung"

PATCH …/documents/{documentId} renames a document, PUT …/documents/{documentId}/file replaces its file under the same id, DELETE removes it. A product holds a file once: the same one again answers 409 document_already_on_material with the document's id in documentId.

Offers take the documents of their parts over (Datasheets and default documents) and keep their own copy: changing a document here does not change an offer.

Pictures​

curl https://ejgemvrnkezmnhucjdvx.supabase.co/functions/v1/api/v1/materials/inverters/70/pictures -H "Authorization: Bearer mds_live_your_key" -F "file=@sun2000.png"

DELETE …/pictures/{pictureId} removes a picture. The same one again answers 409 picture_already_on_material with pictureId, for pictures stored through the API.

Logos of manufacturers​

curl -X PUT https://ejgemvrnkezmnhucjdvx.supabase.co/functions/v1/api/v1/manufacturers/12/logo -H "Authorization: Bearer mds_live_your_key" -F "file=@logo.png"

GET reads it, DELETE takes it out.

Pictures of an offer​

curl https://ejgemvrnkezmnhucjdvx.supabase.co/functions/v1/api/v1/offers/812/pictures -H "Authorization: Bearer mds_live_your_key" -F "file=@visualisierung.jpg"

While the offer is a draft you add, move (PATCH, orderPriority) and remove pictures; after that they can be read (409 offer_not_draft). The same picture again answers 409 picture_already_in_offer with pictureId.

To show a picture on another offer as well, send its imagePath in previewImages when you create or replace that offer. Only pictures of your own offers can be named there. Replacing an offer (PUT /v1/offers/{id}) without previewImages keeps its pictures, under new ids.

What customers see​

  • Datasheets, product pictures and logos are public files: builder and configurator show them to visitors. A change is seen at once, also with offers your customers have already.
  • Certificates, documents and the pictures of an offer are not public. An offer's pictures are seen by its customer once it is published.

The file​

  • Documents, datasheets and certificates are PDFs of at most 20 MiB.
  • Pictures and logos are JPEG, PNG or WebP of at most 5 MB. They are stored as you send them, so send them in the size they are shown in: 1920 pixels are plenty.

The type is told from the content, not from the name.

StatusErrorWhat to do
400validation_errorThe body is no form, the file is missing or empty, or a field is not valid; the message names it.
404not_foundThe record or the file does not exist in your company, or the material type has no such certificate.
409document_already_on_material, picture_already_on_material, picture_already_in_offerThe file is there already; the answer names it.
409offer_not_draftThe offer was published; its pictures can no longer change.
413file_too_largeMore than 20 MiB, or a picture of more than 5 MB.
415file_type_not_allowedSend a PDF, or for a picture a JPEG, PNG or WebP.
429rate_limitedThe key has stored 1000 files within the hour. Wait the seconds in Retry-After.