{"openapi":"3.1.0","info":{"title":"HPS Inventory Bot","version":"0.1.0"},"paths":{"/api/basic-search":{"get":{"summary":"Basic Search","description":"Run the public inventory lookup, returning direct matches only.","operationId":"basic_search_api_basic_search_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","description":"Item number, search name, or wildcard","title":"Q"},"description":"Item number, search name, or wildcard"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Max results to return","default":30,"title":"Limit"},"description":"Max results to return"},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}},{"name":"anon_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Anon Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmartSearchOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/smart-search":{"get":{"summary":"Smart Search","description":"Run registered Smart Search against live D365 inventory.","operationId":"smart_search_api_smart_search_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","description":"Sun model code or item number","title":"Q"},"description":"Sun model code or item number"},{"name":"max_tier","in":"query","required":false,"schema":{"type":"integer","maximum":8,"minimum":0,"description":"Hide results beyond this tier","default":7,"title":"Max Tier"},"description":"Hide results beyond this tier"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Max results to return","default":30,"title":"Limit"},"description":"Max results to return"},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}},{"name":"anon_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Anon Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmartSearchOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/product-lines":{"get":{"summary":"Product Lines","description":"List distinct vendor/product-line names for the filter dropdown.\n\nCached in memory (see _get_vendor_list) — the underlying query walks\nthe whole cc_producttranslation table, so this is slow only on the\nfirst call after a restart or cache expiry (~1068 vendors as of\n2026-07-25).\n\nAlso returns `primary`: the ~22 major brands (friendly label + the raw\ncode to pass to /api/product-line-search) that populate the default\ndropdown on live.html. The full `vendors` list backs that page's\n\"Advanced\" toggle for anyone who needs a less common line.","operationId":"product_lines_api_product_lines_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductLinesOut"}}}}}}},"/api/product-line-search":{"get":{"summary":"Product Line Search","description":"Browse in-stock items for a vendor, optionally filtered by `q`.\n\nThis scans the vendor's item catalog (cached — see _get_vendor_items)\nin chunks, querying IV for on-hand data and applying zero-stock\nsuppression (see InventoryService.browse_items), until it collects\n`page_size` displayed rows or runs out of items to scan (capped at\n_BROWSE_MAX_SCAN items per call so a very sparse vendor can't make one\nrequest run away). Item count and displayed-row count are NOT the same\nthing once suppression is applied, so pagination is cursor-based\n(resume-from-index) rather than page-number-based — a \"page\" of raw\ncatalog items can yield anywhere from 0 to page_size*2 displayed rows\n(up to 2 site rows per item), so slicing by item count alone (the old\nbehavior) often produced pages with only a handful of visible rows.\n\n`sort` reorders the FULL cached item list (not just the current page)\nbefore slicing by cursor, so Next/Previous walk a globally sorted\norder across all pages — not just each page sorted independently. It\nsorts by the working part number (what's shown as the main item text\nin the UI), not the internal Dataverse item number shown in\nparentheses — see DataverseClient.items_by_vendor().\n\n`q`, if given, filters the vendor's item list to those whose item\nnumber OR sort name contains it (case-insensitive substring match)\nBEFORE sorting/pagination — so \"search within Sun\" and \"browse Sun\"\nshare the exact same scan/suppress/paginate pipeline; `total_items`\nreflects the filtered count, not the vendor's full catalog size.","operationId":"product_line_search_api_product_line_search_get","parameters":[{"name":"vendor","in":"query","required":true,"schema":{"type":"string","description":"Vendor/product-line name, e.g. SUN","title":"Vendor"},"description":"Vendor/product-line name, e.g. SUN"},{"name":"cursor","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Resume scanning the vendor's catalog from this index","default":0,"title":"Cursor"},"description":"Resume scanning the vendor's catalog from this index"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Target number of DISPLAYED rows, not raw items","default":50,"title":"Page Size"},"description":"Target number of DISPLAYED rows, not raw items"},{"name":"sort","in":"query","required":false,"schema":{"type":"string","description":"'catalog' (default order), 'item_asc', or 'item_desc'","default":"catalog","title":"Sort"},"description":"'catalog' (default order), 'item_asc', or 'item_desc'"},{"name":"q","in":"query","required":false,"schema":{"type":"string","description":"Optional text filter — matches item number or search name within this vendor's catalog","default":"","title":"Q"},"description":"Optional text filter — matches item number or search name within this vendor's catalog"},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}},{"name":"anon_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Anon Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductLineSearchOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/distributor-search":{"get":{"summary":"Distributor Search","description":"Search the distributor inventory feed (aggregated by region).","operationId":"distributor_search_api_distributor_search_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","description":"SKU or search term","title":"Q"},"description":"SKU or search term"},{"name":"mode","in":"query","required":false,"schema":{"type":"string","description":"Search mode: exact, prefix, or contains","default":"prefix","title":"Mode"},"description":"Search mode: exact, prefix, or contains"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"description":"Max results","default":50,"title":"Limit"},"description":"Max results"},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DistributorSearchOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/register":{"post":{"summary":"Register","description":"Register a new user and send a verification email.","operationId":"register_api_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/verify":{"get":{"summary":"Verify Landing","description":"Landing page for the emailed verification link — does NOT consume the\ncode.  Same reason as /api/login: corporate mail scanners pre-fetch links,\nand verification codes are now single-use, so the human's click has to be\nthe POST below rather than this GET.","operationId":"verify_landing_api_verify_get","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string","title":"Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Verify Email","description":"Complete verification (button click): burn the code, set cookie, redirect.","operationId":"verify_email_api_verify_post","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string","title":"Code"}},{"name":"inv_next","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Next"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/send-login-link":{"post":{"summary":"Send Login Link","description":"Email a one-time sign-in link to a returning user.\n\nAlways returns the same neutral message so the endpoint can't be used to\nenumerate registered emails.","operationId":"send_login_link_api_send_login_link_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginLinkRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/login":{"get":{"summary":"Login Landing","description":"Landing page for the emailed sign-in link — does not consume the code.","operationId":"login_landing_api_login_get","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string","title":"Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Login Confirm","description":"Complete sign-in (button click): burn the code, set cookie, redirect.","operationId":"login_confirm_api_login_post","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string","title":"Code"}},{"name":"inv_next","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Next"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/complete-signin":{"post":{"summary":"Complete Signin","description":"Redeem a link/code pasted manually into the current browser.\n\nEmailed links always open in the OS's default browser, which may not be\nthe one the user is actually signing in on. The \"check your email\"\nscreen offers a paste-it-here fallback for that case — this endpoint is\nwhat it calls. It accepts either kind of code the app can email:\na returning-user sign-in code (``login_codes``) or a first-time\nregistration verify code (``verify_code``), trying the sign-in code\nfirst since it's the more common case, then falling back to verify.\nEither path sets the same session cookie on THIS browser.","operationId":"complete_signin_api_complete_signin_post","parameters":[{"name":"code","in":"query","required":true,"schema":{"type":"string","title":"Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/simple-visit":{"get":{"summary":"Simple Visit","description":"Called by the simple page on load: is this a returning unregistered\ndevice, and should it see the registration nudge this visit?\n\nUses the same anonymous-device record as the admin \"Anon\" tiles.  This\ntouches the AGGREGATE visit count (page=None), not the per-page\n\"searched from simple\" counter, so the admin page's per-page search\ncounts keep their meaning; the 30-minute session gap means reloads\nwithin a visit don't inflate the count.  Registered devices (inv_token\ncookie, shared across *.hpsx.com) are never nudged and are not\ntouched here — their visits are still recorded when they search.","operationId":"simple_visit_api_simple_visit_get","parameters":[{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}},{"name":"anon_id","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Anon Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimpleVisitOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/logout":{"get":{"summary":"Logout","description":"Sign out this browser.","operationId":"logout_logout_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/logout-everywhere":{"post":{"summary":"Logout Everywhere","description":"Sign out every device signed in with this email (new token).  POST,\nso a link on another site can't do it.","operationId":"logout_everywhere_api_logout_everywhere_post","parameters":[{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/me":{"get":{"summary":"Get Me","description":"Check if the user is registered and verified (and record the visit).","operationId":"get_me_api_me_get","parameters":[{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/users":{"get":{"summary":"Admin Users","description":"User analytics (token-guarded): visit counts, last-seen, top users.","operationId":"admin_users_api_admin_users_get","parameters":[{"name":"sort","in":"query","required":false,"schema":{"type":"string","description":"Sort by: visits, recent, or registered","default":"visits","title":"Sort"},"description":"Sort by: visits, recent, or registered"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Admin Delete User","description":"Delete a registration (token-guarded admin action).","operationId":"admin_delete_user_api_admin_users_delete","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string","description":"Email of the registration to delete","title":"Email"},"description":"Email of the registration to delete"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/distributor-summary":{"get":{"summary":"Admin Distributor Summary","description":"Per-distributor overview of the WH2 feed, one table per community\n(token-guarded).\n\nThis is the old \"WH2 Sun Data View\" workbook's Overview Summary tab —\ndistinct SKUs, total qty, as-of date, % of total and cumulative % for\nevery distributor — generated from the rows already loaded in memory\ninstead of a Power Query import.  Per-distributor totals are internal\nto HPS, which is why this sits behind the admin token rather than the\naggregate-only end-user endpoints.  `feed` echoes feed_info() so the\npage can show what file/communities the numbers came from.","operationId":"admin_distributor_summary_api_admin_distributor_summary_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/account-lookup":{"get":{"summary":"Admin Account Lookup","description":"Look up D365 customer accounts by website URL fragment (token-guarded).\n\n?q=cascorp.com → every account whose Dataverse `websiteurl` contains the\nfragment, with account number, name and the URL matched. Runs with the\napp's own service principal, so it works from the admin page even where\nJeff's network can't reach the Microsoft login endpoints directly.\n\nThis doubles as the first piece of the quote generator's\ndomain → CustomerAccount mapping (getCustomerPrice wants the account\nnumber); the endpoint stays admin-only — end users must never pick their\nown CustomerAccount.","operationId":"admin_account_lookup_api_admin_account_lookup_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","title":"Q"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/distributor-summary.pptx":{"get":{"summary":"Admin Distributor Summary Pptx","description":"The same summary as a PowerPoint deck (token-guarded): a title slide,\nthen per community a stats + native bar-chart slide and table slides.\nGenerated on demand from the rows in memory, so it is always as current\nas the last feed load.  The report page fetches this with the token\nheader and hands the bytes to the browser as a download.","operationId":"admin_distributor_summary_pptx_api_admin_distributor_summary_pptx_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/wh2-coverage":{"get":{"summary":"Admin Wh2 Coverage","description":"How much of the WH2 feed can D365 price? (token-guarded)\n\nEvery distinct feed SKU is classified against the D365 item catalog as\nexact, decomposed (Sun parser splits it into parts that are all items),\npartial (a part is missing) or unmatched — see pricing/coverage.py.\nGroundwork for the distributor inventory valuation and the quote\ngenerator.  `format=csv` streams the per-SKU detail for review.","operationId":"admin_wh2_coverage_api_admin_wh2_coverage_get","parameters":[{"name":"format","in":"query","required":false,"schema":{"type":"string","description":"json (summary) or csv","default":"json","title":"Format"},"description":"json (summary) or csv"},{"name":"by","in":"query","required":false,"schema":{"type":"string","description":"csv only: 'sku' (per-SKU detail) or 'distributor' (per-distributor tallies)","default":"sku","title":"By"},"description":"csv only: 'sku' (per-SKU detail) or 'distributor' (per-distributor tallies)"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/iv-raw":{"get":{"summary":"Admin Iv Raw","description":"Raw IV quantity measures per site for the given items — to verify how\n'available' is calculated (availphysical vs physicalinvent - reserved -\npicked ...) and which measure the WH2 upload should carry.  Read-only.","operationId":"admin_iv_raw_api_admin_iv_raw_get","parameters":[{"name":"items","in":"query","required":true,"schema":{"type":"string","description":"Comma-separated item numbers or Sun search names","title":"Items"},"description":"Comma-separated item numbers or Sun search names"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/dedup-dropped":{"get":{"summary":"Admin Dedup Dropped","description":"The exact rows the feed's snapshot dedup dropped (up to 50), with\nreasons — so 'N dedup dropped' on the panel can be inspected instead\nof trusted.","operationId":"admin_dedup_dropped_api_admin_dedup_dropped_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/fno-probe":{"get":{"summary":"Admin Fno Probe","description":"Read raw F&O OData records for the given items with the PRICING app\nregistration's token — used to discover whether the WH2-include checkbox\n(an F&O released-product field) is visible to us, and its field name.\nReturns each item's full record plus a diff of fields whose values\ndiffer between the first two items.  Admin-token guarded, read-only.","operationId":"admin_fno_probe_api_admin_fno_probe_get","parameters":[{"name":"items","in":"query","required":true,"schema":{"type":"string","description":"Comma-separated D365 item numbers, e.g. 109386,240671","title":"Items"},"description":"Comma-separated D365 item numbers, e.g. 109386,240671"},{"name":"entity","in":"query","required":false,"schema":{"type":"string","description":"F&O OData entity to query","default":"ReleasedProductsV2","title":"Entity"},"description":"F&O OData entity to query"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/price-change":{"get":{"summary":"Admin Price Change","description":"Customer price-change workbook: every item the account bought in the\nwindow, last unit price paid (invoice lines) and the new qty-1 net price\n(getCustomerPrice at the effective date).  xlsx = Summary / Detail /\nUpload / HPS-internal tabs; csv = the Upload tab alone; json = the rows\nfor a quick check.  See pricing/price_change.py for the data model.","operationId":"admin_price_change_api_admin_price_change_get","parameters":[{"name":"customer","in":"query","required":true,"schema":{"type":"string","maxLength":20,"description":"D365 CustomerAccount, e.g. 123886","title":"Customer"},"description":"D365 CustomerAccount, e.g. 123886"},{"name":"effective","in":"query","required":false,"schema":{"type":"string","maxLength":10,"description":"Effective date YYYY-MM-DD used as PriceDate (default today)","default":"","title":"Effective"},"description":"Effective date YYYY-MM-DD used as PriceDate (default today)"},{"name":"months","in":"query","required":false,"schema":{"type":"integer","maximum":60,"minimum":1,"description":"Invoice look-back window","default":12,"title":"Months"},"description":"Invoice look-back window"},{"name":"vendor","in":"query","required":false,"schema":{"type":"string","maxLength":20,"description":"SUN / HYDRAFORCE / DAMAN… (blank = every vendor)","default":"","title":"Vendor"},"description":"SUN / HYDRAFORCE / DAMAN… (blank = every vendor)"},{"name":"fmt","in":"query","required":false,"schema":{"type":"string","pattern":"^(xlsx|csv|json)$","default":"xlsx","title":"Fmt"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/price-compare":{"post":{"summary":"Admin Price Compare Start","description":"Start the price comparison in the background (read-only: OData reads\n+ getCustomerPrice).  Poll GET /api/admin/price-compare/status, then\nGET /api/admin/price-compare?fmt=xlsx|json.  See pricing/price_compare.py.","operationId":"admin_price_compare_start_api_admin_price_compare_post","parameters":[{"name":"since","in":"query","required":false,"schema":{"type":"string","format":"date","description":"Orders ENTERED on/after this date (price is set at order entry)","default":"2026-08-04","title":"Since"},"description":"Orders ENTERED on/after this date (price is set at order entry)"},{"name":"target","in":"query","required":false,"schema":{"type":"integer","maximum":2000,"minimum":10,"description":"Lines to sample","default":500,"title":"Target"},"description":"Lines to sample"},{"name":"seed","in":"query","required":false,"schema":{"type":"integer","description":"Sample seed — same seed, same sample","default":7,"title":"Seed"},"description":"Sample seed — same seed, same sample"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Admin Price Compare","operationId":"admin_price_compare_api_admin_price_compare_get","parameters":[{"name":"fmt","in":"query","required":false,"schema":{"type":"string","pattern":"^(xlsx|json)$","default":"xlsx","title":"Fmt"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/price-compare/replay":{"post":{"summary":"Admin Price Compare Replay","description":"Re-price the exact order lines of an earlier comparison workbook (the\n.xlsx as the raw request body) with today's service and agreements, the\nearlier service answer kept beside each line.  Same job, status and\ndownload as POST /api/admin/price-compare (read-only).","operationId":"admin_price_compare_replay_api_admin_price_compare_replay_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/price-compare/status":{"get":{"summary":"Admin Price Compare Status","operationId":"admin_price_compare_status_api_admin_price_compare_status_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/quote-requesters":{"post":{"summary":"Admin Quote Requesters Start","description":"Start the top-quote-requesters build in the background; poll GET\n/api/admin/quote-requesters/status, then download with\nGET /api/admin/quote-requesters?fmt=xlsx|csv|json.","operationId":"admin_quote_requesters_start_api_admin_quote_requesters_post","parameters":[{"name":"months","in":"query","required":false,"schema":{"type":"integer","maximum":60,"minimum":1,"description":"Look-back window on ReceiptDateRequested","default":12,"title":"Months"},"description":"Look-back window on ReceiptDateRequested"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Admin Quote Requesters","description":"Download the most recently built top-quote-requesters report (see\nPOST).  xlsx = ranked list + by-account roll-up; csv = ranked list;\njson = the same.  See pricing/quote_requesters.py.","operationId":"admin_quote_requesters_api_admin_quote_requesters_get","parameters":[{"name":"top","in":"query","required":false,"schema":{"type":"integer","maximum":5000,"minimum":0,"description":"Limit rows (0 = all)","default":0,"title":"Top"},"description":"Limit rows (0 = all)"},{"name":"fmt","in":"query","required":false,"schema":{"type":"string","pattern":"^(xlsx|csv|json)$","default":"xlsx","title":"Fmt"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/quote-requesters/status":{"get":{"summary":"Admin Quote Requesters Status","operationId":"admin_quote_requesters_status_api_admin_quote_requesters_status_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/fno-odata":{"get":{"summary":"Admin Fno Odata","description":"Generic READ-ONLY F&O OData probe with the pricing app's token —\nfor discovering where customer contacts / URLs live (Dataverse's\naccount+contact copies turned out incomplete).  Admin-token guarded;\nGET only; capped at 50 rows.","operationId":"admin_fno_odata_api_admin_fno_odata_get","parameters":[{"name":"entity","in":"query","required":true,"schema":{"type":"string","maxLength":80,"description":"F&O OData entity set, e.g. CustomersV3, ContactPersonsV2","title":"Entity"},"description":"F&O OData entity set, e.g. CustomersV3, ContactPersonsV2"},{"name":"filter","in":"query","required":false,"schema":{"type":"string","maxLength":400,"description":"OData $filter","default":"","title":"Filter"},"description":"OData $filter"},{"name":"select","in":"query","required":false,"schema":{"type":"string","maxLength":400,"description":"OData $select (comma-separated)","default":"","title":"Select"},"description":"OData $select (comma-separated)"},{"name":"top","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":5,"title":"Top"}},{"name":"cross_company","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Cross Company"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/vendor-price-check":{"get":{"summary":"Admin Vendor Price Check","description":"Next purchase cost research (web/vendor_price_check.py): primary vendor, the\nitem's order-quantity settings, and getVendorPrice at several quantities, raw.","operationId":"admin_vendor_price_check_api_admin_vendor_price_check_get","parameters":[{"name":"item","in":"query","required":true,"schema":{"type":"string","maxLength":20,"description":"HPS item number","title":"Item"},"description":"HPS item number"},{"name":"vendor","in":"query","required":false,"schema":{"type":"string","maxLength":20,"description":"Vendor account (blank = the item's primary vendor)","default":"","title":"Vendor"},"description":"Vendor account (blank = the item's primary vendor)"},{"name":"qty","in":"query","required":false,"schema":{"type":"number","maximum":100000,"minimum":0,"description":"Extra quantity to price","default":0,"title":"Qty"},"description":"Extra quantity to price"},{"name":"price_date","in":"query","required":false,"schema":{"type":"string","maxLength":10,"description":"Price date YYYY-MM-DD (blank = today)","default":"","title":"Price Date"},"description":"Price date YYYY-MM-DD (blank = today)"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/sun-po-check":{"get":{"summary":"Admin Sun Po Check","description":"Sun order-status API test (tracking/sun_orders.py): Sun's raw answer for one\nPO next to D365's lines for it.  The same PO within 15 minutes gets the saved\nanswer (Sun is not asked again).","operationId":"admin_sun_po_check_api_admin_sun_po_check_get","parameters":[{"name":"po","in":"query","required":true,"schema":{"type":"string","maxLength":20,"description":"Our purchase order number","title":"Po"},"description":"Our purchase order number"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/vendor-price-po-compare":{"post":{"summary":"Admin Po Price Compare Start","description":"getVendorPrice vs the prices D365 put on recent purchase-order lines (background, read-only).","operationId":"admin_po_price_compare_start_api_admin_vendor_price_po_compare_post","parameters":[{"name":"lines","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":10,"default":200,"title":"Lines"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Admin Po Price Compare Status","operationId":"admin_po_price_compare_status_api_admin_vendor_price_po_compare_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/access-check":{"get":{"summary":"Admin Access Check","description":"Can the site's credentials still read everything the code uses?  One\nsmall read per D365 entity / service with the site's own credentials;\nreturns status codes and field names only (web/access_check.py).\nAdmin-token guarded, read-only, ~10-30 s.","operationId":"admin_access_check_api_admin_access_check_get","parameters":[{"name":"item","in":"query","required":false,"schema":{"type":"string","maxLength":20,"description":"Item for the price and inventory checks","default":"137275","title":"Item"},"description":"Item for the price and inventory checks"},{"name":"customer","in":"query","required":false,"schema":{"type":"string","maxLength":20,"description":"Customer for the price check (blank = PRICING_CUSTOMER_ACCOUNT)","default":"","title":"Customer"},"description":"Customer for the price check (blank = PRICING_CUSTOMER_ACCOUNT)"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/product-source-compare":{"post":{"summary":"Admin Product Compare Start","description":"Start the Dataverse-vs-F&O product comparison in the background\n(read-only).  Poll GET /api/admin/product-source-compare for progress\nand the result.","operationId":"admin_product_compare_start_api_admin_product_source_compare_post","parameters":[{"name":"vendor_field","in":"query","required":false,"schema":{"type":"string","maxLength":80,"description":"Dataverse vendor column (blank = find it)","default":"","title":"Vendor Field"},"description":"Dataverse vendor column (blank = find it)"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Admin Product Compare Status","operationId":"admin_product_compare_status_api_admin_product_source_compare_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/sales-order-v3-compare":{"post":{"summary":"Admin So Compare Start","description":"Start the V2-vs-V3 sales order comparison in the background (read-only).\nPoll GET /api/admin/sales-order-v3-compare.","operationId":"admin_so_compare_start_api_admin_sales_order_v3_compare_post","parameters":[{"name":"sample","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":10,"description":"Most recent orders to compare","default":200,"title":"Sample"},"description":"Most recent orders to compare"},{"name":"v3_headers","in":"query","required":false,"schema":{"type":"string","maxLength":80,"description":"V3 header entity (blank = find it)","default":"","title":"V3 Headers"},"description":"V3 header entity (blank = find it)"},{"name":"v3_lines","in":"query","required":false,"schema":{"type":"string","maxLength":80,"description":"V3 line entity (blank = find it)","default":"","title":"V3 Lines"},"description":"V3 line entity (blank = find it)"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Admin So Compare Status","operationId":"admin_so_compare_status_api_admin_sales_order_v3_compare_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/anon-stats":{"get":{"summary":"Admin Anon Stats","description":"Aggregate stats for unregistered (anonymous) visitors, token-guarded.\n\nNo per-visitor detail here on purpose — an anon_id has no name/company\nattached to it, so there's nothing to list per-row like the registered\nusers table. Just enough to answer \"is anyone actually using the page\nwithout registering, and how much.\"","operationId":"admin_anon_stats_api_admin_anon_stats_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/tracking":{"get":{"summary":"Admin Tracking","description":"D365 shipments for an order / PO / packing slip / account, each\npackage with live FedEx / UPS / eShipping (LTL) status — or (by=number) one raw tracking\nnumber straight to the carrier.  Staff view: no account gate.","operationId":"admin_tracking_api_admin_tracking_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","maxLength":40,"description":"Order, customer PO, packing slip, account, or a raw tracking number","title":"Q"},"description":"Order, customer PO, packing slip, account, or a raw tracking number"},{"name":"by","in":"query","required":false,"schema":{"type":"string","description":"any | so | po | ps | invoice | tracking | account | number","default":"any","title":"By"},"description":"any | so | po | ps | invoice | tracking | account | number"},{"name":"carrier","in":"query","required":false,"schema":{"type":"string","description":"by=number only: fedex | ups | eshipping (blank = detect; short numeric = LTL PRO via eShipping)","default":"","title":"Carrier"},"description":"by=number only: fedex | ups | eshipping (blank = detect; short numeric = LTL PRO via eShipping)"},{"name":"live","in":"query","required":false,"schema":{"type":"boolean","description":"Ask the carrier for live status","default":true,"title":"Live"},"description":"Ask the carrier for live status"},{"name":"raw","in":"query","required":false,"schema":{"type":"boolean","description":"by=number only: include the carrier's raw response","default":false,"title":"Raw"},"description":"by=number only: include the carrier's raw response"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/tracking/pod":{"get":{"summary":"Admin Tracking Pod","description":"Proof of delivery file: FedEx signature POD (PDF), the UPS POD\nletter, or the eShipping PROOF_OF_DELIVERY document (LTL).","operationId":"admin_tracking_pod_api_admin_tracking_pod_get","parameters":[{"name":"carrier","in":"query","required":true,"schema":{"type":"string","description":"fedex | ups | eshipping (other / freight also mean eShipping)","title":"Carrier"},"description":"fedex | ups | eshipping (other / freight also mean eShipping)"},{"name":"number","in":"query","required":true,"schema":{"type":"string","maxLength":40,"title":"Number"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/memory":{"get":{"summary":"Admin Memory","description":"Where the memory is (2026-10-06 OOM restarts).  ``trim`` answers\n\"is it held, or freed-but-not-returned?\"; ``census`` answers \"held by\nwhat?\".","operationId":"admin_memory_api_admin_memory_get","parameters":[{"name":"trim","in":"query","required":false,"schema":{"type":"boolean","description":"gc + malloc_trim, report before/after","default":false,"title":"Trim"},"description":"gc + malloc_trim, report before/after"},{"name":"census","in":"query","required":false,"schema":{"type":"boolean","description":"live objects by type (takes a second or two)","default":false,"title":"Census"},"description":"live objects by type (takes a second or two)"},{"name":"top","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":5,"default":25,"title":"Top"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/agents/summary":{"get":{"summary":"Agents Summary","operationId":"agents_summary_api_admin_agents_summary_get","parameters":[{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":400,"minimum":1,"default":30,"title":"Days"}},{"name":"clock","in":"query","required":false,"schema":{"type":"string","pattern":"^(agent|company)$","default":"agent","title":"Clock"}},{"name":"team","in":"query","required":false,"schema":{"type":"string","default":"","title":"Team"}},{"name":"agent","in":"query","required":false,"schema":{"type":"string","default":"","title":"Agent"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/agents/export":{"get":{"summary":"Agents Export","operationId":"agents_export_api_admin_agents_export_get","parameters":[{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":400,"minimum":1,"default":30,"title":"Days"}},{"name":"clock","in":"query","required":false,"schema":{"type":"string","pattern":"^(agent|company)$","default":"agent","title":"Clock"}},{"name":"team","in":"query","required":false,"schema":{"type":"string","default":"","title":"Team"}},{"name":"agent","in":"query","required":false,"schema":{"type":"string","default":"","title":"Agent"}},{"name":"what","in":"query","required":false,"schema":{"type":"string","pattern":"^(agents|days)$","default":"agents","title":"What"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/agents/staff":{"get":{"summary":"Agents Staff","operationId":"agents_staff_api_admin_agents_staff_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Agents Staff Save","operationId":"agents_staff_save_api_admin_agents_staff_put","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Rows"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/agents/staff/{pid}":{"delete":{"summary":"Agents Staff Delete","operationId":"agents_staff_delete_api_admin_agents_staff__pid__delete","parameters":[{"name":"pid","in":"path","required":true,"schema":{"type":"string","title":"Pid"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/agents/staff/sync":{"post":{"summary":"Agents Staff Sync","operationId":"agents_staff_sync_api_admin_agents_staff_sync_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/agents/refresh":{"post":{"summary":"Agents Refresh","operationId":"agents_refresh_api_admin_agents_refresh_post","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"number","maximum":400,"exclusiveMinimum":0,"default":2,"title":"Days"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/agents/history":{"post":{"summary":"Agents History","description":"Load (or resume) the history, newest month first; finished months are\nskipped on a resume.  Poll /api/admin/agents/refresh/status.","operationId":"agents_history_api_admin_agents_history_post","parameters":[{"name":"months","in":"query","required":false,"schema":{"type":"integer","maximum":24,"minimum":1,"default":12,"title":"Months"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/agents/refresh/status":{"get":{"summary":"Agents Refresh Status","operationId":"agents_refresh_status_api_admin_agents_refresh_status_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/agents/probe":{"get":{"summary":"Agents Probe","operationId":"agents_probe_api_admin_agents_probe_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/agents/snapshot":{"post":{"summary":"Agents Snapshot","operationId":"agents_snapshot_api_admin_agents_snapshot_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/agents/snapshot/status":{"get":{"summary":"Agents Snapshot Status","operationId":"agents_snapshot_status_api_admin_agents_snapshot_status_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/agents/rules":{"get":{"summary":"Agents Rules","operationId":"agents_rules_api_admin_agents_rules_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Agents Rules Save","operationId":"agents_rules_save_api_admin_agents_rules_put","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/bom/read":{"post":{"summary":"Admin Bom Read","operationId":"admin_bom_read_api_admin_bom_read_post","parameters":[{"name":"filename","in":"query","required":false,"schema":{"type":"string","maxLength":200,"default":"","title":"Filename"}},{"name":"fmt","in":"query","required":false,"schema":{"type":"string","pattern":"^(xlsx|json)$","default":"xlsx","title":"Fmt"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/bom/match":{"post":{"summary":"Admin Bom Match","operationId":"admin_bom_match_api_admin_bom_match_post","parameters":[{"name":"filename","in":"query","required":false,"schema":{"type":"string","maxLength":200,"default":"","title":"Filename"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/bom/match/status":{"get":{"summary":"Admin Bom Match Status","operationId":"admin_bom_match_status_api_admin_bom_match_status_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/bom/match/download":{"get":{"summary":"Admin Bom Match Download","operationId":"admin_bom_match_download_api_admin_bom_match_download_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/bom/products/refresh":{"post":{"summary":"Admin Bom Products Refresh","operationId":"admin_bom_products_refresh_api_admin_bom_products_refresh_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/ship-outlook/run":{"post":{"summary":"Run","operationId":"run_api_admin_ship_outlook_run_post","parameters":[{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End"}},{"name":"by","in":"query","required":false,"schema":{"type":"string","default":"requested","title":"By"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/ship-outlook/status":{"get":{"summary":"Status","operationId":"status_api_admin_ship_outlook_status_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/ship-outlook/csv":{"get":{"summary":"Csv Download","operationId":"csv_download_api_admin_ship_outlook_csv_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/hf-naming-audit":{"get":{"summary":"Admin Hf Naming Audit","description":"Which identifier each D365 HydraForce item is set up under (token-guarded).\n\nClassifies every HYDRAFORCE vendor item's search name against the\nHydraForce price file: hf_item / model_code (fine), r_number /\nch_material (should be renamed — suggested_name given), not_in_file.\nData-cleanup hand-off, not a pricing decision — see pricing/naming_audit.py.","operationId":"admin_hf_naming_audit_api_admin_hf_naming_audit_get","parameters":[{"name":"format","in":"query","required":false,"schema":{"type":"string","description":"json (summary + fix list) or csv","default":"json","title":"Format"},"description":"json (summary + fix list) or csv"},{"name":"only","in":"query","required":false,"schema":{"type":"string","description":"csv only: comma-separated name_type filter, e.g. r_number,ch_material","default":"","title":"Only"},"description":"csv only: comma-separated name_type filter, e.g. r_number,ch_material"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/price-group-survey":{"get":{"summary":"Admin Price Group Survey","description":"PriceDiscGroup across EVERY customer — validates the 2nd-character ->\nOEM / RESELLER / USER mapping in pricing/customer.py on the full list.\nBackground job; poll with action=status.  Admin-token guarded.","operationId":"admin_price_group_survey_api_admin_price_group_survey_get","parameters":[{"name":"action","in":"query","required":false,"schema":{"type":"string","description":"status | start","default":"status","title":"Action"},"description":"status | start"},{"name":"method","in":"query","required":false,"schema":{"type":"string","description":"auto | fno (OData CustomersV3 only) | pricing (getCustomerPrice per account)","default":"auto","title":"Method"},"description":"auto | fno (OData CustomersV3 only) | pricing (getCustomerPrice per account)"},{"name":"company","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"F&O legal entity (dataAreaId) filter for the OData read","title":"Company"},"description":"F&O legal entity (dataAreaId) filter for the OData read"},{"name":"format","in":"query","required":false,"schema":{"type":"string","description":"json | csv (per-customer rows of the last completed survey)","default":"json","title":"Format"},"description":"json | csv (per-customer rows of the last completed survey)"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/customer-profile":{"get":{"summary":"Admin Customer Profile","description":"OEM / RESELLER / USER for one account (token-guarded) — read from\nthe PriceDiscGroup that getCustomerPrice echoes for a reference item.\nSee pricing/customer.py for the mapping; the quote generator will use\nthe same profile to decide net-only vs list − discount presentation.","operationId":"admin_customer_profile_api_admin_customer_profile_get","parameters":[{"name":"account","in":"query","required":true,"schema":{"type":"string","description":"D365 CustomerAccount","title":"Account"},"description":"D365 CustomerAccount"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/price-lookup":{"get":{"summary":"Admin Price Lookup","description":"Admin-only, all-sources lookup for ONE part number: PPIF list price,\nD365 match + availability (+ getCustomerPrice when configured), WH2\ndistributor stock and the Sun Storefront.  The process itself lives in\npricing/engine.py (shared with the CLI and, later, the quote generator);\nthis route only authenticates and serialises.","operationId":"admin_price_lookup_api_admin_price_lookup_get","parameters":[{"name":"item","in":"query","required":true,"schema":{"type":"string","description":"Sun part number to validate and price","title":"Item"},"description":"Sun part number to validate and price"},{"name":"qty","in":"query","required":false,"schema":{"type":"number","exclusiveMinimum":0,"default":1,"title":"Qty"}},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"CustomerAccount override for the D365 price","title":"Customer"},"description":"CustomerAccount override for the D365 price"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/pricing/lookup":{"get":{"summary":"Pricing Lookup","description":"The quote line for one part and one customer — the endpoint the\ninventory pages, quote generator and order-entry vendor call.\n\nReturns pricing/quote.py's QuotedLine: net EACH primary, tariff each,\nextended, and the presentation chosen by customer type (OEM/USER net\nonly; RESELLER list − discount).  Authorization: admin token, or a\nverified magic-link session (``pricing_user``).\n\nOnly HPS staff may price as any account or ask for ``detail``.  A\ncustomer is priced ONLY as their own account — the same resolution the\nquote generator uses — and gets the customer-safe fields only (code\naudit 2026-09-20, fixed 2026-09-23).","operationId":"pricing_lookup_api_pricing_lookup_get","parameters":[{"name":"item","in":"query","required":true,"schema":{"type":"string","description":"Part number: Sun code, HF item #, R-number or model code","title":"Item"},"description":"Part number: Sun code, HF item #, R-number or model code"},{"name":"qty","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Qty"}},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"D365 CustomerAccount (default: PRICING_CUSTOMER_ACCOUNT)","title":"Customer"},"description":"D365 CustomerAccount (default: PRICING_CUSTOMER_ACCOUNT)"},{"name":"detail","in":"query","required":false,"schema":{"type":"boolean","description":"Also return the full engine result (every source)","default":false,"title":"Detail"},"description":"Also return the full engine result (every source)"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/quote/context":{"get":{"summary":"Quote Context","description":"Who is quoting, which customer they are priced as, and the form defaults.","operationId":"quote_context_api_quote_context_get","parameters":[{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"CustomerAccount override (HPS staff only)","title":"Customer"},"description":"CustomerAccount override (HPS staff only)"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/quote/line":{"get":{"summary":"Quote Line Route","description":"Validate one part number against D365 and price it for the quote customer.","operationId":"quote_line_route_api_quote_line_get","parameters":[{"name":"item","in":"query","required":true,"schema":{"type":"string","description":"Part number as typed","title":"Item"},"description":"Part number as typed"},{"name":"qty","in":"query","required":false,"schema":{"type":"integer","maximum":100000,"minimum":1,"default":1,"title":"Qty"}},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"CustomerAccount override (HPS staff only)","title":"Customer"},"description":"CustomerAccount override (HPS staff only)"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/quote/parts":{"get":{"summary":"Quote Parts","description":"Typeahead for the quote's part box: this customer's OWN part numbers\n(from D365 external item descriptions) first, then our item numbers /\nsearch names beginning with the text (live inventory, same source as\nSmart Search).  Long HydraForce numbers are the reason this exists.","operationId":"quote_parts_api_quote_parts_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":2,"maxLength":60,"description":"part number prefix","title":"Q"},"description":"part number prefix"},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"CustomerAccount override (HPS staff only)","title":"Customer"},"description":"CustomerAccount override (HPS staff only)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":25,"minimum":1,"default":10,"title":"Limit"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/quote/customers":{"get":{"summary":"Quote Customers","description":"Staff customer finder — see pricing/customer_finder.py.  Logs the\nsearch (and an unmatched email) for the data-quality list.","operationId":"quote_customers_api_quote_customers_get","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":120,"description":"email, company name, domain or account #","default":"","title":"Q"},"description":"email, company name, domain or account #"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/quote/contacts":{"get":{"summary":"Quote Contacts","description":"Active D365 contacts on one account — the ATTN / email pick-list.\nEach contact carries a domain-vs-website check for the cleanup list.","operationId":"quote_contacts_api_quote_contacts_get","parameters":[{"name":"account","in":"query","required":true,"schema":{"type":"string","description":"D365 CustomerAccount","title":"Account"},"description":"D365 CustomerAccount"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/quote/finder-event":{"post":{"summary":"Quote Finder Event","description":"Staff picked a customer: log the choice; log a mismatch when the\nemail they searched with lives under a different domain than the account.","operationId":"quote_finder_event_api_quote_finder_event_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FinderEventIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/customer-index":{"get":{"summary":"Admin Customer Index","description":"F&O customer index: what is in it, when it was built, and a forced rebuild.","operationId":"admin_customer_index_api_admin_customer_index_get","parameters":[{"name":"action","in":"query","required":false,"schema":{"type":"string","description":"status | refresh","default":"status","title":"Action"},"description":"status | refresh"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/domain-health":{"get":{"summary":"Admin Domain Health","description":"Did IT's bulk website write land, and how clean is it?  Accounts by\nwebsite state; registered-user domains -> 0 / 1 / many accounts; the\nfinder's mismatch + unmatched-email log.  Rerunnable any time.","operationId":"admin_domain_health_api_admin_domain_health_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/quote":{"post":{"summary":"Create Quote","description":"Re-price every line server-side, number the quotation and store it.","operationId":"create_quote_api_quote_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuoteIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/quote/help":{"post":{"summary":"Request Help","description":"Save a mostly-finished quote as a HELP request (its own WQ- number),\nwith the lines that priced, the ones that did not (and why) and the\ncustomer's note; tell sales.  Staff then open it in the builder, fix\nit and issue the quotation, which resolves the request.","operationId":"request_help_api_quote_help_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HelpIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Open Help Requests","description":"Staff: help requests waiting for sales (or recently resolved).","operationId":"open_help_requests_api_quote_help_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","pattern":"^(help|resolved)$","default":"help","title":"Status"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/quote/help/{number}/resolve":{"post":{"summary":"Resolve Help","description":"Staff: close a help request without issuing a quotation from it.","operationId":"resolve_help_api_quote_help__number__resolve_post","parameters":[{"name":"number","in":"path","required":true,"schema":{"type":"string","title":"Number"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/quote/{number}/price":{"post":{"summary":"Add Line Price","description":"HPS staff put a price on a \"Price available on request\" line of an\nISSUED quotation (or correct one they added earlier).  Same quote\nnumber; the revision goes up, totals are recomputed, and the price is\nlogged for the pricing department (GET /api/admin/quote-price-updates).","operationId":"add_line_price_api_quote__number__price_post","parameters":[{"name":"number","in":"path","required":true,"schema":{"type":"string","title":"Number"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinePriceIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/quote-price-updates":{"get":{"summary":"Quote Price Updates","description":"Every price staff added to a quotation after it was issued — HPS\nmanifolds and parts with no D365 price.  CSV for the pricing department.","operationId":"quote_price_updates_api_admin_quote_price_updates_get","parameters":[{"name":"format","in":"query","required":false,"schema":{"type":"string","pattern":"^(json|csv)$","default":"json","title":"Format"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/quote-overrides":{"get":{"summary":"Quote Overrides","description":"Log of staff price overrides (no approval step — visibility only).","operationId":"quote_overrides_api_admin_quote_overrides_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/quote/recent":{"get":{"summary":"Recent Quotes","description":"Recent quotations: one's own by default; HPS staff may ask for\neveryone's (scope=all).  Customers only ever see their own.","operationId":"recent_quotes_api_quote_recent_get","parameters":[{"name":"scope","in":"query","required":false,"schema":{"type":"string","pattern":"^(mine|all)$","default":"mine","title":"Scope"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":80,"description":"quote number, customer name or account #","default":"","title":"Q"},"description":"quote number, customer name or account #"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":30,"title":"Limit"}},{"name":"awaiting","in":"query","required":false,"schema":{"type":"boolean","description":"only quotations with lines waiting for a price","default":false,"title":"Awaiting"},"description":"only quotations with lines waiting for a price"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/quote/{number}":{"get":{"summary":"Get Quote","description":"A stored quotation: staff see everything; the requester, or anyone\nholding the signed link from the email, sees the customer copy.","operationId":"get_quote_api_quote__number__get","parameters":[{"name":"number","in":"path","required":true,"schema":{"type":"string","title":"Number"}},{"name":"t","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"signed view token from an emailed link","title":"T"},"description":"signed view token from an emailed link"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/quote/{number}/pdf":{"get":{"summary":"Quote Pdf","description":"The quotation as a PDF (same access rules as the JSON: staff, the\nrequester, or the signed link).  Customers get the redacted copy.","operationId":"quote_pdf_api_quote__number__pdf_get","parameters":[{"name":"number","in":"path","required":true,"schema":{"type":"string","title":"Number"}},{"name":"t","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"T"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/quote/{number}/email":{"post":{"summary":"Email Quote","description":"Email a stored quotation to the customer with a personal note from\nthe rep and a signed link to the printable copy.  Staff only for now;\nthe sender's address is the reply-to.  Logged on the document.","operationId":"email_quote_api_quote__number__email_post","parameters":[{"name":"number","in":"path","required":true,"schema":{"type":"string","title":"Number"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailQuoteIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/ups-bill/upload":{"post":{"summary":"Upload","operationId":"upload_api_admin_ups_bill_upload_post","parameters":[{"name":"filename","in":"query","required":false,"schema":{"type":"string","maxLength":200,"default":"","title":"Filename"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/ups-bill/weeks":{"get":{"summary":"Weeks","operationId":"weeks_api_admin_ups_bill_weeks_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/ups-bill/report":{"get":{"summary":"Week Report","operationId":"week_report_api_admin_ups_bill_report_get","parameters":[{"name":"week","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"title":"Week"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/ups-bill/csv":{"get":{"summary":"Week Csv","operationId":"week_csv_api_admin_ups_bill_csv_get","parameters":[{"name":"week","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"title":"Week"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/distributor-reload":{"post":{"summary":"Distributor Reload","description":"Start a distributor feed refresh in the background and return at once.\nPoll GET /api/distributor-reload for the outcome (status running/done/\nerror; `result` carries source + feed_info, and 'stale' means it fell\nback to the cached copy — see download_error).","operationId":"distributor_reload_api_distributor_reload_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Distributor Reload Status","description":"Status of the last manual feed refresh.  Admin-only: the result\ncarries download_error text from the WH2/files.com clients, which is\noperational detail (and, historically, could echo request URLs).","operationId":"distributor_reload_status_api_distributor_reload_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/wh2-upload-audit":{"get":{"summary":"Admin Wh2 Upload Audit","description":"What we stock in D365 (Sun) vs what HPS has posted on WH2 — see\ndistributor/upload_audit.py.  Runs in a background thread because the\nIV walk over every Sun item takes a minute or two; poll with\naction=status.  Admin-token guarded.","operationId":"admin_wh2_upload_audit_api_admin_wh2_upload_audit_get","parameters":[{"name":"action","in":"query","required":false,"schema":{"type":"string","description":"status | start","default":"status","title":"Action"},"description":"status | start"},{"name":"format","in":"query","required":false,"schema":{"type":"string","description":"json | csv (last completed result)","default":"json","title":"Format"},"description":"json | csv (last completed result)"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/wh2-upload-check":{"post":{"summary":"Admin Wh2 Upload Check","description":"Compare an HPS -> WH2 upload file (Bob's pipe format, sent as the raw\nrequest body) against our own posts in the loaded feed, per community and\nlocation — did WH2 take every line?  Admin-token guarded.","operationId":"admin_wh2_upload_check_api_admin_wh2_upload_check_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/wh2-upload-generate":{"get":{"summary":"Admin Wh2 Upload Generate","description":"Generate the combined HPS -> WH2 upload file from D365 (dry run —\nnothing is pushed).  Background thread; poll with action=status.\nformat=file downloads the last generated file.","operationId":"admin_wh2_upload_generate_api_admin_wh2_upload_generate_get","parameters":[{"name":"action","in":"query","required":false,"schema":{"type":"string","description":"status | start","default":"status","title":"Action"},"description":"status | start"},{"name":"format","in":"query","required":false,"schema":{"type":"string","description":"json | file (last generated upload file)","default":"json","title":"Format"},"description":"json | file (last generated upload file)"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/wh2-vendor-lines":{"get":{"summary":"Admin Wh2 Vendor Lines Get","description":"The vendor-account -> WH2 product line mapping the generator uses\n(persisted on /data; editable so future vendors need no deploy).","operationId":"admin_wh2_vendor_lines_get_api_admin_wh2_vendor_lines_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Admin Wh2 Vendor Lines Put","operationId":"admin_wh2_vendor_lines_put_api_admin_wh2_vendor_lines_put","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/wh2-upload-push":{"post":{"summary":"Admin Wh2 Upload Push","description":"Push the last generated upload file to WH2 over SFTP — the manual\nbutton on the panel.  See _do_wh2_push for mechanics and guards.  The\nevening push's safety floors apply here too; ``force=true`` overrides\nthem after the panel has shown the reason and asked again.","operationId":"admin_wh2_upload_push_api_admin_wh2_upload_push_post","parameters":[{"name":"force","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Force"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/wh2-ftp-test":{"post":{"summary":"Admin Wh2 Sftp Test","description":"Prove Render can reach and log into WH2's upload server before any\npush.  Read-only: SFTP (port 22) connect + auth + directory listing.","operationId":"admin_wh2_sftp_test_api_admin_wh2_ftp_test_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/wh2-flag-candidates":{"get":{"summary":"Admin Wh2 Flag Candidates","description":"Items of one vendor that HAVE stock in D365 but are NOT flagged\nWarehouse2 = Yes — the list to bulk-flag in D365 (we never write the\nflag ourselves).  Reads the Dataverse product master (the same columns\nthe nightly upload uses, jobs/wh2_generate.py) + live IV availability.","operationId":"admin_wh2_flag_candidates_api_admin_wh2_flag_candidates_get","parameters":[{"name":"vendor","in":"query","required":true,"schema":{"type":"string","description":"D365 primary vendor account, e.g. 1455","title":"Vendor"},"description":"D365 primary vendor account, e.g. 1455"},{"name":"format","in":"query","required":false,"schema":{"type":"string","pattern":"^(json|csv)$","default":"json","title":"Format"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/wh2-panel":{"get":{"summary":"Admin Wh2 Panel","description":"Snapshot for the HPS WH2 Control Panel page: current feed + HPS rows\nper community, plus the persisted last refresh / upload check / audit.","operationId":"admin_wh2_panel_api_admin_wh2_panel_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/wh2-history":{"get":{"summary":"Admin Wh2 History","description":"Days recorded, per-day counts (new / changed / gone / locations carried\nforward), storage used, and the last nightly recording outcome.","operationId":"admin_wh2_history_api_admin_wh2_history_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":400,"minimum":1,"default":60,"title":"Limit"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/wh2-history/collisions":{"get":{"summary":"Admin Wh2 History Collisions","description":"In the feed loaded now: raw SKUs reported under more than one product\nline at the same company location (merged into one position before the\nproduct line became part of the history key).","operationId":"admin_wh2_history_collisions_api_admin_wh2_history_collisions_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/wh2-history/rebuild":{"post":{"summary":"Admin Wh2 History Rebuild","description":"Re-record every day of history from the saved raw feed files with the\ncurrent rules (background job; poll GET …/rebuild).  The old database\nis kept beside the new one as wh2_history.sqlite3.before-rebuild.","operationId":"admin_wh2_history_rebuild_api_admin_wh2_history_rebuild_post","parameters":[{"name":"allow_loss","in":"query","required":false,"schema":{"type":"boolean","description":"rebuild even if the oldest archive is newer than the first recorded day","default":false,"title":"Allow Loss"},"description":"rebuild even if the oldest archive is newer than the first recorded day"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Admin Wh2 History Rebuild Status","operationId":"admin_wh2_history_rebuild_status_api_admin_wh2_history_rebuild_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/wh2-history/changes.csv":{"get":{"summary":"Admin Wh2 History Changes","description":"Every quantity movement at other distributors between consecutive\ndays, as CSV (kind = new / up / down / gone; delta is signed).","operationId":"admin_wh2_history_changes_api_admin_wh2_history_changes_csv_get","parameters":[{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"YYYY-MM-DD","title":"Start"},"description":"YYYY-MM-DD"},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"YYYY-MM-DD","title":"End"},"description":"YYYY-MM-DD"},{"name":"sku","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"any SKU spelling","title":"Sku"},"description":"any SKU spelling"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/home":{"get":{"summary":"Home Context","description":"What a signed-in visitor's landing page (static/home.html) offers:\ntheir name and company names, and which tools they can open.  Quotes are\nopen to every registered user; tracking and order status need a D365\ncontact on an account (the same check /api/track makes).  No account\nnumbers (customer-facing).","operationId":"home_context_api_home_get","parameters":[{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/track/context":{"get":{"summary":"Track Context","operationId":"track_context_api_track_context_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/track":{"get":{"summary":"Track Lookup","operationId":"track_lookup_api_track_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","maxLength":40,"description":"Any order, PO, packing slip, invoice or tracking number (by=any), or an account number (by=account)","title":"Q"},"description":"Any order, PO, packing slip, invoice or tracking number (by=any), or an account number (by=account)"},{"name":"by","in":"query","required":false,"schema":{"type":"string","description":"any | po | so | ps | invoice | tracking | account","default":"any","title":"By"},"description":"any | po | so | ps | invoice | tracking | account"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/track/pod.pdf":{"get":{"summary":"Track Pod Pdf","description":"Proof of delivery as application/pdf (carrier PDF passed through; UPS\nletter / signature images drawn as PDF).  404 until there is one.","operationId":"track_pod_pdf_api_track_pod_pdf_get","parameters":[{"name":"so","in":"query","required":true,"schema":{"type":"string","maxLength":20,"description":"Sales order the package belongs to","title":"So"},"description":"Sales order the package belongs to"},{"name":"number","in":"query","required":true,"schema":{"type":"string","maxLength":40,"description":"Tracking number","title":"Number"},"description":"Tracking number"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/track/pod":{"get":{"summary":"Track Pod","description":"Proof of delivery for one package — only if that package is on an\norder the caller may see.","operationId":"track_pod_api_track_pod_get","parameters":[{"name":"so","in":"query","required":true,"schema":{"type":"string","maxLength":20,"description":"Sales order the package belongs to","title":"So"},"description":"Sales order the package belongs to"},{"name":"number","in":"query","required":true,"schema":{"type":"string","maxLength":40,"description":"Tracking number","title":"Number"},"description":"Tracking number"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/public/order":{"get":{"summary":"Public Order","operationId":"public_order_api_public_order_get","parameters":[{"name":"so","in":"query","required":true,"schema":{"type":"string","maxLength":20,"title":"So"}},{"name":"e","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"E"}},{"name":"k","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"K"}},{"name":"po","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Po"}},{"name":"r","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":24},{"type":"null"}],"description":"Send id of a per-recipient link (tracking/sends.py)","title":"R"},"description":"Send id of a per-recipient link (tracking/sends.py)"},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/public/pod":{"get":{"summary":"Public Pod","description":"POD for a package on the order the link opens — or, for a statement\nor order-status link (acct=…), on any order of that account (a limited\nlink: only its orders).","operationId":"public_pod_api_public_pod_get","parameters":[{"name":"so","in":"query","required":true,"schema":{"type":"string","maxLength":20,"title":"So"}},{"name":"number","in":"query","required":true,"schema":{"type":"string","maxLength":40,"title":"Number"}},{"name":"e","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"E"}},{"name":"k","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"K"}},{"name":"po","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Po"}},{"name":"acct","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Acct"}},{"name":"only","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":600},{"type":"null"}],"description":"Order-status link limited to these orders (comma-separated)","title":"Only"},"description":"Order-status link limited to these orders (comma-separated)"},{"name":"r","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":24},{"type":"null"}],"description":"Send id of a per-recipient link (tracking/sends.py)","title":"R"},"description":"Send id of a per-recipient link (tracking/sends.py)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/public/claim":{"post":{"summary":"Public Claim","description":"From a no-login order page: 'send me a sign-in link'.","operationId":"public_claim_api_public_claim_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/public/statement":{"get":{"summary":"Public Statement","description":"The statement a signed link opens.  status=false returns D365 data\nfast; the page then asks for status=true (carrier calls).","operationId":"public_statement_api_public_statement_get","parameters":[{"name":"acct","in":"query","required":true,"schema":{"type":"string","maxLength":20,"title":"Acct"}},{"name":"e","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"E"}},{"name":"k","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"K"}},{"name":"status","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Status"}},{"name":"r","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":24},{"type":"null"}],"description":"Send id of a per-recipient link (tracking/sends.py)","title":"R"},"description":"Send id of a per-recipient link (tracking/sends.py)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/track/order-link":{"get":{"summary":"Staff Order Link","description":"A no-login link to one order, logged per recipient.  Scripts (the AR\ncollections job) may leave ``recipient`` out (\"(not given)\"); people\nmust say who it's for (the tracking page uses /api/links/issue, which\nalso checks the address).","operationId":"staff_order_link_api_track_order_link_get","parameters":[{"name":"so","in":"query","required":true,"schema":{"type":"string","maxLength":20,"title":"So"}},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":365,"minimum":1},{"type":"null"}],"description":"Link lifetime in days (default: the site setting; at most 120 — longer asks get 120)","title":"Days"},"description":"Link lifetime in days (default: the site setting; at most 120 — longer asks get 120)"},{"name":"recipient","in":"query","required":false,"schema":{"type":"string","maxLength":200,"description":"Who this link is for (logged)","default":"","title":"Recipient"},"description":"Who this link is for (logged)"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/statement":{"get":{"summary":"Staff Statement","description":"The statement for staff.  Server-to-server callers (the AR\ncollections script) also get a no-login link — one per call, logged\nunder ``recipient``.  People get links from /api/links/issue, which asks\nwho the link is for.","operationId":"staff_statement_api_statement_get","parameters":[{"name":"account","in":"query","required":true,"schema":{"type":"string","maxLength":20,"title":"Account"}},{"name":"status","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Status"}},{"name":"fresh","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Fresh"}},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":365,"minimum":1},{"type":"null"}],"description":"Link lifetime in days (default: the site setting; at most 120 — longer asks get 120)","title":"Days"},"description":"Link lifetime in days (default: the site setting; at most 120 — longer asks get 120)"},{"name":"recipient","in":"query","required":false,"schema":{"type":"string","maxLength":200,"description":"API callers: who this link is for (logged)","default":"","title":"Recipient"},"description":"API callers: who this link is for (logged)"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/links/issue":{"post":{"summary":"Links Issue","description":"A no-login link for one recipient, logged (tracking/sends.py).  Staff:\nstatement or order status for any account (a statement to an address\noutside the customer's contacts / domain needs confirming).  Signed-in\ncustomers: order status of their own accounts.","operationId":"links_issue_api_links_issue_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkIssueIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/links/sent":{"get":{"summary":"Links Sent","description":"Every logged link for this account: recipient, sender, how, expiry,\nopens (first / last / count), stopped.  All staff; Stop is admin-only.","operationId":"links_sent_api_links_sent_get","parameters":[{"name":"account","in":"query","required":true,"schema":{"type":"string","maxLength":20,"title":"Account"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/links/stop":{"post":{"summary":"Links Stop","description":"Stop one link (admin token): that recipient's page, invoice copies and\nPOD stop opening, and so do links the customer forwarded from it;\neveryone else's links keep working.","operationId":"links_stop_api_links_stop_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinkStopIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/track/link-opens":{"get":{"summary":"Staff Link Opens","description":"When customers opened their signed statement links (account=) and\norder links (so=): first / last opened and count, per link.  Opens are\nbrowsers that ran the page — not scanners, scripts or HPS staff.","operationId":"staff_link_opens_api_track_link_opens_get","parameters":[{"name":"account","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":4500},{"type":"null"}],"description":"Comma-separated accounts","title":"Account"},"description":"Comma-separated accounts"},{"name":"so","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":4500},{"type":"null"}],"description":"Comma-separated sales orders","title":"So"},"description":"Comma-separated sales orders"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/statement/email":{"post":{"summary":"Staff Statement Email","operationId":"staff_statement_email_api_statement_email_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatementEmailIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/public/orders":{"get":{"summary":"Public Orders","description":"The order status page a signed link opens — the whole account, or\nthe orders a limited link lists.  status=false returns D365 data fast;\nthe page then asks for status=true (carrier calls).","operationId":"public_orders_api_public_orders_get","parameters":[{"name":"acct","in":"query","required":true,"schema":{"type":"string","maxLength":20,"title":"Acct"}},{"name":"e","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"E"}},{"name":"k","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"K"}},{"name":"status","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Status"}},{"name":"only","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":600},{"type":"null"}],"description":"Order-status link limited to these orders (comma-separated)","title":"Only"},"description":"Order-status link limited to these orders (comma-separated)"},{"name":"r","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":24},{"type":"null"}],"description":"Send id of a per-recipient link (tracking/sends.py)","title":"R"},"description":"Send id of a per-recipient link (tracking/sends.py)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orders":{"get":{"summary":"Orders Status","description":"Staff: any account, plus its no-login link.  Signed-in customers:\ntheir own accounts only.","operationId":"orders_status_api_orders_get","parameters":[{"name":"account","in":"query","required":true,"schema":{"type":"string","maxLength":20,"title":"Account"}},{"name":"status","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Status"}},{"name":"fresh","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Fresh"}},{"name":"days","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":365,"minimum":1},{"type":"null"}],"description":"Link lifetime in days (default: the site setting; at most 120 — longer asks get 120)","title":"Days"},"description":"Link lifetime in days (default: the site setting; at most 120 — longer asks get 120)"},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/public/orders/share":{"post":{"summary":"Public Orders Share","description":"From a whole-account order-status link: a link to just some of its\norders, to forward to someone who shouldn't see everything.  Never\noutlives the link it came from.","operationId":"public_orders_share_api_public_orders_share_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrdersShareIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orders/find":{"get":{"summary":"Orders Find","description":"Orders on this account matching an order #, PO #, packing slip,\ninvoice or tracking number — to add an older order to a limited link.","operationId":"orders_find_api_orders_find_get","parameters":[{"name":"account","in":"query","required":true,"schema":{"type":"string","maxLength":20,"title":"Account"}},{"name":"q","in":"query","required":true,"schema":{"type":"string","maxLength":40,"title":"Q"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/orders/email":{"post":{"summary":"Orders Email","operationId":"orders_email_api_orders_email_post","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrdersEmailIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/public/invoice":{"get":{"summary":"Public Invoice","description":"Invoice copy from a statement link (invoices billed to that account)\nor a no-login order link (invoices on that order).","operationId":"public_invoice_api_public_invoice_get","parameters":[{"name":"invoice","in":"query","required":true,"schema":{"type":"string","maxLength":20,"title":"Invoice"}},{"name":"acct","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Acct"}},{"name":"so","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"So"}},{"name":"e","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"E"}},{"name":"k","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"K"}},{"name":"po","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Po"}},{"name":"r","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":24},{"type":"null"}],"description":"Send id of a per-recipient link (tracking/sends.py)","title":"R"},"description":"Send id of a per-recipient link (tracking/sends.py)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/invoice":{"get":{"summary":"Staff Invoice","description":"Invoice copy for staff (any invoice) and signed-in customers (their accounts).","operationId":"staff_invoice_api_invoice_get","parameters":[{"name":"invoice","in":"query","required":true,"schema":{"type":"string","maxLength":20,"title":"Invoice"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/invoice.pdf":{"get":{"summary":"Staff Invoice Pdf","description":"The invoice copy as application/pdf — same access rule as /api/invoice.","operationId":"staff_invoice_pdf_api_invoice_pdf_get","parameters":[{"name":"invoice","in":"query","required":true,"schema":{"type":"string","maxLength":20,"title":"Invoice"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/public/packing-slip":{"get":{"summary":"Public Packing Slip","description":"Packing slip copy from a statement or order-status link (slips for\nthat account, or for the orders a limited link lists) or a no-login\norder link (slips on that order).","operationId":"public_packing_slip_api_public_packing_slip_get","parameters":[{"name":"ps","in":"query","required":true,"schema":{"type":"string","maxLength":20,"title":"Ps"}},{"name":"acct","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Acct"}},{"name":"so","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"So"}},{"name":"e","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"E"}},{"name":"k","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"K"}},{"name":"po","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Po"}},{"name":"only","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":600},{"type":"null"}],"description":"Order-status link limited to these orders (comma-separated)","title":"Only"},"description":"Order-status link limited to these orders (comma-separated)"},{"name":"r","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":24},{"type":"null"}],"description":"Send id of a per-recipient link (tracking/sends.py)","title":"R"},"description":"Send id of a per-recipient link (tracking/sends.py)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/packing-slip":{"get":{"summary":"Staff Packing Slip","description":"Packing slip copy for staff (any) and signed-in customers (their accounts).","operationId":"staff_packing_slip_api_packing_slip_get","parameters":[{"name":"ps","in":"query","required":true,"schema":{"type":"string","maxLength":20,"title":"Ps"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/packing-slip.pdf":{"get":{"summary":"Staff Packing Slip Pdf","description":"The packing slip copy as application/pdf — same access rule as /api/packing-slip.","operationId":"staff_packing_slip_pdf_api_packing_slip_pdf_get","parameters":[{"name":"ps","in":"query","required":true,"schema":{"type":"string","maxLength":20,"title":"Ps"}},{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}},{"name":"x-api-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}},{"name":"inv_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inv Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/":{"get":{"summary":"Index","description":"live.hpsx.com: a signed-in customer's landing page (Jeff 2026-10-26),\nthe staff hub for staff, else Smart Search + sign-in (now also /search).","operationId":"index__get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/search":{"get":{"summary":"Search Page","description":"Smart Inventory Search (and its registration / sign-in).","operationId":"search_page_search_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/quote/{number}":{"get":{"summary":"Quote Page","description":"The quote generator (builder + printable quotation) — one static page;\nthe number in the path is read client-side to reopen a saved quote.","operationId":"quote_page_quote__number__get","parameters":[{"name":"number","in":"path","required":true,"schema":{"type":"string","title":"Number"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/quote":{"get":{"summary":"Quote Page","description":"The quote generator (builder + printable quotation) — one static page;\nthe number in the path is read client-side to reopen a saved quote.","operationId":"quote_page_quote_get","parameters":[{"name":"number","in":"query","required":false,"schema":{"type":"string","default":"","title":"Number"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/track":{"get":{"summary":"Track Page","description":"Shipment tracking / proof of delivery (customers + HPS staff).","operationId":"track_page_track_get","parameters":[{"name":"sales_order","in":"query","required":false,"schema":{"type":"string","default":"","title":"Sales Order"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/t/{sales_order}":{"get":{"summary":"Track Page","description":"Shipment tracking / proof of delivery (customers + HPS staff).","operationId":"track_page_t__sales_order__get","parameters":[{"name":"sales_order","in":"path","required":true,"schema":{"type":"string","title":"Sales Order"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ps/{packing_slip}":{"get":{"summary":"Packing Slip Page","description":"Packing slip copy (one shipment).","operationId":"packing_slip_page_ps__packing_slip__get","parameters":[{"name":"packing_slip","in":"path","required":true,"schema":{"type":"string","title":"Packing Slip"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/i/{invoice}":{"get":{"summary":"Invoice Page","description":"Invoice copy (from a smart statement link, or staff / signed-in customers).","operationId":"invoice_page_i__invoice__get","parameters":[{"name":"invoice","in":"path","required":true,"schema":{"type":"string","title":"Invoice"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/statement":{"get":{"summary":"Statement Page","description":"Smart statement: /s/<account>?e=&k= (no login) and /statement (staff builder).","operationId":"statement_page_statement_get","parameters":[{"name":"account","in":"query","required":false,"schema":{"type":"string","default":"","title":"Account"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/s/{account}":{"get":{"summary":"Statement Page","description":"Smart statement: /s/<account>?e=&k= (no login) and /statement (staff builder).","operationId":"statement_page_s__account__get","parameters":[{"name":"account","in":"path","required":true,"schema":{"type":"string","title":"Account"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/staff":{"get":{"summary":"Staff Page","description":"Staff home: one page linking every tool (hpsx.com sign-in; checked by the page).","operationId":"staff_page_staff_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/agents":{"get":{"summary":"Agents Page","description":"Customer service agent dashboard (admin token; checked by the page's API calls).","operationId":"agents_page_agents_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/ship-outlook":{"get":{"summary":"Ship Outlook Page","description":"Ship & bill outlook (admin token; checked by the page's API calls).","operationId":"ship_outlook_page_ship_outlook_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/ups-bill":{"get":{"summary":"Ups Bill Page","description":"UPS weekly bill: upload, avoidable charges, action list (admin token; checked by the page's API calls).","operationId":"ups_bill_page_ups_bill_get","responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/orders":{"get":{"summary":"Orders Page","description":"Order status: /o/<account>?e=&k= (no login) and /orders (staff builder, signed-in customers).","operationId":"orders_page_orders_get","parameters":[{"name":"account","in":"query","required":false,"schema":{"type":"string","default":"","title":"Account"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/o/{account}":{"get":{"summary":"Orders Page","description":"Order status: /o/<account>?e=&k= (no login) and /orders (staff builder, signed-in customers).","operationId":"orders_page_o__account__get","parameters":[{"name":"account","in":"path","required":true,"schema":{"type":"string","title":"Account"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/health":{"get":{"summary":"Health","description":"Public: just whether the service is up and its sign-ins to Microsoft\nwork (Render's health check and uptime monitors need no more).  With the\nadmin token: the full picture — feed, registrations, memory, credential\nexpiry — which is not for anonymous visitors.","operationId":"health_api_health_get","parameters":[{"name":"x-admin-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Admin-Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"BodyHitOut":{"properties":{"item_number":{"type":"string","title":"Item Number"},"body_code":{"type":"string","title":"Body Code"},"match":{"type":"string","title":"Match"},"qty_available":{"type":"number","title":"Qty Available"},"qty_reserved":{"type":"number","title":"Qty Reserved"},"on_order":{"type":"number","title":"On Order"},"sites":{"items":{"$ref":"#/components/schemas/SiteOut"},"type":"array","title":"Sites"},"inventory_unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inventory Unit"}},"type":"object","required":["item_number","body_code","match","qty_available","qty_reserved","on_order","sites"],"title":"BodyHitOut"},"ClaimIn":{"properties":{"email":{"type":"string","maxLength":254,"title":"Email"},"name":{"type":"string","maxLength":80,"title":"Name","default":""},"so":{"type":"string","maxLength":20,"title":"So"},"e":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"E"},"k":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"K"},"po":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Po"},"r":{"anyOf":[{"type":"string","maxLength":24},{"type":"null"}],"title":"R"}},"type":"object","required":["email","so"],"title":"ClaimIn"},"CustomerInfoIn":{"properties":{"company":{"type":"string","maxLength":120,"title":"Company","default":""},"contact":{"type":"string","maxLength":120,"title":"Contact","default":""},"email":{"type":"string","maxLength":120,"title":"Email","default":""},"phone":{"type":"string","maxLength":40,"title":"Phone","default":""},"address":{"type":"string","maxLength":300,"title":"Address","description":"free-form, newline separated","default":""},"ship_company":{"type":"string","maxLength":120,"title":"Ship Company","default":""},"ship_attn":{"type":"string","maxLength":120,"title":"Ship Attn","default":""},"ship_ref":{"type":"string","maxLength":60,"title":"Ship Ref","default":""}},"type":"object","title":"CustomerInfoIn","description":"Who the quote is for when it is priced on the default account."},"DistributorDetailOut":{"properties":{"sku":{"type":"string","title":"Sku"},"description":{"type":"string","title":"Description"},"qty":{"type":"number","title":"Qty"},"unit":{"type":"string","title":"Unit"},"company":{"type":"string","title":"Company"},"location":{"type":"string","title":"Location"},"region":{"type":"string","title":"Region"},"freshness":{"type":"string","title":"Freshness"},"effective_date":{"type":"string","title":"Effective Date"},"community":{"type":"string","title":"Community","default":"SUN"}},"type":"object","required":["sku","description","qty","unit","company","location","region","freshness","effective_date"],"title":"DistributorDetailOut"},"DistributorHitOut":{"properties":{"sku":{"type":"string","title":"Sku"},"description":{"type":"string","title":"Description"},"regions":{"items":{"$ref":"#/components/schemas/RegionBucketOut"},"type":"array","title":"Regions"},"grand_total":{"type":"number","title":"Grand Total"},"details":{"items":{"$ref":"#/components/schemas/DistributorDetailOut"},"type":"array","title":"Details","default":[]},"communities":{"items":{"type":"string"},"type":"array","title":"Communities","default":[]}},"type":"object","required":["sku","description","regions","grand_total"],"title":"DistributorHitOut"},"DistributorSearchOut":{"properties":{"query":{"type":"string","title":"Query"},"hits":{"items":{"$ref":"#/components/schemas/DistributorHitOut"},"type":"array","title":"Hits"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["query","hits","total"],"title":"DistributorSearchOut"},"EmailQuoteIn":{"properties":{"to":{"type":"string","maxLength":200,"minLength":3,"title":"To","description":"recipient email(s), comma separated"},"cc_me":{"type":"boolean","title":"Cc Me","default":true},"note":{"type":"string","maxLength":2000,"title":"Note","description":"personal message from the rep, printed above the quote","default":""}},"type":"object","required":["to"],"title":"EmailQuoteIn"},"FinderEventIn":{"properties":{"account":{"type":"string","maxLength":20,"title":"Account"},"query":{"type":"string","maxLength":120,"title":"Query","default":""},"matched_via":{"type":"string","maxLength":20,"title":"Matched Via","default":""},"contact_email":{"type":"string","maxLength":120,"title":"Contact Email","default":""},"flags":{"items":{"type":"string"},"type":"array","title":"Flags"}},"type":"object","required":["account"],"title":"FinderEventIn"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HelpIn":{"properties":{"lines":{"items":{"$ref":"#/components/schemas/QuoteLineIn"},"type":"array","maxItems":500,"title":"Lines"},"rejects":{"items":{"$ref":"#/components/schemas/HelpRejectIn"},"type":"array","maxItems":500,"title":"Rejects"},"note":{"type":"string","maxLength":2000,"title":"Note","default":""},"customer_info":{"anyOf":[{"$ref":"#/components/schemas/CustomerInfoIn"},{"type":"null"}]},"po_number":{"type":"string","maxLength":60,"title":"Po Number","default":""},"attn":{"type":"string","maxLength":120,"title":"Attn","default":""},"ship_via":{"type":"string","maxLength":80,"title":"Ship Via","default":""},"customer":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Customer","description":"CustomerAccount override (HPS staff only)"}},"type":"object","title":"HelpIn","description":"A customer's mostly-finished quote plus what they could not resolve."},"HelpRejectIn":{"properties":{"part":{"type":"string","maxLength":80,"minLength":1,"title":"Part"},"qty":{"type":"integer","maximum":100000.0,"minimum":1.0,"title":"Qty","default":1},"reason":{"type":"string","maxLength":300,"title":"Reason","default":""}},"type":"object","required":["part"],"title":"HelpRejectIn"},"HitOut":{"properties":{"item_number":{"type":"string","title":"Item Number"},"product_search_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Search Name"},"product_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Product Name"},"inventory_unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inventory Unit"},"vendor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vendor"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"qty_available":{"type":"number","title":"Qty Available"},"qty_reserved":{"type":"number","title":"Qty Reserved"},"on_order":{"type":"number","title":"On Order"},"sites":{"items":{"$ref":"#/components/schemas/SiteOut"},"type":"array","title":"Sites"},"tier":{"type":"integer","title":"Tier"},"tier_name":{"type":"string","title":"Tier Name"},"tag":{"type":"string","title":"Tag"},"note":{"type":"string","title":"Note"}},"type":"object","required":["item_number","qty_available","qty_reserved","on_order","sites","tier","tier_name","tag","note"],"title":"HitOut"},"LinePriceIn":{"properties":{"line_no":{"type":"integer","minimum":1.0,"title":"Line No"},"net_each":{"anyOf":[{"type":"number","maximum":10000000.0,"minimum":0.0},{"type":"null"}],"title":"Net Each"},"list_each":{"anyOf":[{"type":"number","maximum":10000000.0,"minimum":0.0},{"type":"null"}],"title":"List Each"},"disc_pct":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Disc Pct"},"reason":{"type":"string","maxLength":300,"title":"Reason","description":"where the price came from (logged, staff only)","default":""}},"type":"object","required":["line_no"],"title":"LinePriceIn","description":"Staff: the price for a \"Price available on request\" line, once they\nhave it (HPS manifold quoted by engineering, a part with no D365 price).\nResellers may be given list + discount; otherwise the net each."},"LinkIssueIn":{"properties":{"kind":{"type":"string","pattern":"^(stmt|orders|order)$","title":"Kind"},"account":{"type":"string","maxLength":20,"title":"Account","default":""},"recipient":{"type":"string","maxLength":200,"title":"Recipient","default":""},"orders":{"items":{"type":"string"},"type":"array","maxItems":25,"title":"Orders"},"preview":{"type":"boolean","title":"Preview","default":false},"confirmed":{"type":"boolean","title":"Confirmed","default":false}},"type":"object","required":["kind"],"title":"LinkIssueIn"},"LinkStopIn":{"properties":{"id":{"type":"string","maxLength":24,"title":"Id"}},"type":"object","required":["id"],"title":"LinkStopIn"},"LoginLinkRequest":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","required":["email"],"title":"LoginLinkRequest"},"OrdersEmailIn":{"properties":{"account":{"type":"string","maxLength":20,"title":"Account"},"to":{"items":{"type":"string"},"type":"array","maxItems":5,"minItems":1,"title":"To"},"cc":{"items":{"type":"string"},"type":"array","maxItems":5,"title":"Cc"},"note":{"type":"string","maxLength":1500,"title":"Note","default":""},"confirmed":{"type":"boolean","title":"Confirmed","default":false},"buyer":{"type":"string","maxLength":80,"title":"Buyer","default":""},"orders":{"items":{"type":"string"},"type":"array","maxItems":25,"title":"Orders"}},"type":"object","required":["account","to"],"title":"OrdersEmailIn"},"OrdersShareIn":{"properties":{"acct":{"type":"string","maxLength":20,"title":"Acct"},"e":{"type":"string","maxLength":8,"title":"E"},"k":{"type":"string","maxLength":40,"title":"K"},"r":{"anyOf":[{"type":"string","maxLength":24},{"type":"null"}],"title":"R"},"orders":{"items":{"type":"string"},"type":"array","maxItems":25,"minItems":1,"title":"Orders"},"recipient":{"type":"string","maxLength":200,"minLength":1,"title":"Recipient"}},"type":"object","required":["acct","e","k","orders","recipient"],"title":"OrdersShareIn"},"ParsedOut":{"properties":{"raw":{"type":"string","title":"Raw"},"normalized":{"type":"string","title":"Normalized"},"is_sun":{"type":"boolean","title":"Is Sun"},"cartridge":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cartridge"},"corrosion":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Corrosion"},"coil":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Coil"},"setting_raw":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Setting Raw"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"body_mod":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Mod"},"parse_notes":{"items":{"type":"string"},"type":"array","title":"Parse Notes","default":[]}},"type":"object","required":["raw","normalized","is_sun"],"title":"ParsedOut"},"PrimaryVendorOut":{"properties":{"code":{"type":"string","title":"Code"},"label":{"type":"string","title":"Label"}},"type":"object","required":["code","label"],"title":"PrimaryVendorOut"},"ProductLineSearchOut":{"properties":{"vendor":{"type":"string","title":"Vendor"},"hits":{"items":{"$ref":"#/components/schemas/HitOut"},"type":"array","title":"Hits"},"cursor":{"type":"integer","title":"Cursor"},"next_cursor":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Cursor"},"scanned":{"type":"integer","title":"Scanned"},"total_items":{"type":"integer","title":"Total Items"},"has_more":{"type":"boolean","title":"Has More"},"query":{"type":"string","title":"Query","default":""}},"type":"object","required":["vendor","hits","cursor","scanned","total_items","has_more"],"title":"ProductLineSearchOut"},"ProductLinesOut":{"properties":{"vendors":{"items":{"type":"string"},"type":"array","title":"Vendors"},"count":{"type":"integer","title":"Count"},"primary":{"items":{"$ref":"#/components/schemas/PrimaryVendorOut"},"type":"array","title":"Primary","default":[]}},"type":"object","required":["vendors","count"],"title":"ProductLinesOut"},"QuoteIn":{"properties":{"lines":{"items":{"$ref":"#/components/schemas/QuoteLineIn"},"type":"array","maxItems":500,"minItems":1,"title":"Lines"},"rejects":{"items":{"$ref":"#/components/schemas/HelpRejectIn"},"type":"array","maxItems":500,"title":"Rejects"},"customer_info":{"anyOf":[{"$ref":"#/components/schemas/CustomerInfoIn"},{"type":"null"}]},"po_number":{"type":"string","maxLength":60,"title":"Po Number","default":""},"attn":{"type":"string","maxLength":120,"title":"Attn","default":""},"ship_via":{"type":"string","maxLength":80,"title":"Ship Via","default":""},"notes":{"type":"string","maxLength":1000,"title":"Notes","default":""},"customer":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Customer","description":"CustomerAccount override (HPS staff only)"},"help_for":{"anyOf":[{"type":"string","maxLength":24},{"type":"null"}],"title":"Help For","description":"help request this quotation resolves (staff)"},"revise":{"anyOf":[{"type":"string","maxLength":24},{"type":"null"}],"title":"Revise","description":"issued quotation this replaces as its next revision (staff)"}},"type":"object","required":["lines"],"title":"QuoteIn"},"QuoteLineIn":{"properties":{"part":{"type":"string","maxLength":80,"minLength":1,"title":"Part"},"qty":{"type":"integer","maximum":100000.0,"minimum":1.0,"title":"Qty","default":1},"override_net_each":{"anyOf":[{"type":"number","maximum":10000000.0,"minimum":0.0},{"type":"null"}],"title":"Override Net Each"},"override_list_each":{"anyOf":[{"type":"number","maximum":10000000.0,"minimum":0.0},{"type":"null"}],"title":"Override List Each"},"override_disc_pct":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Override Disc Pct"},"override_reason":{"type":"string","maxLength":200,"title":"Override Reason","default":""},"note":{"type":"string","maxLength":500,"title":"Note","default":""},"manual_net_each":{"anyOf":[{"type":"number","maximum":10000000.0,"minimum":0.0},{"type":"null"}],"title":"Manual Net Each"},"manual_list_each":{"anyOf":[{"type":"number","maximum":10000000.0,"minimum":0.0},{"type":"null"}],"title":"Manual List Each"},"manual_disc_pct":{"anyOf":[{"type":"number","maximum":100.0,"minimum":0.0},{"type":"null"}],"title":"Manual Disc Pct"},"manual_reason":{"type":"string","maxLength":300,"title":"Manual Reason","default":""}},"type":"object","required":["part"],"title":"QuoteLineIn"},"RegionBucketOut":{"properties":{"region":{"type":"string","title":"Region"},"fresh":{"type":"number","title":"Fresh"},"recent":{"type":"number","title":"Recent"},"stale":{"type":"number","title":"Stale"},"total":{"type":"number","title":"Total"}},"type":"object","required":["region","fresh","recent","stale","total"],"title":"RegionBucketOut"},"RegisterRequest":{"properties":{"name":{"type":"string","maxLength":80,"title":"Name"},"company":{"type":"string","maxLength":120,"title":"Company"},"email":{"type":"string","maxLength":254,"title":"Email"},"phone":{"type":"string","maxLength":40,"title":"Phone","default":""},"source":{"type":"string","maxLength":20,"title":"Source","default":""}},"type":"object","required":["name","company","email"],"title":"RegisterRequest"},"SimpleVisitOut":{"properties":{"registered":{"type":"boolean","title":"Registered"},"visits":{"type":"integer","title":"Visits","default":0},"nudge":{"type":"boolean","title":"Nudge","default":false}},"type":"object","required":["registered"],"title":"SimpleVisitOut"},"SiteOut":{"properties":{"site_id":{"type":"string","title":"Site Id"},"qty_available":{"type":"number","title":"Qty Available"},"qty_reserved":{"type":"number","title":"Qty Reserved"},"on_order":{"type":"number","title":"On Order"}},"type":"object","required":["site_id","qty_available","qty_reserved","on_order"],"title":"SiteOut"},"SmartSearchOut":{"properties":{"query":{"type":"string","title":"Query"},"parsed":{"$ref":"#/components/schemas/ParsedOut"},"hits":{"items":{"$ref":"#/components/schemas/HitOut"},"type":"array","title":"Hits"},"body_hits":{"items":{"$ref":"#/components/schemas/BodyHitOut"},"type":"array","title":"Body Hits"},"total_candidates":{"type":"integer","title":"Total Candidates"},"search_mode":{"type":"string","title":"Search Mode","default":""},"distributor_hits":{"items":{"$ref":"#/components/schemas/DistributorHitOut"},"type":"array","title":"Distributor Hits","default":[]},"distributor_available":{"type":"boolean","title":"Distributor Available","default":false},"customer_part":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Customer Part"}},"type":"object","required":["query","parsed","hits","body_hits","total_candidates"],"title":"SmartSearchOut"},"StatementEmailIn":{"properties":{"account":{"type":"string","maxLength":20,"title":"Account"},"to":{"items":{"type":"string"},"type":"array","maxItems":5,"minItems":1,"title":"To"},"cc":{"items":{"type":"string"},"type":"array","maxItems":5,"title":"Cc"},"note":{"type":"string","maxLength":1500,"title":"Note","default":""},"confirmed":{"type":"boolean","title":"Confirmed","default":false}},"type":"object","required":["account","to"],"title":"StatementEmailIn"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}