{
  "openapi": "3.1.0",
  "info": {
    "title": "Dalo Auto Recycling - Instant Cash Offer API",
    "description": "Submit a vehicle to receive an instant cash offer for a used, junk, damaged, or non-running car in Northern Virginia. Designed for AI assistants (including Custom GPT Actions) helping a person sell their vehicle.\n\nIMPORTANT: submitting a lead creates a REAL pickup lead and sends the seller's name, phone, and email to Dalo Auto Recycling. Only call this endpoint AFTER the user has provided every required field AND has explicitly consented to be contacted by phone, text, or email.\n\nLEAD-FIRST RULE: Once the user has provided all required fields and explicit consent, ALWAYS call this endpoint to save the lead \u2014 even if no instant offer is ultimately returned, the ZIP is outside the service area, the title status creates eligibility issues, or manual review is required. The lead must still be created and saved.\n\nREFERENCE ID DISPLAY RULE (CRITICAL \u2014 customer-facing only):\n\nEvery successful lead response includes TWO reference fields:\n- `id` \u2014 the FULL internal reference (e.g. \"RUHL1918551114797645834807687207\"). Keep and use this value internally for any follow-up API calls (accept, decline, reschedule, lookup). NEVER truncate `id` before sending it back to the API. NEVER display, paste, or read aloud the full `id` to the seller.\n- `customerReferenceId` \u2014 the short, customer-facing reference (the last 8 characters of `id`, e.g. \"07687207\"). This is the ONLY reference value that may be shown to the seller.\n\nWhen displaying the reference number to the seller in chat, always use `customerReferenceId` and format it as: \"Reference Number: {customerReferenceId}\".\n\nIf `customerReferenceId` is missing from the response (older deployments), derive it locally as `id.slice(-8)` and display that. Do NOT display the full `id` as a fallback. If `id` is shorter than 8 characters, display the full value.\n\nExamples:\n- API returns id=\"RUHL1918551114797645834807687207\", customerReferenceId=\"07687207\" \u2192 say \"Reference Number: 07687207\"\n- API returns id=\"MZXG3603366320238865919207001801\", customerReferenceId=\"07001801\" \u2192 say \"Reference Number: 07001801\"\n\nCONVERSATION STYLE RULES (Custom GPT / AI assistant behavior):\n\n- Ask EXACTLY ONE question at a time. Never ask two questions in a single message.\n- Never present a checklist, bullet list of fields, or multiple question groups together.\n- Behave like a text-message conversation, not a web form.\n- Wait for the seller's reply before asking the next question.\n- Whenever the answer is a fixed set of options, offer them as A) B) C) D) and let the seller reply with a single letter. Silently map the letter to the API value using the A/B/C/D MAPPING TABLES below \u2014 NEVER send the raw letter to the API.\n- Keep messages short and friendly.\n\nVEHICLE IDENTITY RULES (STRICT):\n\nDalo's public quote flow only asks for: year, make, model.\nThe assistant MUST NEVER ask the seller for: VIN, trim, submodel, modelId, engine size, body style, sedan/hatchback/coupe, 2-door vs 4-door, or any internal registration/matching wording.\n\nMODELID RULE (CRITICAL FOR OFFER MATCHING):\n\n`vehicle.modelId` is REQUIRED. Without a real modelId the matcher rejects every bid and `offerAmount` is always 0.\n- Always obtain modelId from `GET /vehicle/models?year={year}&make={make}` \u2014 find the option whose `value` (or `label`) matches the seller's model and use that option's `id` as `vehicle.modelId`.\n- NEVER invent a modelId. NEVER use placeholder values like \"12345\". NEVER ask the seller for modelId, trim, body style, VIN, submodel, engine size, or registration model wording.\n- Recommended lookup sequence before submitting: `GET /vehicle/years` \u2192 ask year \u2192 `GET /vehicle/makes?year={year}` \u2192 ask make \u2192 `GET /vehicle/models?year={year}&make={make}` \u2192 ask model \u2192 capture id silently.\n\nQUESTION ORDER (ask one at a time, in this order):\n\n1. year (validate against /vehicle/years)\n2. make (validate against /vehicle/makes)\n3. model (validate against /vehicle/models, capture id as modelId silently)\n4. ZIP code\n5. mileage\n6. title status\n7. drivability\n8. issue type \u2014 branches by drivability (see WONT-START RULE)\n9. missing parts\n10. catalytic converter status\n11. exterior damage\n12. airbags\n13. name\n14. phone\n15. email\n16. consent (explicit yes to be contacted by phone, text, or email)\n17. final confirmation\n18. call submitLead\n\nMILEAGE QUESTION RULE (CRITICAL \u2014 must mirror the website's mileage field exactly):\n\nAsk EXACTLY: \"What is the current mileage on the odometer?\n\nIf the odometer is not working or inaccurate, reply A.\n\nA) My odometer is not working or inaccurate.\"\n\nRules:\n- If the seller enters a number (exact or approximate, e.g. \"22000\", \"220,000\", \"about 180000\", \"~150k\"): strip commas/spaces/units, set `mileage.value` to that number as a string of digits, and set `mileage.odometerNotWorking = false`.\n- If the seller replies \"A\" (or explicitly says the odometer is not working or inaccurate): set `mileage.odometerNotWorking = true` and do NOT require `mileage.value` (omit it or leave it empty).\n- Do NOT offer \"I don't know\" as a separate option. Do NOT ask \"A) I don't know\".\n- Do NOT treat uncertainty (\"I'm not sure\", \"I don't remember\", \"approximately\") as `odometerNotWorking`. Instead reply: \"No problem \u2014 what's your best estimate?\" and accept the estimate as `mileage.value` with `odometerNotWorking = false`.\n- NEVER default to `odometerNotWorking = true`. Only set it when the seller replies \"A\" or explicitly states the odometer is not working or inaccurate.\n- Before calling submitLead: if `mileage.value` is empty AND `mileage.odometerNotWorking` is not true, ask the mileage question again. Do NOT silently switch to `odometerNotWorking = true`.\n\nWONT-START BRANCH RULE (CRITICAL):\n\nIf `drivability.condition = \"wont-start\"`:\n- Use `otherReason`, NOT `issues`.\n- Ask the seller the main no-start reason and map: no keys \u2192 \"no-keys\", dead battery \u2192 \"dead-battery\", engine issue \u2192 \"engine-issue\", missing parts \u2192 \"missing-parts\".\n- For wont-start + engine issue, send: `\"otherReason\": [\"engine-issue\"]` AND `\"issues\": []`.\n- DO NOT send `\"issues\": [\"engine\"]` for wont-start vehicles \u2014 this produces the wrong primaryIssueType and breaks bid matching.\n\nIf `drivability.condition = \"starts-issues\"`: use `issues` (multi-select of engine/transmission/safety/other) and leave `otherReason` empty.\nIf `drivability.condition = \"no-issues\"`: leave both `issues` and `otherReason` empty.\n\nA/B/C/D MAPPING TABLES (silently translate letter \u2192 API value; never send the letter):\n\nTitle (title.status): A=clean, B=rebuilt, C=salvage, D=none\nDrivability (drivability.condition): A=no-issues, B=starts-issues, C=wont-start\nIssue when starts-issues (issues[]): A=engine, B=transmission, C=safety, D=other\nNo-start reason when wont-start (otherReason[]): A=engine-issue, B=dead-battery, C=no-keys, D=missing-parts\nMissing parts (missingParts): A=nothing-missing, B=some-removed\nCatalytic converter (catStatus): A=original, B=replaced-aftermarket, C=missing, D=not-sure\nExterior damage (exteriorDamage): A=no, B=yes\nAirbags (airbagsDeployedYesNo): A=no, B=yes\nConsent (contact.consent): A=true, B=false\n\nDERIVED IDENTIFIER ENCODING (REQUIRED \u2014 compute identically to the website; missing/wrong identifiers force offerAmount=0):\n\nidentifiers.titleStatus: clean=0, rebuilt=1, salvage=2, none=3\nidentifiers.drivabilityCondition: starts-issues=0, wont-start=1, no-issues=2\nidentifiers.primaryIssueType:\n  - if drivability=\"starts-issues\": engine=0, transmission=1, safety=2, other=3 (use the first/primary issue)\n  - if drivability=\"wont-start\": otherReason includes engine-issue=0, dead-battery=1, no-keys=2, otherwise=3\n  - if drivability=\"no-issues\": 4\nidentifiers.hasMissingParts: some-removed=1, nothing-missing=0\nidentifiers.missingEngine: missingCategories.engine===\"yes\" ? 1 : 0\nidentifiers.missingTransmission: missingCategories.transmission===\"yes\" ? 1 : 0\nidentifiers.missingWheels: missingCategories.wheels===\"yes\" ? 1 : 0\nidentifiers.catStatus: original=0, replaced-aftermarket=1, missing=2, not-sure=3\nidentifiers.hasExteriorDamage: yes=1, no=0\nidentifiers.hasDeployedAirbags: yes=1, no=0\n\nAI ASSISTANT RESPONSE RULES (based on the response payload):\n\n1) POSITIVE OFFER \u2014 when `offerAmount > 0`:\n   - Show the exact `offerAmount` returned by the API (do not round, invent, or modify it).\n   - State that free towing is included.\n   - Explain that the amount came directly from Dalo's quote engine.\n   - Ask: \"Would you like to schedule your pickup?\"\n\n2) NO INSTANT OFFER \u2014 when `offerAmount <= 0` AND `rejectedDueToZipCode = false`:\n   - Say: \"Dalo was unable to generate an instant offer with the information provided.\"\n   - Explain that the lead was successfully saved.\n   - Explain that Dalo may contact the seller for additional information.\n   - Explain that the seller may also contact Dalo and reference the lead `id` returned by the API.\n   - Do NOT promise an offer. Do NOT invent an offer amount.\n   - If additional information is needed later, Dalo may request the VIN.\n\n3) OUTSIDE SERVICE AREA \u2014 when `rejectedDueToZipCode = true`:\n   - Say: \"Thank you for your interest in selling your vehicle. Unfortunately, your location is outside Dalo's current service area.\"\n   - Explain that the lead was still saved.\n   - Explain that Dalo may expand service coverage in the future.\n   - Do NOT promise service. Do NOT promise pickup.\n\n4) VIRGINIA NO-TITLE RULE \u2014 when the vehicle has no title AND is newer than 10 years old:\n   - Explain: \"Virginia law does not allow Dalo Auto Recycling to purchase a vehicle newer than 10 years old without a title.\"\n   - Exactly 10 years old is allowed. Older than 10 years old is allowed. Only newer than 10 years old is restricted.\n   - If the API still creates a lead, save the lead but do not promise an offer or eligibility.\n\n5) VIN HANDLING:\n   - VIN is NOT required by default.\n   - Do not request a VIN unless offer-flow.json or a future API update requires it.\n   - If no instant offer is available, you may explain that Dalo may later request the VIN for additional review.\n\n6) SCHEDULING:\n   - Only after a positive offer, ask: \"Would you like to schedule your pickup?\"\n   - Only collect pickup address information if the seller wants to schedule.\n   - If a scheduling link is returned, use the scheduling link.\n   - If no scheduling link is returned, explain that Dalo may contact the seller by phone, text, or email to schedule pickup.\n\n7) CONTACT INFORMATION (collect one at a time, BEFORE calling submitLead):\n   - name\n   - phoneNumber\n   - email\n   - consent (must be explicit and true)\n\nSee https://www.daloautorecycling.com/offer-flow.json for the full machine-readable question flow and the derived `identifiers` block the matcher requires.\n\nSCHEDULING WORKFLOW (use the existing dispatcher + lead endpoints; do NOT invent values):\n\nEligibility:\n- Only attempt scheduling when offerAmount > 0 AND the seller explicitly opts in. Never schedule with offerAmount <= 0 or rejectedDueToZipCode=true.\n- If a fresh GET /customer/lead/{accessToken} returns actions.canSchedule=false (or canReschedule=false on a reschedule), do not call /schedule \u2014 tell the seller Dalo will be in touch.\n\nStep 0 \u2014 After a positive offer, ask EXACTLY one question (A/B):\n\"Would you like to schedule your pickup?\n\nA) Yes\nB) No\"\nB \u2192 do not schedule. Tell the seller the offer was saved and Dalo may contact them. Display only customerReferenceId.\nA \u2192 continue.\n\nStep 1 \u2014 Accept the offer:\nPOST /customer/lead/{accessToken}/accept  body: {\"acceptedAmount\": <offerAmount from submitLead response>}.\n\nStep 2 \u2014 Collect pickup address (REUSE quote data; do NOT re-ask known fields):\n  - city, state, and zipCode were already collected during the quote flow. Reuse them silently for address.city, address.state, and address.zipCode. Do NOT ask for them again.\n  - Ask EXACTLY ONE question: \"What is the pickup street address?\" \u2192 address.street\n  - Only ask for city, state, or ZIP if that value is genuinely missing from the prior quote conversation.\n\nStep 3 \u2014 Save the address:\nPUT /customer/lead/{accessToken}/address  body: {street, city, state, zipCode}.\n\nStep 4 \u2014 Match the address to a dispatcher trip:\nPOST /dispatcher/match-address  body: {address, city, state, zipCode, leadId: <full id from submitLead>, yardId: 1}.\nCapture response.pickupId. If response.requiresTimePreferences is true, skip to Step 7 (soft-schedule via preferences).\n\nStep 5 \u2014 Show available dates (friendly labels only):\nGET /dispatcher/trucks/available-dates?yardId=1&zipCode={zipCode}.\nThe response is an object keyed by YYYY-MM-DD. Take the keys whose value array is non-empty, sort ascending, and present the first 3-4 to the seller as A/B/C/D with friendly labels \u2014 e.g. \"A) Sunday, May 31\", \"B) Monday, June 1\". Do NOT show the YYYY-MM-DD value to the seller. Silently remember the YYYY-MM-DD behind each letter for the API call.\nExample message:\n\"I found these available pickup dates. Which one works best?\n\nA) Sunday, May 31\nB) Monday, June 1\nC) Tuesday, June 2\nD) Wednesday, June 3\n\nReply with A, B, C, or D.\"\nIf the response has zero usable dates, jump to Step 7.\n\nStep 6 \u2014 Show available time slots for the selected date (friendly windows only):\nGET /dispatcher/trucks/available-timeslots?date={YYYY-MM-DD}&yardId=1&zipCode={zipCode}&leadId={full id}&address={street}&city={city}&state={state}.\nShow ONLY the slots returned by response.timeSlots \u2014 never invent or add a window the API did not return. Present each returned slot as A/B/C/D using friendly windows when the label maps cleanly:\n  - Morning \u2192 \"Morning (8 AM \u2013 12 PM)\"\n  - Afternoon \u2192 \"Afternoon (12 PM \u2013 4 PM)\"\n  - Evening \u2192 \"Evening (4 PM \u2013 8 PM)\"\nOtherwise use the slot's human label as-is. Silently remember the slot id behind each letter.\nExample message (only include the letters the API actually returned):\n\"I found these pickup windows for Monday, June 1.\n\nA) Morning (8 AM \u2013 12 PM)\nB) Afternoon (12 PM \u2013 4 PM)\nC) Evening (4 PM \u2013 8 PM)\n\nReply with A, B, or C.\"\nNEVER invent or guess slot ids. If response.timeSlots is empty, jump to Step 7.\n\nStep 7 \u2014 Hard schedule (preferred) OR soft schedule (fallback):\n  Hard schedule: POST /customer/lead/{accessToken}/schedule with:\n    {\n      \"scheduledDay\": \"<YYYY-MM-DD chosen in Step 5>\",\n      \"scheduledTimeSlot\": \"<id from response.timeSlots in Step 6>\",\n      \"scheduledTimeLabel\": \"<label from response.timeSlots in Step 6>\",\n      \"address\": {\"street\":\"...\",\"city\":\"...\",\"state\":\"VA\",\"zipCode\":\"22554\"}\n    }\n  Soft schedule (only when requiresTimePreferences=true OR dates/slots empty):\n    NEVER ask the seller to type a date or YYYY-MM-DD. ALWAYS present simple A/B/C/D choices.\n\n    First, ask the date preference EXACTLY:\n    \"What day works best for pickup?\n\n    A) Today\n    B) Tomorrow\n    C) Next available weekday\n    D) Flexible\n\n    Reply with A, B, C, or D.\"\n\n    Silently map the letter to preferredDates (compute dates in YYYY-MM-DD using today's date in America/New_York):\n    - A \u2192 preferredDates = [today]\n    - B \u2192 preferredDates = [tomorrow]\n    - C \u2192 preferredDates = [next weekday: if today is Mon\u2013Thu use tomorrow; if Fri/Sat/Sun use the upcoming Monday]\n    - D \u2192 preferredDates = [] (flexible \u2014 no specific date)\n\n    Then ask the time window EXACTLY:\n    \"What time window works best?\n\n    A) Morning (8 AM \u2013 12 PM)\n    B) Afternoon (12 PM \u2013 4 PM)\n    C) Evening (4 PM \u2013 8 PM)\n    D) Flexible\n\n    Reply with A, B, C, or D.\"\n\n    Silently map the letter to preferredTimeSlots:\n    - A \u2192 [\"Morning\"]\n    - B \u2192 [\"Afternoon\"]\n    - C \u2192 [\"Evening\"]\n    - D \u2192 [\"Morning\",\"Afternoon\",\"Evening\"] (flexible \u2014 any window)\n\n    Then submit:\n    POST /dispatcher/submit-time-preferences with {pickupId, preferredDates, preferredTimeSlots, source:\"gpt\"}.\n\n    After the call succeeds, tell the seller EXACTLY:\n    \"Thanks. I saved your preferred pickup time.\n\n    Dalo Auto Recycling will confirm the appointment before sending a driver.\n\n    Free towing is included.\"\n    Do NOT say the pickup is confirmed. Do NOT imply a driver has been assigned. Do NOT show the YYYY-MM-DD values to the seller.\n\nStep 8 \u2014 Confirm to the seller (hard schedule only) \u2014 use friendly language:\nFormat scheduledDay as \"Weekday, Month D\" (e.g. \"Monday, June 1\"). Convert scheduledTimeLabel to the friendly window when it maps (Morning \u2192 \"Morning window (8 AM \u2013 12 PM)\", Afternoon \u2192 \"Afternoon window (12 PM \u2013 4 PM)\", Evening \u2192 \"Evening window (4 PM \u2013 8 PM)\"); otherwise use the label as returned.\nSay EXACTLY:\n\"You're scheduled for {friendly date} during the {friendly window}.\n\nFree towing is included.\n\nReference Number: {customerReferenceId}.\"\n\nSCHEDULE FIELD RULES (STRICT):\n- scheduledDay MUST be a YYYY-MM-DD date string (no time, no timezone).\n- scheduledTimeSlot MUST be the id returned by GET /dispatcher/trucks/available-timeslots. Never invent, guess, or translate (e.g. do not send \"Morning\" or \"AM\" as scheduledTimeSlot \u2014 that goes in scheduledTimeLabel or in preferredTimeSlots for the soft path).\n- Never call /schedule without a full address (street, city, state, zipCode).\n- Never call /schedule before /accept has returned successfully.\n- accessToken is internal \u2014 never display, paste, or read it aloud to the seller. Same rule already applies to the full id (display only customerReferenceId).\n\nRESCHEDULE: there is no separate reschedule endpoint. If the lead's actions.canReschedule is true, repeat Steps 5\u20137 (or just Steps 6\u20137 if the seller keeps the same date) and POST to the same /customer/lead/{accessToken}/schedule with the new values. If the seller wants to cancel an existing pickup first, POST /customer/lead/{accessToken}/cancel-pickup, then re-run the scheduling flow.\n\nCONFIRM-PICKUP: when GET /customer/lead/{accessToken} returns canConfirmPickup=true (driver assigned and awaiting customer confirmation), POST /customer/lead/{accessToken}/confirm-pickup to finalize.\n\nFAILURE MESSAGE: if any step in 4\u20137 returns an error or no usable options, tell the seller exactly: \"I could not find an available pickup slot through the API. Your offer is saved and Dalo may contact you to arrange pickup.\" Do not retry blindly.\n",
    "version": "1.2.0",
    "contact": {
      "name": "Dalo Auto Recycling",
      "url": "https://www.daloautorecycling.com",
      "email": "info@daloautorecycling.com"
    },
    "license": {
      "name": "Proprietary"
    }
  },
  "servers": [
    {
      "url": "https://revolt.company/api",
      "description": "Production API"
    }
  ],
  "externalDocs": {
    "description": "Human + AI documentation",
    "url": "https://www.daloautorecycling.com/ai-resources"
  },
  "paths": {
    "/vehicle/years": {
      "get": {
        "operationId": "listVehicleYears",
        "summary": "List valid vehicle years",
        "description": "Returns the list of years the matcher accepts. Call this first when collecting the vehicle. Use the returned `value` as `vehicle.year`.",
        "tags": [
          "Vehicle Lookup"
        ],
        "responses": {
          "200": {
            "description": "Array of year options.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LookupOptionList"
                }
              }
            }
          }
        }
      }
    },
    "/vehicle/makes": {
      "get": {
        "operationId": "listVehicleMakes",
        "summary": "List makes for a given year",
        "description": "Returns the makes available for the chosen year. Use the returned `value` as `vehicle.make`.",
        "tags": [
          "Vehicle Lookup"
        ],
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{4}$"
            },
            "description": "4-digit year from /vehicle/years."
          }
        ],
        "responses": {
          "200": {
            "description": "Array of make options.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LookupOptionList"
                }
              }
            }
          }
        }
      }
    },
    "/vehicle/models": {
      "get": {
        "operationId": "listVehicleModels",
        "summary": "List models for a given year and make (and capture modelId)",
        "description": "Returns model options for the selected year and make. Use the returned id as vehicle.modelId. Never invent modelId or ask the seller for trim, VIN, body style, or internal identifiers.",
        "tags": [
          "Vehicle Lookup"
        ],
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{4}$"
            }
          },
          {
            "name": "make",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Exact make string returned by /vehicle/makes."
          }
        ],
        "responses": {
          "200": {
            "description": "Array of model options. Each item includes the `id` required as vehicle.modelId.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelOptionList"
                }
              }
            }
          }
        }
      }
    },
    "/customer/lead": {
      "post": {
        "operationId": "submitLead",
        "summary": "Submit a vehicle and receive an instant cash offer",
        "description": "Creates a Dalo Auto Recycling lead and returns an instant offer when available. Collect all required fields and user consent before calling. See offer-flow.json for the complete question flow and identifier mapping rules.",
        "tags": [
          "Lead"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeadRequest"
              },
              "examples": {
                "runningCleanTitle": {
                  "summary": "Running car, clean title, full contact info",
                  "value": {
                    "vehicle": {
                      "year": "2010",
                      "make": "Toyota",
                      "model": "Camry",
                      "modelId": "<model id returned by /vehicle/models>"
                    },
                    "location": {
                      "zip": "22554",
                      "city": "Stafford",
                      "state": "VA",
                      "display": "Stafford, VA",
                      "valid": true
                    },
                    "mileage": {
                      "value": "165000",
                      "odometerNotWorking": false,
                      "valid": true
                    },
                    "title": {
                      "status": "clean",
                      "valid": true
                    },
                    "drivability": {
                      "condition": "no-issues",
                      "valid": true
                    },
                    "issues": [],
                    "otherReason": [],
                    "missingParts": "nothing-missing",
                    "catStatus": "original",
                    "exteriorDamage": "no",
                    "airbagsDeployedYesNo": "no",
                    "airbagsDeployed": [],
                    "contact": {
                      "name": "Jane Doe",
                      "phoneNumber": "+15555550123",
                      "email": "jane@example.com",
                      "consent": true
                    },
                    "identifiers": {
                      "titleStatus": 0,
                      "drivabilityCondition": 2,
                      "primaryIssueType": 4,
                      "hasMissingParts": 0,
                      "missingEngine": 0,
                      "missingTransmission": 0,
                      "missingWheels": 0,
                      "catStatus": 0,
                      "hasExteriorDamage": 0,
                      "hasDeployedAirbags": 0
                    },
                    "yardId": 1
                  }
                },
                "wontStartEngineCleanTitle": {
                  "summary": "Won't start, engine issue, clean title \u2014 uses otherReason (NOT issues)",
                  "value": {
                    "vehicle": {
                      "year": "2005",
                      "make": "Toyota",
                      "model": "Camry",
                      "modelId": "<model id returned by /vehicle/models>"
                    },
                    "location": {
                      "zip": "22554",
                      "city": "Stafford",
                      "state": "VA",
                      "display": "Stafford, VA",
                      "valid": true
                    },
                    "mileage": {
                      "value": "22000",
                      "odometerNotWorking": false,
                      "valid": true
                    },
                    "title": {
                      "status": "clean",
                      "valid": true
                    },
                    "drivability": {
                      "condition": "wont-start",
                      "valid": true
                    },
                    "issues": [],
                    "otherReason": [
                      "engine-issue"
                    ],
                    "missingParts": "nothing-missing",
                    "catStatus": "original",
                    "exteriorDamage": "no",
                    "airbagsDeployedYesNo": "no",
                    "airbagsDeployed": [],
                    "contact": {
                      "name": "Test AI Manifest",
                      "phoneNumber": "+15555550199",
                      "email": "test-ai@example.com",
                      "consent": true
                    },
                    "identifiers": {
                      "titleStatus": 0,
                      "drivabilityCondition": 1,
                      "primaryIssueType": 0,
                      "hasMissingParts": 0,
                      "missingEngine": 0,
                      "missingTransmission": 0,
                      "missingWheels": 0,
                      "catStatus": 0,
                      "hasExteriorDamage": 0,
                      "hasDeployedAirbags": 0
                    },
                    "yardId": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Lead created. Inspect `offerAmount` to determine the outcome.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadResponse"
                },
                "examples": {
                  "hasOffer": {
                    "summary": "Positive instant offer \u2014 lead saved, offer returned, free towing included",
                    "value": {
                      "id": "lead_01HXYZ",
                      "customerReferenceId": "d_01HXYZ",
                      "accessToken": "tok_abc123",
                      "offerAmount": 425,
                      "hasOffer": true,
                      "offerMessage": "We'll pay $425 for your 2010 Toyota Camry, with free towing included.",
                      "year": "2010",
                      "make": "Toyota",
                      "model": "Camry"
                    }
                  },
                  "noOffer": {
                    "summary": "No instant offer \u2014 lead still saved, Dalo may follow up",
                    "value": {
                      "id": "lead_01HXYZ",
                      "customerReferenceId": "d_01HXYZ",
                      "accessToken": "tok_abc123",
                      "offerAmount": 0,
                      "hasOffer": false,
                      "noOfferReasons": [
                        "NO_MATCHING_BID"
                      ],
                      "rejectedDueToZipCode": false,
                      "offerMessage": "Lead saved. Dalo Auto Recycling may contact the seller for additional information; the seller may also contact Dalo and reference the customerReferenceId returned in this response (e.g. 'Reference Number: 07687207')."
                    }
                  },
                  "outsideServiceArea": {
                    "summary": "ZIP outside service area \u2014 lead still saved, no pickup promised",
                    "value": {
                      "id": "lead_01HXYZ",
                      "customerReferenceId": "d_01HXYZ",
                      "accessToken": "tok_abc123",
                      "offerAmount": 0,
                      "hasOffer": false,
                      "rejectedDueToZipCode": true,
                      "noOfferReasons": [
                        "OUTSIDE_SERVICE_AREA"
                      ],
                      "offerMessage": "Lead saved. Location is outside Dalo's current service area; no pickup can be promised at this time."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error (missing required field, invalid phone/email, invalid ZIP).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "The vehicle cannot be purchased (e.g. no-title + age < 10 years per Virginia law).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/customer/lead/{accessToken}": {
      "get": {
        "operationId": "getLead",
        "summary": "Look up a lead by accessToken",
        "description": "Returns current lead state: offer, scheduling fields (scheduledDay, scheduledTimeSlot, preferredDates), pickupStatus, and actions (canAccept/canDecline/canSchedule/canReschedule/canUpdateAddress) that gate the next allowed call.",
        "tags": [
          "Scheduling"
        ],
        "parameters": [
          {
            "name": "accessToken",
            "in": "path",
            "required": true,
            "description": "Lead accessToken returned by submitLead. Internal \u2014 never show to the seller.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lead state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadDetail"
                }
              }
            }
          },
          "404": {
            "description": "Lead not found or invalid accessToken",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/customer/lead/{accessToken}/accept": {
      "post": {
        "operationId": "acceptOffer",
        "summary": "Accept the instant offer for a lead",
        "description": "Accept the offer for the lead identified by accessToken. Send the same offerAmount returned by submitLead as acceptedAmount. Only call after the seller has explicitly opted in to schedule a pickup, and only when offerAmount > 0.",
        "tags": [
          "Scheduling"
        ],
        "parameters": [
          {
            "name": "accessToken",
            "in": "path",
            "required": true,
            "description": "Lead accessToken returned by submitLead. Internal \u2014 never show to the seller.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcceptRequest"
              },
              "examples": {
                "accept": {
                  "summary": "Accept offer",
                  "value": {
                    "acceptedAmount": 352
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Offer accepted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadDetail"
                }
              }
            }
          },
          "404": {
            "description": "Lead not found or invalid accessToken",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/customer/lead/{accessToken}/decline": {
      "post": {
        "operationId": "declineOffer",
        "summary": "Decline the instant offer for a lead",
        "description": "Decline the offer. Optionally include a free-text reason from the seller. The lead remains saved.",
        "tags": [
          "Scheduling"
        ],
        "parameters": [
          {
            "name": "accessToken",
            "in": "path",
            "required": true,
            "description": "Lead accessToken returned by submitLead. Internal \u2014 never show to the seller.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeclineRequest"
              },
              "examples": {
                "decline": {
                  "summary": "Decline with reason",
                  "value": {
                    "reason": "Customer declined"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Offer declined",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadDetail"
                }
              }
            }
          },
          "404": {
            "description": "Lead not found or invalid accessToken",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/customer/lead/{accessToken}/address": {
      "put": {
        "operationId": "updateLeadAddress",
        "summary": "Update the pickup address for a lead",
        "description": "Saves the pickup address on the lead. Must be called before /dispatcher/match-address and before /customer/lead/{accessToken}/schedule. All four address fields are required.",
        "tags": [
          "Scheduling"
        ],
        "parameters": [
          {
            "name": "accessToken",
            "in": "path",
            "required": true,
            "description": "Lead accessToken returned by submitLead. Internal \u2014 never show to the seller.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddressRequest"
              },
              "examples": {
                "address": {
                  "summary": "Stafford VA address",
                  "value": {
                    "street": "123 Main St",
                    "city": "Stafford",
                    "state": "VA",
                    "zipCode": "22554"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Address saved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadDetail"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Lead not found or invalid accessToken",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/dispatcher/match-address": {
      "post": {
        "operationId": "matchAddressToDispatcher",
        "summary": "Match a pickup address to a dispatcher trip",
        "description": "Locates a truck for the lead. Returns pickupId (required for /dispatcher/submit-time-preferences fallback) and requiresTimePreferences (true when no fixed slot is available). Always call after PUT /customer/lead/{accessToken}/address.",
        "tags": [
          "Scheduling"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MatchAddressRequest"
              },
              "examples": {
                "match": {
                  "summary": "Match address",
                  "value": {
                    "address": "123 Main St",
                    "city": "Stafford",
                    "state": "VA",
                    "zipCode": "22554",
                    "leadId": "lead_01HXYZ",
                    "yardId": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Match result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MatchAddressResponse"
                }
              }
            }
          }
        }
      }
    },
    "/dispatcher/trucks/available-dates": {
      "get": {
        "operationId": "listAvailableDates",
        "summary": "List dates that currently have any pickup availability",
        "description": "Returns an object whose keys are dates in YYYY-MM-DD format and whose values are arrays describing the available slots on that date. Filter to keys whose array is non-empty, sort ascending, then present the first few to the seller. Always pass yardId=1 for Dalo and the seller's zipCode.",
        "tags": [
          "Scheduling"
        ],
        "parameters": [
          {
            "name": "yardId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "default": 1
            },
            "description": "Always 1 for Dalo Auto Recycling."
          },
          {
            "name": "zipCode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{5}$"
            },
            "description": "Seller's pickup ZIP code."
          }
        ],
        "responses": {
          "200": {
            "description": "Map of YYYY-MM-DD \u2192 slot summary array",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AvailableDatesResponse"
                }
              }
            }
          }
        }
      }
    },
    "/dispatcher/trucks/available-timeslots": {
      "get": {
        "operationId": "listAvailableTimeSlots",
        "summary": "List bookable time slots for a specific date",
        "description": "Returns timeSlots[] for the given date. Each slot's id is the ONLY valid value to send as scheduledTimeSlot in POST /customer/lead/{accessToken}/schedule. Each slot's label is the value to send as scheduledTimeLabel. Never invent or modify these values.",
        "tags": [
          "Scheduling"
        ],
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            },
            "description": "YYYY-MM-DD chosen by the seller (must be one of the keys returned by /dispatcher/trucks/available-dates)."
          },
          {
            "name": "yardId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "default": 1
            }
          },
          {
            "name": "zipCode",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{5}$"
            }
          },
          {
            "name": "leadId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Full lead id returned by submitLead."
          },
          {
            "name": "address",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "city",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Time slot list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AvailableTimeSlotsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/customer/lead/{accessToken}/schedule": {
      "post": {
        "operationId": "scheduleLeadPickup",
        "summary": "Book (or rebook) a pickup slot for an accepted lead",
        "description": "Hard-schedule the pickup. Used for initial scheduling AND rescheduling (no separate reschedule endpoint \u2014 call again when actions.canReschedule=true). scheduledTimeSlot must be an id from /dispatcher/trucks/available-timeslots; scheduledDay must be YYYY-MM-DD.",
        "tags": [
          "Scheduling"
        ],
        "parameters": [
          {
            "name": "accessToken",
            "in": "path",
            "required": true,
            "description": "Lead accessToken returned by submitLead. Internal \u2014 never show to the seller.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScheduleRequest"
              },
              "examples": {
                "schedule": {
                  "summary": "Book morning pickup",
                  "value": {
                    "scheduledDay": "2026-06-15",
                    "scheduledTimeSlot": "slot-id-from-available-timeslots",
                    "scheduledTimeLabel": "Morning (8 AM \u2013 12 PM)",
                    "scheduledDate": "2026-06-15T08:00:00Z",
                    "address": {
                      "street": "123 Main St",
                      "city": "Stafford",
                      "state": "VA",
                      "zipCode": "22554"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Pickup scheduled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadDetail"
                }
              }
            }
          },
          "400": {
            "description": "Validation error (missing required field, bad slot id, missing address)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Lead not found or invalid accessToken",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/dispatcher/submit-time-preferences": {
      "post": {
        "operationId": "submitTimePreferences",
        "summary": "Submit soft pickup preferences (used when no fixed slot is available)",
        "description": "Use only when match-address returned requiresTimePreferences=true, or available-dates/timeslots came back empty. Sends preferred dates (YYYY-MM-DD) and time windows. Dispatcher assigns a driver; later canConfirmPickup becomes true.",
        "tags": [
          "Scheduling"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TimePreferencesRequest"
              },
              "examples": {
                "prefs": {
                  "summary": "Two preferred days, morning",
                  "value": {
                    "pickupId": "pickup-id-from-match-address",
                    "preferredDates": [
                      "2026-06-15",
                      "2026-06-16"
                    ],
                    "preferredTimeSlots": [
                      "Morning"
                    ],
                    "source": "gpt"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Preferences saved",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimePreferencesResponse"
                }
              }
            }
          }
        }
      }
    },
    "/customer/lead/{accessToken}/cancel-pickup": {
      "post": {
        "operationId": "cancelLeadPickup",
        "summary": "Cancel a scheduled pickup (offer remains valid)",
        "description": "Cancels the currently scheduled pickup for this lead. The accepted offer remains valid \u2014 the seller can re-run the scheduling flow afterward.",
        "tags": [
          "Scheduling"
        ],
        "parameters": [
          {
            "name": "accessToken",
            "in": "path",
            "required": true,
            "description": "Lead accessToken returned by submitLead. Internal \u2014 never show to the seller.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pickup cancelled",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadDetail"
                }
              }
            }
          },
          "404": {
            "description": "Lead not found or invalid accessToken",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/customer/lead/{accessToken}/confirm-pickup": {
      "post": {
        "operationId": "confirmLeadPickup",
        "summary": "Customer confirms an assigned pickup",
        "description": "Call when GET /customer/lead/{accessToken} returns canConfirmPickup=true (dispatcher has assigned a driver and is awaiting customer confirmation).",
        "tags": [
          "Scheduling"
        ],
        "parameters": [
          {
            "name": "accessToken",
            "in": "path",
            "required": true,
            "description": "Lead accessToken returned by submitLead. Internal \u2014 never show to the seller.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pickup confirmed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadDetail"
                }
              }
            }
          },
          "404": {
            "description": "Lead not found or invalid accessToken",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "LookupOption": {
        "type": "object",
        "required": [
          "label",
          "value"
        ],
        "properties": {
          "label": {
            "type": "string",
            "description": "Human-readable label to show the seller."
          },
          "value": {
            "type": "string",
            "description": "Canonical value to send back to the API (e.g. as vehicle.year or vehicle.make)."
          }
        }
      },
      "LookupOptionList": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/LookupOption"
        }
      },
      "ModelOption": {
        "type": "object",
        "required": [
          "label",
          "value",
          "id"
        ],
        "properties": {
          "label": {
            "type": "string"
          },
          "value": {
            "type": "string",
            "description": "Use as vehicle.model."
          },
          "id": {
            "type": "string",
            "description": "REQUIRED \u2014 use as vehicle.modelId. Without this id the matcher cannot bind a bid and offerAmount will be 0."
          },
          "bodyTypeId": {
            "type": "integer"
          },
          "doorCount": {
            "type": "integer"
          }
        }
      },
      "ModelOptionList": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/ModelOption"
        }
      },
      "LeadRequest": {
        "type": "object",
        "required": [
          "vehicle",
          "location",
          "mileage",
          "title",
          "drivability",
          "contact",
          "identifiers",
          "yardId"
        ],
        "properties": {
          "vehicle": {
            "type": "object",
            "required": [
              "year",
              "make",
              "model",
              "modelId"
            ],
            "properties": {
              "year": {
                "type": "string",
                "description": "4-digit year from /vehicle/years"
              },
              "make": {
                "type": "string",
                "description": "Exact make string from /vehicle/makes"
              },
              "model": {
                "type": "string",
                "description": "Exact model string from /vehicle/models"
              },
              "modelId": {
                "type": "string",
                "description": "id from the chosen model option. REQUIRED for matching."
              }
            }
          },
          "location": {
            "type": "object",
            "required": [
              "zip"
            ],
            "properties": {
              "zip": {
                "type": "string",
                "pattern": "^[0-9]{5}$"
              },
              "city": {
                "type": "string"
              },
              "state": {
                "type": "string"
              },
              "display": {
                "type": "string"
              },
              "valid": {
                "type": "boolean",
                "default": true
              }
            }
          },
          "mileage": {
            "type": "object",
            "properties": {
              "value": {
                "type": "string",
                "description": "Numeric mileage as a string. Omit when odometer is broken."
              },
              "odometerNotWorking": {
                "type": "boolean",
                "default": false
              },
              "valid": {
                "type": "boolean",
                "default": true
              }
            }
          },
          "title": {
            "type": "object",
            "required": [
              "status"
            ],
            "properties": {
              "status": {
                "type": "string",
                "enum": [
                  "clean",
                  "rebuilt",
                  "salvage",
                  "none"
                ]
              },
              "valid": {
                "type": "boolean",
                "default": true
              }
            }
          },
          "drivability": {
            "type": "object",
            "required": [
              "condition"
            ],
            "properties": {
              "condition": {
                "type": "string",
                "enum": [
                  "no-issues",
                  "starts-issues",
                  "wont-start"
                ]
              },
              "valid": {
                "type": "boolean",
                "default": true
              }
            }
          },
          "issues": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "engine",
                "transmission",
                "safety",
                "other"
              ]
            }
          },
          "otherReason": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "no-keys",
                "dead-battery",
                "engine-issue",
                "missing-parts"
              ]
            }
          },
          "missingParts": {
            "type": "string",
            "enum": [
              "some-removed",
              "nothing-missing"
            ]
          },
          "missingCategories": {
            "type": "object",
            "properties": {
              "engine": {
                "type": "string",
                "enum": [
                  "yes",
                  "no",
                  ""
                ]
              },
              "transmission": {
                "type": "string",
                "enum": [
                  "yes",
                  "no",
                  ""
                ]
              },
              "wheels": {
                "type": "string",
                "enum": [
                  "yes",
                  "no",
                  ""
                ]
              },
              "other": {
                "type": "string",
                "enum": [
                  "yes",
                  "no",
                  ""
                ]
              }
            }
          },
          "otherMissingDetails": {
            "type": "string"
          },
          "whichWheels": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "left-front",
                "right-front",
                "left-rear",
                "right-rear"
              ]
            }
          },
          "catStatus": {
            "type": "string",
            "enum": [
              "original",
              "replaced-aftermarket",
              "missing",
              "not-sure"
            ]
          },
          "exteriorDamage": {
            "type": "string",
            "enum": [
              "yes",
              "no"
            ]
          },
          "airbagsDeployedYesNo": {
            "type": "string",
            "enum": [
              "yes",
              "no"
            ]
          },
          "airbagsDeployed": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "front-driver",
                "front-passenger",
                "left-side",
                "right-side"
              ]
            }
          },
          "contact": {
            "type": "object",
            "required": [
              "name",
              "phoneNumber",
              "email",
              "consent"
            ],
            "properties": {
              "name": {
                "type": "string",
                "description": "Real full name of the seller"
              },
              "phoneNumber": {
                "type": "string",
                "description": "Valid US phone number"
              },
              "email": {
                "type": "string",
                "format": "email"
              },
              "consent": {
                "type": "boolean",
                "const": true,
                "description": "The seller explicitly agrees to be contacted by Dalo Auto Recycling by phone, text message, or email regarding this vehicle offer."
              }
            }
          },
          "identifiers": {
            "type": "object",
            "description": "REQUIRED numeric encoding of the answers. Without it the matcher returns offerAmount=0. See offer-flow.json -> derivedIdentifiers for the encoding rules.",
            "required": [
              "titleStatus",
              "drivabilityCondition",
              "primaryIssueType",
              "hasMissingParts",
              "missingEngine",
              "missingTransmission",
              "missingWheels",
              "catStatus",
              "hasExteriorDamage",
              "hasDeployedAirbags"
            ],
            "properties": {
              "titleStatus": {
                "type": "integer",
                "enum": [
                  0,
                  1,
                  2,
                  3
                ]
              },
              "drivabilityCondition": {
                "type": "integer",
                "enum": [
                  0,
                  1,
                  2
                ]
              },
              "primaryIssueType": {
                "type": "integer",
                "enum": [
                  0,
                  1,
                  2,
                  3,
                  4
                ]
              },
              "hasMissingParts": {
                "type": "integer",
                "enum": [
                  0,
                  1
                ]
              },
              "missingEngine": {
                "type": "integer",
                "enum": [
                  0,
                  1
                ]
              },
              "missingTransmission": {
                "type": "integer",
                "enum": [
                  0,
                  1
                ]
              },
              "missingWheels": {
                "type": "integer",
                "enum": [
                  0,
                  1
                ]
              },
              "catStatus": {
                "type": "integer",
                "enum": [
                  0,
                  1,
                  2,
                  3
                ]
              },
              "hasExteriorDamage": {
                "type": "integer",
                "enum": [
                  0,
                  1
                ]
              },
              "hasDeployedAirbags": {
                "type": "integer",
                "enum": [
                  0,
                  1
                ]
              }
            }
          },
          "yardId": {
            "type": "integer",
            "default": 1
          }
        }
      },
      "LeadResponse": {
        "type": "object",
        "required": [
          "id",
          "accessToken",
          "offerAmount"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Lead reference id"
          },
          "customerReferenceId": {
            "type": "string",
            "description": "Customer-facing short reference (last 8 characters of `id`). This is the ONLY reference value to display to the seller. Format in chat as: 'Reference Number: {customerReferenceId}'. The full `id` must still be used for all internal API calls (accept, decline, reschedule, lookup) \u2014 never replace `id` with `customerReferenceId` server-side."
          },
          "accessToken": {
            "type": "string",
            "description": "Token to view, accept, or decline the offer later"
          },
          "offerAmount": {
            "type": "number",
            "description": "USD. > 0 = instant offer. 0 = no instant offer (see noOfferReasons and rejectedDueToZipCode)."
          },
          "hasOffer": {
            "type": "boolean"
          },
          "offerMessage": {
            "type": "string"
          },
          "noOfferReasons": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Present when offerAmount <= 0. Reasons such as NO_MATCHING_BID, OUTSIDE_SERVICE_AREA, INELIGIBLE_TITLE."
          },
          "rejectedDueToZipCode": {
            "type": "boolean",
            "description": "true when the ZIP is outside Dalo's active service area."
          },
          "year": {
            "type": "string"
          },
          "make": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "details": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "AcceptRequest": {
        "type": "object",
        "properties": {
          "acceptedAmount": {
            "type": "number",
            "description": "The offerAmount returned by submitLead."
          }
        }
      },
      "DeclineRequest": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "description": "Optional free-text reason from the seller."
          }
        }
      },
      "AddressRequest": {
        "type": "object",
        "required": [
          "street",
          "city",
          "state",
          "zipCode"
        ],
        "properties": {
          "street": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "description": "2-letter US state code"
          },
          "zipCode": {
            "type": "string",
            "pattern": "^[0-9]{5}$"
          }
        }
      },
      "MatchAddressRequest": {
        "type": "object",
        "required": [
          "address",
          "city",
          "state",
          "zipCode",
          "yardId"
        ],
        "properties": {
          "address": {
            "type": "string",
            "description": "Street address (the SPA passes it as 'address', not 'street', for this endpoint)."
          },
          "city": {
            "type": "string"
          },
          "state": {
            "type": "string"
          },
          "zipCode": {
            "type": "string",
            "pattern": "^[0-9]{5}$"
          },
          "leadId": {
            "type": "string",
            "description": "Full lead id from submitLead."
          },
          "yardId": {
            "type": "integer",
            "default": 1
          }
        }
      },
      "MatchAddressResponse": {
        "type": "object",
        "properties": {
          "matchFound": {
            "type": "boolean"
          },
          "requiresTimePreferences": {
            "type": "boolean",
            "description": "true \u2192 no fixed slot can be booked; fall back to POST /dispatcher/submit-time-preferences using the returned pickupId."
          },
          "pickupId": {
            "type": "string",
            "description": "Identifier required by POST /dispatcher/submit-time-preferences."
          },
          "inputAddress": {
            "type": "string"
          },
          "yardAddress": {
            "type": "string"
          },
          "alternativeMatches": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "matches": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      },
      "AvailableDatesResponse": {
        "type": "object",
        "description": "Keys are YYYY-MM-DD dates. Values are arrays whose length > 0 means the date has bookable capacity. Inner element shape is not strictly typed \u2014 only the keys are needed to drive the date question.",
        "additionalProperties": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "example": {
          "2026-06-15": [
            {
              "slotId": "abc",
              "label": "Morning"
            }
          ],
          "2026-06-16": []
        },
        "properties": {}
      },
      "AvailableTimeSlot": {
        "type": "object",
        "description": "A bookable pickup slot. id is the value to send as scheduledTimeSlot; label is the value to send as scheduledTimeLabel and to show to the seller.",
        "properties": {
          "id": {
            "type": "string",
            "description": "Opaque slot id \u2014 send verbatim as scheduledTimeSlot."
          },
          "label": {
            "type": "string",
            "description": "Human label, e.g. 'Morning (8 AM \u2013 12 PM)'. Send as scheduledTimeLabel."
          }
        },
        "additionalProperties": true
      },
      "AvailableTimeSlotsResponse": {
        "type": "object",
        "properties": {
          "timeSlots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AvailableTimeSlot"
            }
          },
          "isCompatible": {
            "type": "boolean"
          }
        }
      },
      "ScheduleRequest": {
        "type": "object",
        "required": [
          "scheduledDay",
          "scheduledTimeSlot",
          "address"
        ],
        "properties": {
          "scheduledDay": {
            "type": "string",
            "format": "date",
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "description": "YYYY-MM-DD. MUST be one of the keys from /dispatcher/trucks/available-dates."
          },
          "scheduledTimeSlot": {
            "type": "string",
            "description": "Slot id returned by /dispatcher/trucks/available-timeslots. NEVER invent."
          },
          "scheduledTimeLabel": {
            "type": "string",
            "description": "Slot label returned by /dispatcher/trucks/available-timeslots."
          },
          "scheduledDate": {
            "type": "string",
            "format": "date-time",
            "description": "Optional full ISO timestamp of the slot start."
          },
          "address": {
            "$ref": "#/components/schemas/AddressRequest"
          },
          "preferredTimeSlots": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "preferredDates": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "date"
            }
          }
        }
      },
      "TimePreferencesRequest": {
        "type": "object",
        "required": [
          "pickupId",
          "preferredDates",
          "preferredTimeSlots"
        ],
        "properties": {
          "pickupId": {
            "type": "string",
            "description": "From /dispatcher/match-address."
          },
          "preferredDates": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "date"
            },
            "description": "YYYY-MM-DD strings, 1\u20133 entries."
          },
          "preferredTimeSlots": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Broad time windows, e.g. Morning, Afternoon, Evening."
          },
          "source": {
            "type": "string",
            "description": "Free-text source tag. Use 'gpt' for AI-driven submissions."
          }
        }
      },
      "TimePreferencesResponse": {
        "type": "object",
        "properties": {
          "matched": {
            "type": "boolean"
          },
          "message": {
            "type": "string"
          },
          "tripId": {
            "type": "string"
          }
        }
      },
      "LeadActions": {
        "type": "object",
        "description": "Server-driven booleans gating which follow-up call is allowed. Re-check after every state-changing call.",
        "properties": {
          "canAccept": {
            "type": "boolean"
          },
          "canDecline": {
            "type": "boolean"
          },
          "canSchedule": {
            "type": "boolean"
          },
          "canReschedule": {
            "type": "boolean"
          },
          "canUpdateContact": {
            "type": "boolean"
          },
          "canUpdateAddress": {
            "type": "boolean"
          }
        }
      },
      "LeadDetail": {
        "type": "object",
        "description": "Full lead view (returned by getLead, accept, decline, address, schedule, cancel-pickup, confirm-pickup).",
        "properties": {
          "id": {
            "type": "string"
          },
          "customerReferenceId": {
            "type": "string",
            "description": "Customer-facing short id (last 8 of `id`). The ONLY reference value to display to the seller."
          },
          "accessToken": {
            "type": "string",
            "description": "Internal only \u2014 never display to the seller."
          },
          "status": {
            "type": "integer",
            "description": "State enum: 0=New, 10=NoOffer, 20=OfferGiven, 30=Accepted, 35=Declined (further states exist)."
          },
          "statusMessage": {
            "type": "string"
          },
          "statusDisplay": {
            "type": "string"
          },
          "offerAmount": {
            "type": "number"
          },
          "offerGivenAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "noOfferReasons": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "rejectedDueToZipCode": {
            "type": "boolean"
          },
          "scheduledDate": {
            "type": "string",
            "nullable": true,
            "description": "Full ISO timestamp set by the server after /schedule succeeds."
          },
          "scheduledDay": {
            "type": "string",
            "nullable": true,
            "description": "YYYY-MM-DD."
          },
          "scheduledTimeSlot": {
            "type": "string",
            "nullable": true,
            "description": "Opaque slot id."
          },
          "scheduledTimeLabel": {
            "type": "string",
            "nullable": true,
            "description": "Human label, e.g. 'Morning (8 AM \u2013 12 PM)'."
          },
          "scheduledAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time",
            "description": "When the schedule call was recorded."
          },
          "isScheduled": {
            "type": "boolean"
          },
          "preferredTimeSlots": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "preferredDates": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "actions": {
            "$ref": "#/components/schemas/LeadActions"
          },
          "pickupStatus": {
            "type": "string",
            "nullable": true
          },
          "canConfirmPickup": {
            "type": "boolean",
            "description": "true \u2192 call POST /customer/lead/{accessToken}/confirm-pickup."
          },
          "source": {
            "type": "string"
          },
          "isArchived": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "address": {
            "$ref": "#/components/schemas/AddressRequest"
          },
          "contactName": {
            "type": "string"
          },
          "phoneNumber": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "vehicle": {
            "type": "object",
            "properties": {
              "year": {
                "type": "string"
              },
              "make": {
                "type": "string"
              },
              "model": {
                "type": "string"
              },
              "modelId": {
                "type": "string"
              }
            }
          }
        },
        "additionalProperties": true
      }
    }
  },
  "tags": [
    {
      "name": "Scheduling",
      "description": "Post-offer endpoints: accept/decline, address, dispatcher match, available dates/slots, schedule, reschedule (same /schedule endpoint), cancel-pickup, confirm-pickup."
    }
  ]
}