{
  "openapi": "3.1.0",
  "info": {
    "title": "Dream Config: AI Readiness Discovery quote and enquiry",
    "version": "1.0.0",
    "description": "Get an indicative quote for Dream Config's AI Readiness Discovery, then submit an enquiry. Quoting is open. Enquiring needs a short-lived, single-use grant that allows named fields only."
  },
  "servers": [
    {
      "url": "https://dreamconfig.co"
    }
  ],
  "paths": {
    "/api/quote.php": {
      "get": {
        "operationId": "getQuote",
        "summary": "Indicative quote for AI Readiness Discovery",
        "parameters": [
          {
            "name": "staff",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Number of staff"
          },
          {
            "name": "country",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 60
            },
            "description": "NZ, AU or US (codes or names), or any other country name, e.g. Germany"
          },
          {
            "name": "industry",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "e.g. tourism, professional services"
          }
        ],
        "responses": {
          "200": {
            "description": "Quote. price is null when pricing is on request. funding, when present, is a note that NZ co-funding may be available (conditions apply), with its source. It never states an amount or percentage. Prices are in NZD for every country; tax (excludes GST) appears on NZ quotes only. delivery says how the work is delivered."
          },
          "400": {
            "description": "Invalid input, with an example of a valid request"
          }
        }
      }
    },
    "/api/grant.php": {
      "post": {
        "operationId": "requestEnquiryGrant",
        "summary": "Get a single-use grant to submit one enquiry",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "action"
                ],
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "enquire"
                    ]
                  },
                  "quote_ref": {
                    "type": "string",
                    "description": "quote_ref returned by getQuote"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Grant token, allowed fields and expiry"
          }
        }
      }
    },
    "/api/enquire.php": {
      "post": {
        "operationId": "submitEnquiry",
        "summary": "Submit an enquiry using a grant",
        "security": [
          {
            "grant": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "email"
                ],
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "company": {
                    "type": "string"
                  },
                  "website": {
                    "type": "string"
                  },
                  "staff": {
                    "type": "integer"
                  },
                  "country": {
                    "type": "string",
                    "maxLength": 60,
                    "description": "NZ, AU, US or another country name"
                  },
                  "message": {
                    "type": "string"
                  },
                  "quote_ref": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Enquiry received, with enquiry_ref"
          },
          "401": {
            "description": "No grant"
          },
          "403": {
            "description": "Grant invalid, expired, already used or for another action"
          },
          "422": {
            "description": "Fields outside the grant, or name/email missing"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "grant": {
        "type": "http",
        "scheme": "bearer",
        "description": "Token from requestEnquiryGrant. Valid 10 minutes, one use."
      }
    }
  }
}
