{
  "openapi": "3.1.0",
  "info": {
    "title": "Outbounds Auto Transport Lead API",
    "version": "1.0.0",
    "description": "Submit a customer's vehicle shipping request to Outbounds Auto Transport. A shipping specialist contacts the customer with pricing and next steps. US domestic shipments only. No authentication required.",
    "contact": { "name": "Outbounds Auto Transport", "email": "go@outbounds.at", "url": "https://www.outbounds.at/developers" },
    "termsOfService": "https://www.outbounds.at/terms"
  },
  "servers": [{ "url": "https://live.outboundstransport.com" }],
  "paths": {
    "/v1/leads": {
      "post": {
        "operationId": "submitQuoteRequest",
        "summary": "Submit an auto transport quote request",
        "description": "Creates a quote request for shipping a vehicle within the United States. Use this when a customer wants a price to ship, transport, or move a car, SUV, pickup, or van from one US location to another. Collect the pickup and delivery locations, the vehicle type, and the customer's name, email, and phone before calling. Show the returned `message` to the customer verbatim. Set `dryRun` to true to test without creating a quote.",
        "requestBody": {
          "required": true,
          "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LeadRequest" } } }
        },
        "responses": {
          "201": {
            "description": "Request received. A specialist will contact the customer.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LeadResponse" } } }
          },
          "400": {
            "description": "Invalid or missing fields.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ValidationError" } } }
          },
          "422": {
            "description": "A location could not be resolved to a US city and state or ZIP code.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } }
          },
          "500": {
            "description": "Unexpected failure. Ask the customer to call 1-855-503-0008.",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiError" } } }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "LeadRequest": {
        "type": "object",
        "required": ["pickup", "delivery", "vehicle", "contact"],
        "properties": {
          "pickup": { "type": "string", "minLength": 2, "maxLength": 200, "description": "Pickup city and state, or a 5-digit ZIP code.", "examples": ["Seattle, WA"] },
          "delivery": { "type": "string", "minLength": 2, "maxLength": 200, "description": "Delivery city and state, or a 5-digit ZIP code.", "examples": ["Austin, TX"] },
          "vehicle": {
            "type": "object",
            "required": ["type"],
            "properties": {
              "type": { "type": "string", "enum": ["sedan", "suv", "pickup", "van"], "description": "Body type. Use sedan for coupes, hatchbacks, and wagons." },
              "year": { "type": "integer", "minimum": 1900, "description": "Model year." },
              "make": { "type": "string", "maxLength": 50, "examples": ["Honda"] },
              "model": { "type": "string", "maxLength": 50, "examples": ["Civic"] },
              "operable": { "type": "boolean", "default": true, "description": "Whether the vehicle runs and drives." }
            }
          },
          "transportType": { "type": "string", "enum": ["open", "enclosed"], "default": "open", "description": "Open carrier (standard) or enclosed carrier (extra protection, higher price)." },
          "pickupTiming": { "type": "string", "enum": ["flexible", "exact"], "default": "flexible", "description": "Whether the customer needs pickup on an exact date or is flexible (usually cheaper)." },
          "pickupDate": { "type": "string", "format": "date", "description": "Requested pickup date, YYYY-MM-DD." },
          "contact": {
            "type": "object",
            "required": ["name", "email", "phone"],
            "properties": {
              "name": { "type": "string", "minLength": 1, "maxLength": 100, "description": "Customer's full name." },
              "email": { "type": "string", "format": "email", "description": "Customer's email address." },
              "phone": { "type": "string", "description": "Customer's US phone number. Formatting is ignored; 10 digits are required, and a leading +1 is accepted.", "examples": ["(206) 555-0123"] }
            }
          },
          "militaryMember": { "type": "boolean", "default": false, "description": "Active-duty military or veteran." },
          "notes": { "type": "string", "maxLength": 500, "description": "Anything the specialist should know." },
          "dryRun": { "type": "boolean", "default": false, "description": "When true, validates the request and returns a sample response without creating a quote or contacting anyone." }
        }
      },
      "LeadResponse": {
        "type": "object",
        "required": ["status", "referenceId", "message", "dryRun", "support"],
        "properties": {
          "status": { "type": "string", "enum": ["received"] },
          "referenceId": { "type": "string", "description": "The customer's quote number. TEST-0000 for dry runs.", "examples": ["OAC-4821"] },
          "quoteUrl": { "type": "string", "format": "uri", "description": "The customer's quote page. Omitted for dry runs." },
          "message": { "type": "string", "description": "Confirmation text to show the customer verbatim." },
          "dryRun": { "type": "boolean" },
          "support": {
            "type": "object",
            "properties": { "phone": { "type": "string" }, "email": { "type": "string" } }
          }
        }
      },
      "ValidationError": {
        "type": "object",
        "properties": {
          "error": { "type": "string", "enum": ["validation_error"] },
          "message": { "type": "string" },
          "details": { "type": "array", "items": { "type": "string" } }
        }
      },
      "ApiError": {
        "type": "object",
        "properties": {
          "error": { "type": "string", "enum": ["unsupported_location", "internal_error"] },
          "message": { "type": "string", "description": "Text suitable to show the customer." }
        }
      }
    }
  }
}
