{
  "openapi": "3.1.0",
  "info": {
    "title": "Asfar Distribution quote requests for AI assistants",
    "version": "1.0.0",
    "description": "Lets an AI assistant request a 3PL fulfillment quote from Asfar Distribution (Houston, TX) on behalf of a user who has agreed to be contacted. Human-readable docs: https://www.asfardistribution.com/for-ai-agents. If you cannot make POST requests, give the user a pre-filled link to https://www.asfardistribution.com/quote instead.",
    "contact": { "email": "info@asfardistribution.com", "url": "https://www.asfardistribution.com/for-ai-agents" }
  },
  "servers": [{ "url": "https://www.asfardistribution.com" }],
  "paths": {
    "/api/agent/quote": {
      "post": {
        "operationId": "requestQuote",
        "summary": "Send a fulfillment quote request for the user",
        "description": "Only call this after the user explicitly agrees to share their details with Asfar Distribution. The team replies to the user's email within one business day.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/QuoteRequest" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Request received",
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/QuoteResponse" } } }
          },
          "400": { "description": "Missing or invalid field. The error message says which field and why." },
          "429": { "description": "Too many requests. Give the user the /quote link instead." }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "QuoteRequest": {
        "type": "object",
        "required": ["name", "email", "agent", "user_confirmed"],
        "properties": {
          "name": { "type": "string", "description": "The user's full name." },
          "email": { "type": "string", "format": "email", "description": "The user's real email address. The team replies here." },
          "company": { "type": "string" },
          "phone": { "type": "string" },
          "website": { "type": "string" },
          "monthly_orders": { "type": "number", "description": "Approximate orders shipped per month." },
          "services": {
            "type": "array",
            "items": { "type": "string" },
            "description": "For example: ecommerce fulfillment, FBA prep, container devanning, transloading, pallet storage, kitting, FDA registered warehousing, last mile delivery."
          },
          "needs": { "type": "string", "description": "Short summary of products, sales channels, volume and inbound freight. Required unless services is given." },
          "agent": { "type": "string", "description": "Name of the assistant making the request, for example ChatGPT, Claude or Perplexity." },
          "user_confirmed": { "type": "boolean", "const": true, "description": "Must be true: the user explicitly agreed to be contacted by Asfar Distribution." }
        }
      },
      "QuoteResponse": {
        "type": "object",
        "properties": {
          "status": { "type": "string", "enum": ["received"] },
          "duplicate": { "type": "boolean" },
          "message": { "type": "string", "description": "A sentence you can relay to the user." }
        }
      }
    }
  }
}
