quotes.draft

Read one AI line draft from quotes.draftFromVisit, not a customer quote. Each line's state (draft, approved or rejected), where the price came from, the basis in source_note, comparables, the shop's pricing rules, the written scope_of_work, the shop's lessons, and the next line to read to the worker. For a customer quote, use quotes.get.

WhoAgents can call this
RESTGET /v1/quotes/drafts/get
MCP toolquotes_draft
Writesno
AreaShop

When to use it

Read one AI line draft from quotes.draftFromVisit, not a customer quote. Each line's state (draft, approved or rejected), where the price came from, the basis in source_note, comparables, the shop's pricing rules, the written scope_of_work, the shop's lessons, and the next line to read to the worker.

What to tell the owner

Tell them what you found in plain words. Don't read back raw fields.

Input

FieldTypeRequired
draft_idstring (uuid)yes

Example

GET https://doingwork.work/v1/quotes/drafts/get?draft_id=00000000-0000-4000-8000-000000000000

Output

FieldTypeAlways there
draft_idstring (uuid)yes
job_idstring (uuid)yes
visit_id['string', 'null', ' ', '(', 'u', 'u', 'i', 'd', ')']yes
statusstringyes
quote_id['string', 'null', ' ', '(', 'u', 'u', 'i', 'd', ')']yes
scope_of_work['string', 'null']yes
pricing_rules['string', 'null']yes
instructionstringyes
linesarrayyes
lines[].line_idstring (uuid)yes
lines[].positionintegeryes
lines[].descriptionstringyes
lines[].quantitynumberyes
lines[].unit_price_minor['integer', 'null']yes
lines[].sourcestringyes
lines[].source_note['string', 'null']yes
lines[].statestringyes
lines[].comparablesarrayyes
lines[].comparables[].quote_idstring (uuid)yes
lines[].comparables[].statusstringyes
lines[].comparables[].historicalbooleanyes
lines[].comparables[].quoted_atstring (date-time)yes
lines[].comparables[].customer_id['string', 'null', ' ', '(', 'u', 'u', 'i', 'd', ')']yes
lines[].comparables[].customer_name['string', 'null']yes
lines[].comparables[].repeat_customerbooleanyes
lines[].comparables[].descriptionstringyes
lines[].comparables[].quantitynumberyes
lines[].comparables[].unit_price_minorintegeryes
lines[].comparables[].line_total_minorintegeryes
lines[].comparables[].size_quantity['number', 'null']yes
lines[].comparables[].size_unit['string', 'null']yes
lines[].comparables[].unit_rate_minor['integer', 'null']yes
lines[].comparables[].notes['string', 'null']yes
lines[].comparables[].discountsarrayyes
lines[].comparables[].discounts[].descriptionstringyes
lines[].comparables[].discounts[].quantitynumberyes
lines[].comparables[].discounts[].unit_price_minorintegeryes
lines[].comparables[].discounts[].line_total_minorintegeryes
lines[].comparables[].match_reasonstringyes
lines[].comparables_cursor['string', 'null']yes
lines[].price_bookarrayyes
lines[].price_book[].item_idstring (uuid)yes
lines[].price_book[].namestringyes
lines[].price_book[].unit['string', 'null']yes
lines[].price_book[].unit_price_minorintegeryes
open_linesintegeryes
lessonsarrayyes
next_actionsarrayyes
next_actions[].saystringyes
next_actions[].op['string', 'null']yes
next_actions[].whenstring (one of now, later, check, tell_human)yes
next_actions[].due_at['string', 'null', ' ', '(', 'd', 'a', 't', 'e', '-', 't', 'i', 'm', 'e', ')']no
next_actions[].args_hintstringno
{
  "draft_id": "00000000-0000-4000-8000-000000000000",
  "job_id": "00000000-0000-4000-8000-000000000000",
  "visit_id": "00000000-0000-4000-8000-000000000000",
  "status": "...",
  "quote_id": "00000000-0000-4000-8000-000000000000",
  "scope_of_work": "...",
  "pricing_rules": "...",
  "instruction": "...",
  "lines": [
    {
      "line_id": "00000000-0000-4000-8000-000000000000",
      "position": 1,
      "description": "40 gallon gas heater, installed",
      "quantity": "...",
      "unit_price_minor": "...",
      "source": "...",
      "source_note": "...",
      "state": "...",
      "comparables": [
        {
          "quote_id": "00000000-0000-4000-8000-000000000000",
          "status": "...",
          "historical": true,
          "quoted_at": "...",
          "customer_id": "00000000-0000-4000-8000-000000000000",
          "customer_name": "...",
          "repeat_customer": true,
          "description": "40 gallon gas heater, installed",
          "quantity": "...",
          "unit_price_minor": 50000,
          "line_total_minor": 50000,
          "size_quantity": "...",
          "size_unit": "...",
          "unit_rate_minor": "...",
          "notes": "...",
          "discounts": [
            {
              "description": "40 gallon gas heater, installed",
              "quantity": "...",
              "unit_price_minor": 50000,
              "line_total_minor": 50000
            }
          ],
          "match_reason": "..."
        }
      ],
      "comparables_cursor": "...",
      "price_book": [
        {
          "item_id": "00000000-0000-4000-8000-000000000000",
          "name": "Ruiz Plumbing",
          "unit": "...",
          "unit_price_minor": 50000
        }
      ]
    }
  ],
  "open_lines": 1,
  "lessons": [
    "..."
  ],
  "next_actions": [
    {
      "say": "...",
      "op": "...",
      "when": "now"
    }
  ]
}

Errors

CodeStatusWhat to do
invalid_input, invalid_token, rate_limitedCan happen on any call. See errors.