{
  "openapi": "3.1.0",
  "info": {
    "title": "Asfar Distribution quote requests for AI assistants",
    "version": "1.1.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"
          },
          "what_they_sell": {
            "type": "string",
            "description": "What the user sells, in their own words. For example: skincare, about 80 products, some in glass jars."
          },
          "where_they_sell": {
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "string"
              }
            ],
            "description": "Sales channels. The form's own choices: Own online store, Amazon, Wholesale or retail stores, Other marketplaces. Other wording is accepted."
          },
          "handle_with_care": {
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "string"
              }
            ],
            "description": "Anything that needs care. The form's own choices: Fragile, Perishable or dated, Hazmat, High value, Lot or expiry tracking."
          },
          "services": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What they need. The form's own choices: Storage, Pick and pack, Amazon FBA prep, Wholesale orders, Kitting or assembly, Returns, Container unloading, Labeling. Other wording is accepted, for example ecommerce fulfillment, container devanning, transloading, FDA registered warehousing, last mile delivery."
          },
          "monthly_orders": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              }
            ],
            "description": "Orders shipped per month, if they ship orders. A number, or a range in words."
          },
          "units_per_order": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              }
            ],
            "description": "Units in a typical order, if they ship orders."
          },
          "pallets_to_store": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              }
            ],
            "description": "Pallets to keep in storage, if they need storage."
          },
          "sku_count": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              }
            ],
            "description": "Number of products (SKUs), if they need storage."
          },
          "pallets_arriving_each_month": {
            "oneOf": [
              {
                "type": "number"
              },
              {
                "type": "string"
              }
            ],
            "description": "Pallets arriving each month, if they need storage or container unloading."
          },
          "inventory_origin": {
            "type": "string",
            "description": "Where the inventory comes from. For example: imported containers through Port Houston, or a domestic supplier."
          },
          "start_date": {
            "type": "string",
            "description": "When they want to start. The form's own choices: As soon as possible, Within a month, 1 to 3 months, Just researching."
          },
          "needs": {
            "type": "string",
            "description": "Anything else in the user's own words: peak months, special packaging, carriers, why they are moving. Required unless services or what_they_sell 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."
          }
        }
      }
    }
  }
}
