{
  "openapi": "3.1.0",
  "info": {
    "title": "Antragsservice",
    "version": "2026.08",
    "summary": "Legt einen Förderantrag als Auftrag in der Joulee-Plattform an.",
    "description": "POST /order/create-direct-order erzeugt einen Auftrag. Wenn ein Angebot vorliegt, folgt POST /order/upload-order-document mit derselben orderUUID und dem uploadToken aus der ersten Antwort. Beide Aufrufe kommen vom Konfigurator auf Förderservice.de.",
    "contact": {
      "name": "Joulee Tech GmbH",
      "email": "kontakt@joulee.de",
      "url": "https://www.xn--frderservice-4ib.de"
    }
  },
  "servers": [
    {
      "url": "https://apiv5.joulee.app/api"
    }
  ],
  "paths": {
    "/order/create-direct-order": {
      "post": {
        "operationId": "createDirectOrder",
        "summary": "Auftrag anlegen",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDirectOrderRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Auftragskennung und optionaler Upload-Token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDirectOrderResponse"
                }
              }
            }
          }
        }
      }
    },
    "/order/upload-order-document": {
      "post": {
        "operationId": "uploadOrderDocument",
        "summary": "Angebot zum Auftrag hochladen",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/UploadOrderDocumentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Dokument angenommen."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CreateDirectOrderRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "email",
          "phone",
          "serviceType",
          "acceptedTerms",
          "acceptedFundingCondition",
          "requestedImmediateStart",
          "needsContractorReferral",
          "wantsOnSiteVisit",
          "selectedCategory",
          "categoryId",
          "categoryName",
          "selectedProduct",
          "productId",
          "productName",
          "requestType",
          "price",
          "listPrice",
          "currency",
          "promotionId",
          "promotionValidFrom",
          "promotionValidUntil",
          "productDescription",
          "description",
          "productFeatures",
          "features",
          "source",
          "timestamp"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 3,
            "maxLength": 120
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "phone": {
            "type": "string",
            "minLength": 6,
            "maxLength": 40
          },
          "postalCode": {
            "type": "string",
            "pattern": "^[0-9]{5}$"
          },
          "serviceType": {
            "type": "string"
          },
          "acceptedTerms": {
            "type": "boolean"
          },
          "acceptedFundingCondition": {
            "type": "boolean"
          },
          "requestedImmediateStart": {
            "type": "boolean"
          },
          "needsContractorReferral": {
            "type": "boolean"
          },
          "wantsOnSiteVisit": {
            "type": "boolean"
          },
          "selectedCategory": {
            "type": "string"
          },
          "categoryId": {
            "type": "string"
          },
          "categoryName": {
            "type": "string"
          },
          "selectedProduct": {
            "type": "string"
          },
          "productId": {
            "type": "string"
          },
          "productName": {
            "type": "string"
          },
          "requestType": {
            "type": "string"
          },
          "price": {
            "type": "number"
          },
          "listPrice": {
            "type": "number"
          },
          "currency": {
            "type": "string",
            "enum": [
              "EUR"
            ]
          },
          "promotionId": {
            "type": "string"
          },
          "promotionValidFrom": {
            "type": "string"
          },
          "promotionValidUntil": {
            "type": "string"
          },
          "productDescription": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "productFeatures": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "features": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "source": {
            "type": "string",
            "enum": [
              "konfigurator"
            ]
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CreateDirectOrderResponse": {
        "type": "object",
        "properties": {
          "orderId": {
            "type": [
              "string",
              "number"
            ]
          },
          "orderUUID": {
            "type": "string"
          },
          "uploadToken": {
            "type": "string"
          }
        }
      },
      "UploadOrderDocumentRequest": {
        "type": "object",
        "required": [
          "file",
          "orderUUID",
          "uploadToken"
        ],
        "properties": {
          "file": {
            "type": "string",
            "format": "binary"
          },
          "orderUUID": {
            "type": "string"
          },
          "uploadToken": {
            "type": "string"
          }
        }
      }
    }
  }
}
