{
  "openapi": "3.1.0",
  "info": {
    "title": "Sigma Evolution quotation intake",
    "version": "1.0.0",
    "description": "Register quotation requests after customer authorization. Not an order. Payment only by bank transfer under agreed offer terms."
  },
  "servers": [
    {
      "url": "https://cereri.sigmaevolution.ro"
    }
  ],
  "paths": {
    "/v1/requests": {
      "post": {
        "operationId": "submitQuotationRequest",
        "summary": "Register an actual quotation request",
        "description": "General enquiries require at least 10 characters in details when items is empty. Reuse key and content on retries. Confirmation only after persistence. No automatic email.",
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-zA-Z0-9_-]{16,80}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "name",
                  "organization",
                  "email",
                  "items",
                  "acknowledged"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "organization": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "maxLength": 180
                  },
                  "phone": {
                    "type": "string",
                    "maxLength": 40
                  },
                  "details": {
                    "type": "string",
                    "maxLength": 3500
                  },
                  "acknowledged": {
                    "type": "boolean",
                    "const": true
                  },
                  "items": {
                    "type": "array",
                    "maxItems": 30,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "id",
                        "quantity"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "Exact public catalog reference; CP-G references identify families."
                        },
                        "quantity": {
                          "type": "integer",
                          "minimum": 1,
                          "maximum": 9999
                        }
                      }
                    }
                  },
                  "channel": {
                    "type": "string",
                    "enum": [
                      "web",
                      "agent"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Registered; returns reference, received_at, status, registered=true and commercial_terms"
          },
          "200": {
            "description": "Idempotent replay, same reference"
          },
          "400": {
            "description": "Invalid input"
          },
          "403": {
            "description": "Origin denied"
          },
          "409": {
            "description": "Key used with other content"
          },
          "413": {
            "description": "Body exceeds 18000 bytes"
          },
          "415": {
            "description": "JSON required"
          },
          "429": {
            "description": "Rate limit"
          },
          "503": {
            "description": "Registration not confirmed; retry same key"
          }
        }
      }
    },
    "/v1/status": {
      "post": {
        "operationId": "getQuotationStatus",
        "summary": "Read status without contact or product data",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "reference"
                ],
                "properties": {
                  "reference": {
                    "type": "string",
                    "pattern": "^SE-[0-9]{8}-[a-f0-9]{32}$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reference, timestamp and status only"
          },
          "404": {
            "description": "Unknown reference"
          }
        }
      }
    },
    "/v1/info": {
      "get": {
        "operationId": "getQuotationServiceInfo",
        "responses": {
          "200": {
            "description": "Service info and terms"
          }
        }
      }
    }
  }
}
