{
  "openapi": "3.1.0",
  "info": {
    "title": "Deliver Funding website API",
    "version": "1.0.0",
    "description": "Lets AI agents submit a business-funding pre-qualification request or a question on behalf of a business owner who asked them to. A funding specialist follows up with the owner. Read https://deliverfunding.com/apply.md first. Only submit with the owner's consent; never invent data."
  },
  "servers": [{ "url": "https://deliverfunding.com" }],
  "paths": {
    "/api/submit-lead": {
      "post": {
        "operationId": "submitFundingRequest",
        "summary": "Submit a pre-qualification request for business funding ($10K-$5M)",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Lead" } } } },
        "responses": {
          "200": { "description": "Received", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Ok" } } } },
          "422": { "description": "Missing or invalid fields", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Invalid" } } } },
          "429": { "description": "Too many submissions; ask the owner to call (888) 974-0522" }
        }
      }
    },
    "/api/contact": {
      "post": {
        "operationId": "sendInquiry",
        "summary": "Send a question to Deliver Funding",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Contact" } } } },
        "responses": {
          "200": { "description": "Received", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Ok" } } } },
          "422": { "description": "Missing or invalid fields", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Invalid" } } } }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Lead": {
        "type": "object",
        "required": ["companyName", "merchantName", "monthlyRevenue", "requestedAmount", "timeInBusiness", "ficoScore", "state", "phone", "email", "optIn"],
        "properties": {
          "companyName": { "type": "string", "description": "Legal business name" },
          "merchantName": { "type": "string", "description": "Owner's full name" },
          "monthlyRevenue": { "type": "string", "enum": ["Under $10,000", "$10,000 - $25,000", "$25,000 - $50,000", "$50,000 - $100,000", "$100,000 - $250,000", "$250,000 - $500,000", "$500,000+"] },
          "requestedAmount": { "type": "number", "minimum": 10000, "maximum": 5000000, "description": "USD" },
          "timeInBusiness": { "type": "string", "enum": ["Less than 6 months", "6 months - 1 year", "1 - 2 years", "2 - 3 years", "3 - 5 years", "5+ years"] },
          "ficoScore": { "type": "string", "enum": ["Below 500", "500 - 549", "550 - 599", "600 - 649", "650 - 699", "700 - 749", "750+"], "description": "Owner's estimated credit score range" },
          "state": { "type": "string", "description": "Full U.S. state name" },
          "phone": { "type": "string" },
          "email": { "type": "string", "format": "email" },
          "optIn": { "type": "boolean", "const": true, "description": "True only if the owner agreed to be contacted by Deliver Funding via phone, SMS and email about this request" },
          "submittedVia": { "type": "string", "description": "e.g. ai-agent:<agent name>" },
          "source": { "type": "string", "description": "Short note on what the owner asked for" }
        }
      },
      "Contact": {
        "type": "object",
        "required": ["name", "email", "message"],
        "properties": {
          "name": { "type": "string" }, "email": { "type": "string", "format": "email" }, "phone": { "type": "string" },
          "subject": { "type": "string", "enum": ["General Inquiry", "Funding Question", "Application Status", "Partnership", "Other"] },
          "message": { "type": "string" }
        }
      },
      "Ok": { "type": "object", "properties": { "success": { "type": "boolean" }, "reference": { "type": "string" }, "message": { "type": "string" } } },
      "Invalid": { "type": "object", "properties": { "success": { "type": "boolean" }, "message": { "type": "string" }, "errors": { "type": "object", "additionalProperties": { "type": "string" } } } }
    }
  }
}
