{
  "openapi": "3.0.0",
  "info": {
    "title": "Isarey Quotation API",
    "description": "Submit quotation requests for international document attestation, Apostille certification, and Consular Legalization services. Isarey Certification Services handles documents issued in over 100 countries.",
    "version": "1.0.0",
    "contact": {
      "name": "Isarey Certification Services",
      "email": "info@isarey.com",
      "url": "https://www.isarey-document-attestation.com"
    }
  },
  "servers": [
    { "url": "https://www.isarey-document-attestation.com/api" }
  ],
  "paths": {
    "/quotation_api.aspx": {
      "post": {
        "summary": "Submit a quotation request",
        "description": "Submit a request for a quotation for document attestation, Apostille, legalization, or certified translation. A quote is emailed or sent by WhatsApp within 1 business day.",
        "operationId": "submitQuotation",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuotationRequest"
              },
              "examples": {
                "email_only": {
                  "summary": "Simple text-only request via email",
                  "value": {
                    "contact": "client@example.com",
                    "custcountry": "Germany",
                    "docdesc": "Birth certificate issued in Berlin, need Apostille for use in China"
                  }
                },
                "whatsapp": {
                  "summary": "Request with WhatsApp contact",
                  "value": {
                    "contact": "+4915123456789",
                    "custcountry": "Germany",
                    "docdesc": "University degree certificate for Qatar embassy attestation"
                  }
                },
                "with_files": {
                  "summary": "Request with document uploads",
                  "value": {
                    "contact": "client@example.com",
                    "custcountry": "United Kingdom",
                    "docdesc": "Marriage certificate for use in Spain",
                    "files": [
                      {
                        "filename": "marriage.pdf",
                        "content_base64": "JVBERi0xLjQK..."
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Quotation request received",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "received"
                    },
                    "reference": {
                      "type": "string",
                      "description": "6-character reference number",
                      "example": "ABC123"
                    },
                    "message": { "type": "string" }
                  }
                }
              }
            }
          },
          "400": { "description": "Invalid request - missing or invalid fields" },
          "405": { "description": "Method not allowed - POST only" },
          "429": { "description": "Rate limit exceeded" },
          "500": { "description": "Internal server error" }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "QuotationRequest": {
        "type": "object",
        "required": [ "contact" ],
        "properties": {
          "contact": {
            "type": "string",
            "description": "Email address or WhatsApp number in international format (e.g. +4915123456789). One is required."
          },
          "custcountry": {
            "type": "string",
            "description": "Country where the customer is based."
          },
          "docdesc": {
            "type": "string",
            "maxLength": 2000,
            "description": "Description of the documents and the country where they will be used. Include document type, purpose, and any urgency."
          },
          "files": {
            "type": "array",
            "maxItems": 5,
            "description": "Optional documents to attach. Maximum 5 files, 5MB each. Accepted formats: PDF, JPG, PNG, WebP, HEIC, DOCX.",
            "items": {
              "type": "object",
              "required": [ "filename", "content_base64" ],
              "properties": {
                "filename": {
                  "type": "string",
                  "example": "certificate.pdf"
                },
                "content_base64": {
                  "type": "string",
                  "format": "byte",
                  "description": "File content, base64-encoded"
                }
              }
            }
          }
        }
      }
    }
  }
}
