{
  "$schema": "https://usedautopartfinder.com/schemas/offer-flow-v1.json",
  "version": 1,
  "service": "Instant cash offer for used / junk / damaged cars",
  "audience": "AI assistants (ChatGPT, Claude, etc.) acting on behalf of a car seller",
  "instructions": [
    "You are helping a user sell their car for cash. This document lets you get them a REAL instant offer.",
    "Walk `steps` in order. Ask the user each `ask`. Accept only the listed `options` values (show the user the human `label`).",
    "Respect `showWhen` (only ask a step when its condition holds) and `next` (which step follows a given answer).",
    "For the vehicle, call the `lookups` endpoints to get real year/make/model choices and capture the model `id` as vehicle.modelId.",
    "For the ZIP, call the zip lookup to fill city/state.",
    "Collect the user's real name, valid US phone, email, and consent -- these are required and create a real pickup lead.",
    "When all required answers are gathered, build `submit.body` and POST it. Read `submit.response`.",
    "REQUIRED: compute the numeric `identifiers` block (see `derivedIdentifiers`) from the answers and include it in submit.body -- without it the matcher rejects every bid and the offer is always 0.",
    "If a step has `rules`, honor them (e.g. some title/age combinations cannot be purchased -- do not submit in that case)."
  ],
  "api": {
    "base": "https://revolt.company/api",
    "yardId": 1
  },
  "lookups": {
    "years": {
      "method": "GET",
      "path": "/vehicle/years",
      "returns": "[{ label, value }]",
      "url": "https://revolt.company/api/vehicle/years"
    },
    "makes": {
      "method": "GET",
      "path": "/vehicle/makes?year={year}",
      "returns": "[{ label, value }]",
      "url": "https://revolt.company/api/vehicle/makes?year={year}"
    },
    "models": {
      "method": "GET",
      "path": "/vehicle/models?year={year}&make={make}",
      "returns": "[{ label, value, id, bodyTypeId, doorCount }]",
      "capture": {
        "vehicle.modelId": "id"
      },
      "url": "https://revolt.company/api/vehicle/models?year={year}&make={make}"
    },
    "zip": {
      "method": "GET",
      "url": "https://api.zippopotam.us/us/{zip}",
      "returns": "places[0][\"place name\"] = city, places[0][\"state abbreviation\"] = state",
      "onError": "treat zip as valid; leave city/state blank (matches website fallback)"
    }
  },
  "steps": [
    {
      "id": "vehicle",
      "ask": "What year, make, and model is the vehicle?",
      "type": "vehicle-lookup",
      "required": true,
      "sequence": [
        "1. GET lookups.years -> ask the user the year (must be one of the returned values).",
        "2. GET lookups.makes?year={year} -> ask the user the make (must be one returned).",
        "3. GET lookups.models?year={year}&make={make} -> ask the user the model (must be one returned).",
        "4. Set vehicle.modelId = the chosen model object's `id`. REQUIRED."
      ],
      "note": "Use the exact make/model strings the lookups return -- do not free-type them.",
      "fields": [
        "vehicle.year",
        "vehicle.make",
        "vehicle.model",
        "vehicle.modelId"
      ],
      "next": "location"
    },
    {
      "id": "location",
      "ask": "What ZIP code is the vehicle located in?",
      "type": "zip",
      "field": "location.zip",
      "required": true,
      "note": "Validate with the zip lookup; fill location.city/state/display from it.",
      "next": "mileage"
    },
    {
      "id": "mileage",
      "ask": "What is the current mileage?",
      "type": "mileage",
      "field": "mileage.value",
      "required": "value OR odometerNotWorking",
      "alt": {
        "field": "mileage.odometerNotWorking",
        "when": "odometer is broken or unknown -> set true"
      },
      "next": "title"
    },
    {
      "id": "title",
      "ask": "Do you have the title for the vehicle?",
      "type": "single",
      "field": "title.status",
      "required": true,
      "options": [
        {
          "value": "clean",
          "label": "Yes, it has a clean title"
        },
        {
          "value": "rebuilt",
          "label": "No, it's a rebuilt title"
        },
        {
          "value": "salvage",
          "label": "No, it's a salvage title"
        },
        {
          "value": "none",
          "label": "I don't have the title"
        }
      ],
      "rules": [
        "if title.status='none' AND vehicle age < 10 years -> STOP: we cannot buy it (Virginia law). Do not submit.",
        "if title.status='none' AND vehicle age >= 10 years -> allowed, but a government ID and a photo next to the vehicle are required at pickup."
      ],
      "next": "drivability"
    },
    {
      "id": "drivability",
      "ask": "Can the vehicle be started and driven safely?",
      "type": "single",
      "field": "drivability.condition",
      "required": true,
      "options": [
        {
          "value": "no-issues",
          "label": "Yes -- it has no mechanical issues",
          "next": "missing-parts"
        },
        {
          "value": "starts-issues",
          "label": "Yes -- it starts, but has issues",
          "next": "issues"
        },
        {
          "value": "wont-start",
          "label": "No -- it won't start",
          "next": "issues"
        }
      ],
      "note": "'no-issues' skips the issues step entirely."
    },
    {
      "id": "issues",
      "ask": "Tell us about the issues.",
      "showWhen": "drivability.condition is 'starts-issues' or 'wont-start'",
      "type": "variant",
      "variants": {
        "starts-issues": {
          "ask": "What issues does the vehicle have? (select all that apply)",
          "field": "issues",
          "type": "multi",
          "required": false,
          "options": [
            {
              "value": "engine",
              "label": "Engine Issues"
            },
            {
              "value": "transmission",
              "label": "Transmission Issues"
            },
            {
              "value": "safety",
              "label": "Won't pass State Safety Inspection"
            },
            {
              "value": "other",
              "label": "Other, not sure"
            }
          ]
        },
        "wont-start": {
          "ask": "Why doesn't the vehicle run or drive?",
          "field": "otherReason",
          "type": "single",
          "required": true,
          "options": [
            {
              "value": "no-keys",
              "label": "I don't have the keys"
            },
            {
              "value": "dead-battery",
              "label": "Just dead battery"
            },
            {
              "value": "engine-issue",
              "label": "Engine issue"
            },
            {
              "value": "missing-parts",
              "label": "Not sure why"
            }
          ]
        }
      },
      "next": "missing-parts"
    },
    {
      "id": "missing-parts",
      "ask": "Are there any missing parts on the vehicle?",
      "type": "single",
      "field": "missingParts",
      "required": true,
      "options": [
        {
          "value": "some-removed",
          "label": "Yes, some parts are removed",
          "next": "what-missing"
        },
        {
          "value": "nothing-missing",
          "label": "No, nothing is missing",
          "next": "catalytic"
        }
      ]
    },
    {
      "id": "what-missing",
      "ask": "What parts are missing? (select all that apply)",
      "showWhen": "missingParts is 'some-removed'",
      "type": "multi-yesno",
      "required": "at least one category = yes",
      "categories": [
        {
          "key": "engine",
          "field": "missingCategories.engine",
          "label": "Engine"
        },
        {
          "key": "transmission",
          "field": "missingCategories.transmission",
          "label": "Transmission"
        },
        {
          "key": "wheels",
          "field": "missingCategories.wheels",
          "label": "Wheels"
        },
        {
          "key": "other",
          "field": "missingCategories.other",
          "label": "Other"
        }
      ],
      "followups": [
        {
          "showWhen": "missingCategories.other = 'yes'",
          "field": "otherMissingDetails",
          "type": "text",
          "required": true,
          "ask": "Please specify what other parts are missing."
        }
      ],
      "next": "if missingCategories.wheels = 'yes' -> which-wheels, else -> catalytic"
    },
    {
      "id": "which-wheels",
      "ask": "Which wheels are missing? (select all that apply)",
      "showWhen": "missingCategories.wheels is 'yes'",
      "type": "multi",
      "field": "whichWheels",
      "required": "at least 1",
      "options": [
        {
          "value": "left-front",
          "label": "Left front wheel (driver side)"
        },
        {
          "value": "right-front",
          "label": "Right front wheel (passenger side)"
        },
        {
          "value": "left-rear",
          "label": "Left rear wheel"
        },
        {
          "value": "right-rear",
          "label": "Right rear wheel"
        }
      ],
      "next": "catalytic"
    },
    {
      "id": "catalytic",
      "ask": "Does the vehicle have its catalytic converter?",
      "type": "single",
      "field": "catStatus",
      "required": true,
      "options": [
        {
          "value": "original",
          "label": "Yes, it's original (factory-installed, never replaced)"
        },
        {
          "value": "replaced-aftermarket",
          "label": "Yes, but it's been replaced (non-original part)"
        },
        {
          "value": "missing",
          "label": "No, it's missing (not currently installed)"
        },
        {
          "value": "not-sure",
          "label": "I'm not sure"
        }
      ],
      "rules": [
        "if catStatus is 'missing' or 'replaced-aftermarket' -> the website shows a disclaimer the user must accept: inspection may be required and this may affect the final offer. Acknowledge this with the user before submitting."
      ],
      "next": "exterior-damage"
    },
    {
      "id": "exterior-damage",
      "ask": "Is there any exterior damage beyond normal wear and tear?",
      "type": "single",
      "field": "exteriorDamage",
      "required": true,
      "options": [
        {
          "value": "yes",
          "label": "Yes"
        },
        {
          "value": "no",
          "label": "No"
        }
      ],
      "next": "airbags"
    },
    {
      "id": "airbags",
      "ask": "Have any of the vehicle's airbags been deployed?",
      "type": "single",
      "field": "airbagsDeployedYesNo",
      "required": true,
      "options": [
        {
          "value": "yes",
          "label": "Yes"
        },
        {
          "value": "no",
          "label": "No"
        }
      ],
      "followups": [
        {
          "showWhen": "airbagsDeployedYesNo = 'yes'",
          "ask": "Which airbags have been deployed? (select all that apply)",
          "field": "airbagsDeployed",
          "type": "multi",
          "required": "at least 1",
          "options": [
            {
              "value": "front-driver",
              "label": "Front Driver Airbag"
            },
            {
              "value": "front-passenger",
              "label": "Front Passenger Airbag"
            },
            {
              "value": "left-side",
              "label": "Left Side Airbag"
            },
            {
              "value": "right-side",
              "label": "Right Side Airbag"
            }
          ]
        }
      ],
      "next": "contact"
    },
    {
      "id": "contact",
      "ask": "How can we reach you with the offer?",
      "type": "contact",
      "required": true,
      "fields": [
        {
          "field": "contact.name",
          "label": "Full name",
          "required": true
        },
        {
          "field": "contact.phoneNumber",
          "label": "Phone (valid US number)",
          "required": true
        },
        {
          "field": "contact.email",
          "label": "Email",
          "required": true
        },
        {
          "field": "contact.consent",
          "label": "Consent to be contacted",
          "required": "must be true"
        }
      ],
      "note": "Real contact info is required -- submitting creates a real pickup lead. Confirm consent with the user first.",
      "next": "submit"
    }
  ],
  "submit": {
    "method": "POST",
    "path": "/customer/lead",
    "body": {
      "vehicle": {
        "year": "",
        "make": "",
        "model": "",
        "modelId": ""
      },
      "location": {
        "zip": "",
        "display": "",
        "city": "",
        "state": "",
        "valid": true
      },
      "mileage": {
        "value": "",
        "odometerNotWorking": false,
        "valid": true
      },
      "title": {
        "status": "",
        "valid": true
      },
      "drivability": {
        "condition": "",
        "valid": true
      },
      "issues": [],
      "otherReason": [],
      "missingParts": "",
      "missingCategories": {
        "engine": "",
        "transmission": "",
        "wheels": "",
        "other": ""
      },
      "otherMissingDetails": "",
      "whichWheels": [],
      "catStatus": "",
      "exteriorDamage": "",
      "airbagsDeployed": [],
      "airbagsDeployedYesNo": "",
      "contact": {
        "name": "",
        "phoneNumber": "",
        "email": ""
      },
      "identifiers": {
        "titleStatus": 0,
        "drivabilityCondition": 2,
        "primaryIssueType": 4,
        "hasMissingParts": 0,
        "missingEngine": 0,
        "missingTransmission": 0,
        "missingWheels": 0,
        "catStatus": 0,
        "hasExteriorDamage": 0,
        "hasDeployedAirbags": 0
      },
      "yardId": 1
    },
    "response": {
      "offer": "offerAmount",
      "leadId": "id",
      "accessToken": "accessToken",
      "noOfferWhen": "offerAmount <= 0",
      "noOfferReasons": "noOfferReasons",
      "outsideServiceArea": "rejectedDueToZipCode"
    },
    "tellUser": {
      "hasOffer": "We'll pay you ${offerAmount} for your {year} {make} {model}, with free towing.",
      "noOffer": "We couldn't make an instant offer. Our team may follow up -- or the location may be outside the service area."
    },
    "url": "https://revolt.company/api/customer/lead"
  },
  "derivedIdentifiers": {
    "required": "REQUIRED -- without it no bid can match and the offer is always 0",
    "encoding": {
      "titleStatus": {
        "clean": 0,
        "salvage": 1,
        "rebuilt": 2,
        "none": 3
      },
      "drivabilityCondition": {
        "starts-issues": 0,
        "wont-start": 1,
        "no-issues": 2
      },
      "primaryIssueType": {
        "_meaning": {
          "engine": 0,
          "transmission": 1,
          "safety": 2,
          "other": 3,
          "no-issues": 4
        },
        "_rule": "if drivability='starts-issues' and issues includes engine->0, else transmission->1, else safety->2, else other->3; else if drivability='wont-start' and otherReason='engine-issue'->0 else 3; else 4"
      },
      "catStatus": {
        "original": 0,
        "replaced-aftermarket": 1,
        "missing": 2,
        "not-sure": 3
      },
      "hasMissingParts": "missingParts === 'some-removed' ? 1 : 0",
      "missingEngine": "missingCategories.engine === 'yes' ? 1 : 0",
      "missingTransmission": "missingCategories.transmission === 'yes' ? 1 : 0",
      "missingWheels": "missingCategories.wheels === 'yes' ? 1 : 0",
      "hasExteriorDamage": "exteriorDamage === 'yes' ? 1 : 0",
      "hasDeployedAirbags": "airbagsDeployedYesNo === 'yes' ? 1 : 0"
    }
  },
  "afterOffer": {
    "accept": {
      "method": "POST",
      "path": "/customer/lead/{accessToken}/accept",
      "body": {
        "acceptedAmount": "offerAmount"
      },
      "url": "https://revolt.company/api/customer/lead/{accessToken}/accept",
      "description": "Seller accepts the instant offer. Required before any scheduling step. Use the accessToken returned from the lead submission.",
      "next": "scheduling.addressCollection"
    },
    "decline": {
      "method": "POST",
      "path": "/customer/lead/{accessToken}/decline",
      "body": {
        "reason": "optional"
      },
      "url": "https://revolt.company/api/customer/lead/{accessToken}/decline"
    },
    "status": {
      "method": "GET",
      "path": "/customer/lead/{accessToken}",
      "url": "https://revolt.company/api/customer/lead/{accessToken}"
    }
  },
  "scheduling": {
    "description": "Real pickup scheduling workflow used by Dalo Auto Recycling. Runs only after the offer has been accepted. Two possible paths: hard scheduling (driver/dates/timeslots available) or soft scheduling (seller submits preferences, dispatcher confirms later).",
    "flow": [
      "1. Collect pickup address",
      "2. Match address to a dispatcher",
      "3. If hard scheduling available: pick date -> pick time slot -> schedule pickup",
      "4. If requiresTimePreferences=true: submit preferred dates and time windows; dispatcher confirms later",
      "5. Optional: confirm pickup details before driver arrival",
      "6. To reschedule, call the schedule endpoint again with new date/time/address"
    ],
    "addressCollection": {
      "description": "Collect the full pickup address. City, state, and ZIP may already be known from the quote flow (location.city / location.state / location.zip) -- reuse them and only ask the seller for the street address when possible.",
      "fields": [
        { "field": "address.street",  "label": "Street address", "required": true },
        { "field": "address.city",    "label": "City",           "required": true, "reuseFrom": "location.city" },
        { "field": "address.state",   "label": "State",          "required": true, "reuseFrom": "location.state" },
        { "field": "address.zipCode", "label": "ZIP code",       "required": true, "reuseFrom": "location.zip" }
      ],
      "next": "scheduling.dispatcherMatch"
    },
    "dispatcherMatch": {
      "method": "POST",
      "path": "/dispatcher/match-address",
      "url": "https://revolt.company/api/dispatcher/match-address",
      "body": {
        "leadId": "from accept response (kept internally, never shown to seller)",
        "address": {
          "street": "",
          "city": "",
          "state": "",
          "zipCode": ""
        }
      },
      "description": "Match the pickup address to a dispatcher / pickup region. Returns either hard scheduling options or a flag that only time preferences are supported.",
      "response": {
        "pickupId": "use as pickupId in subsequent scheduling calls",
        "dispatcherId": "internal",
        "requiresTimePreferences": "boolean -- true means soft scheduling fallback"
      },
      "outcomes": {
        "hardScheduling": {
          "when": "requiresTimePreferences is false / absent",
          "next": "scheduling.hardPath"
        },
        "softScheduling": {
          "when": "requiresTimePreferences === true",
          "next": "scheduling.softPath"
        }
      }
    },
    "hardPath": {
      "description": "Driver availability is known. Seller picks from real available dates and time windows.",
      "steps": [
        {
          "id": "availableDates",
          "method": "GET",
          "path": "/dispatcher/trucks/available-dates",
          "url": "https://revolt.company/api/dispatcher/trucks/available-dates",
          "query": { "pickupId": "from dispatcherMatch" },
          "returns": "list of available pickup dates (YYYY-MM-DD). Present to seller as human-readable dates (e.g. 'Tuesday, Jun 3')."
        },
        {
          "id": "availableTimeSlots",
          "method": "GET",
          "path": "/dispatcher/trucks/available-timeslots",
          "url": "https://revolt.company/api/dispatcher/trucks/available-timeslots",
          "query": { "pickupId": "from dispatcherMatch", "date": "selected date" },
          "returns": "list of available time windows for the chosen date."
        },
        {
          "id": "schedulePickup",
          "method": "POST",
          "path": "/customer/lead/{accessToken}/schedule",
          "url": "https://revolt.company/api/customer/lead/{accessToken}/schedule",
          "body": {
            "pickupId": "from dispatcherMatch",
            "date": "selected available date",
            "timeSlot": "selected available time slot",
            "address": {
              "street": "",
              "city": "",
              "state": "",
              "zipCode": ""
            }
          },
          "description": "Books the appointment. After success, seller has a confirmed pickup."
        }
      ],
      "tellUser": "Your pickup is scheduled for {date} during {timeSlot}. Free towing is included."
    },
    "softPath": {
      "description": "Dispatcher does not expose live availability for this region. Seller submits preferred dates and time windows; the dispatcher reaches out to confirm a real appointment.",
      "submit": {
        "method": "POST",
        "path": "/dispatcher/submit-time-preferences",
        "url": "https://revolt.company/api/dispatcher/submit-time-preferences",
        "body": {
          "pickupId": "from dispatcherMatch",
          "preferredDates": ["YYYY-MM-DD"],
          "preferredTimeSlots": ["Morning", "Afternoon", "Evening"],
          "source": "gpt"
        }
      },
      "tellUser": "Thanks. I saved your preferred pickup time. Dalo Auto Recycling will confirm the appointment before sending a driver. Free towing is included."
    },
    "reschedule": {
      "description": "There is no dedicated reschedule endpoint. To change a scheduled pickup, call POST /customer/lead/{accessToken}/schedule again with the new date, time slot, and address. The most recent schedule call wins.",
      "method": "POST",
      "path": "/customer/lead/{accessToken}/schedule",
      "url": "https://revolt.company/api/customer/lead/{accessToken}/schedule"
    },
    "confirmPickup": {
      "method": "POST",
      "path": "/customer/lead/{accessToken}/confirm-pickup",
      "url": "https://revolt.company/api/customer/lead/{accessToken}/confirm-pickup",
      "description": "Optional confirmation step before the driver is dispatched. Use only when the seller asks to confirm the existing pickup details."
    },
    "identifiers": {
      "accessToken": "Returned from lead submission. Required for accept, schedule, confirm-pickup, reschedule. Keep internally -- never show to the seller.",
      "leadId": "Internal lead id. Keep internally -- never show to the seller.",
      "customerReferenceId": "Short human-friendly reference id. This is the ONLY id safe to display to the seller.",
      "pickupId": "Returned from dispatcher match-address. Required for available-dates, available-timeslots, schedule, and submit-time-preferences."
    }
  },
  "aiCapabilities": {
    "summary": "Dalo Auto Recycling exposes a real, machine-callable workflow for instant car offers and pickup scheduling. AI assistants can quote a vehicle, create a real lead, accept the offer on the seller's behalf, match a dispatcher, and either schedule a hard appointment from real availability or submit pickup time preferences for dispatcher confirmation.",
    "capabilities": [
      "Instant vehicle offers (real, not estimates)",
      "Real lead creation",
      "Offer acceptance",
      "Pickup address collection and dispatcher matching",
      "Hard pickup scheduling from live driver availability",
      "Soft scheduling via pickup time preferences",
      "Pickup rescheduling (re-call schedule endpoint)",
      "Optional pickup confirmation",
      "AI-assisted end-to-end seller experience"
    ],
    "gpt": {
      "name": "Dalo Instant Quote GPT",
      "url": "https://chatgpt.com/g/g-6a1b74a821ec8191b78717979c02d436-dalo-instant-quote",
      "platform": "OpenAI ChatGPT (Custom GPT)",
      "purpose": [
        "Get instant vehicle offers",
        "Create real leads",
        "Accept offers",
        "Schedule pickups",
        "Submit pickup time preferences",
        "Reschedule pickups"
      ],
      "backedBy": "https://revolt.company/api (same endpoints documented here and in openapi.json)"
    },
    "apiBase": "https://revolt.company/api",
    "openapi": "https://www.daloautorecycling.com/openapi.json",
    "landingPage": "https://www.daloautorecycling.com/ai-resources"
  }
}
