Nero Quote Builder

v0.2.0
io.github.Nero-Engine/quote-builder Checked 1 day ago Published 20 days ago

VAT-correct trade quotes with a branded PDF and one-tap customer accept, for UK trades' AI

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

setup_trade Set up or update the business quoting profile

Create a business, or update its saved settings (call with trade_key to update). Saves the rates and rules every quote uses: day and hour rates, labourer rate, materials markup, VAT registration and number, CIS, deposit rule, validity, payment terms, standard exclusions, brand colour, logo (https link or base64; PNG or JPEG for the PDF), quote number prefix, price book. On first call returns trade_key ONCE: it is shown only once and every other tool needs it. Also returns nero_trade_ref, the same identity the Nero Work exchange and Spark Pack use. Money in pounds.

ParameterTypeDescription
accent_colourstring
addressstring
brand_colourstringHex colour, for example #0B5FFF. If a logo is given and no colour, one is taken from the logo.
cis_registeredboolean
company_namestringRegistered company name if a limited company.
company_numberstring
day_ratenumberThe trade's own charge-out rate per day, pounds, before VAT.
depositobjectDeposit rule. basis percent (with percent), fixed (with amount in pounds), materials (deposit equals the materials total), or none. no_deposit_under: no deposit on quotes below this total in pounds.
display_namestringBusiness name customers see. Required on first setup.
emailstring
hour_ratenumberPer hour, pounds. If only one of day_rate and hour_rate is set the other is worked out from hours_per_day.
hours_per_daynumberDefault 8.
labourer_day_ratenumberCharge-out day rate for a mate, labourer or apprentice.
licence_bodystringScheme or registration body: niceic, napit, elecsa, stroma, gas_safe, oftec, hetas, fensa, certass, trustmark, nfrc, fmb, other.
licence_numberstringRegistration number with that body (Gas Safe number for gas engineers).
logo_base64stringThe logo file as base64, instead of logo_url.
logo_urlstringhttps link to the logo (PNG best, JPEG fine, SVG shows on the phone page only). Under 400 KB.
materials_markup_percentnumberAdded to what materials cost the trade. Default 15.
payment_termsstringShown on every quote, for example "Deposit to book, balance on completion by bank transfer."
phonestring
postcodestring
price_displaystringitemised (default) shows quantity and price per line; sections shows one price per section (labour, materials) with the lines listed.
price_itemsarrayMaterials the trade buys often, saved to their price book. Each: code (short id, optional), description, unit, unit_cost (pounds, what they pay), cost_includes_vat, markup_percent (optional, overrides…
quote_prefixstringLetters before the quote number, for example BLE gives BLE-0001. Default from the business initials.
standard_exclusionsarrayThings this business never includes unless stated, shown on every quote.
trade_keystringOmit to create a new business. Give it to update an existing one (only the fields you send change).
tradesarrayRequired on first setup.
use_suggested_exclusionsbooleanAdds a short set of common exclusions for the trade(s), for example plastering after chasing for electricians.
validity_daysnumberDefault 30.
vat_numberstring
vat_registeredbooleanRequired on first setup. If false, no VAT is ever added.
websitestring

get_trade Show the business profile, price book, stats and free allowance

The trade's saved settings, price book (most used first), quote stats (win rate, value won in the last 12 months) and, for a business that is not VAT registered, a warning when accepted work is nearing the £90,000 VAT registration threshold.

ParameterTypeDescription
trade_key *stringThe trade's secret key from setup_trade (starts qbk_).

save_price_items Save materials to the price book

Add or update materials in the trade's price book, so later quotes can use { code, qty } and the cost, unit and markup fill in. Materials used in quotes are also remembered automatically.

ParameterTypeDescription
price_items *arrayMaterials the trade buys often, saved to their price book. Each: code (short id, optional), description, unit, unit_cost (pounds, what they pay), cost_includes_vat, markup_percent (optional, overrides…
trade_key *stringThe trade's secret key from setup_trade (starts qbk_).

draft_quote Draft a priced, VAT-correct quote

Price a job after a site visit. Give the job, customer, labour (time, priced from the saved rate), materials (trade cost, marked up), other costs and optional extras; the server applies VAT correctly (registered or not, 20/5/0%, the construction domestic reverse charge for contractor customers), the deposit rule, validity, exclusions and a running quote number. Returns the totals, the trade-only margin view, warnings, a check_before_sending list of commonly forgotten items for that trade, and the links to the PDF and the customer's phone page (a DRAFT until finalise_quote). from_quote copies a…

revise_quote Change or withdraw a quote

Change a quote. Send only the fields that change (a list you send, such as materials, replaces that whole list). A draft stays a draft. A quote the customer already has becomes the next revision on the same link, with fresh dates, and any earlier answer is cleared. Accepted quotes cannot change. status "withdrawn" pulls a quote. use_current_settings true re-prices with the trade's latest rates.

finalise_quote Finalise a quote and get the customer link

Lock a draft so the customer can answer it. Sets today's date and the valid-until date, and returns the customer link, the PDF link and a short ready-to-send message. Nothing is sent by this server: the trade sends the link by their own text, WhatsApp or email. Free allowance: 5 finalised quotes per calendar month (UK time) per trade, shown as free_allowance in the answer and in get_trade; past it the quote stays a saved draft and can be finalised from the 1st of next month. Drafts, revisions of quotes already sent, replies and exports never count.

ParameterTypeDescription
quote *stringQuote number, for example BLE-0007.
trade_key *stringThe trade's secret key from setup_trade (starts qbk_).

quote_activity See what customers did with quotes

What customers have done since the trade last checked: quotes opened, accepted (with the name they signed, extras ticked and final total), questions asked, declined. Marks them as seen unless mark_seen is false. Answers when the trade asks "any news on my quotes?".

ParameterTypeDescription
trade_key *stringThe trade's secret key from setup_trade (starts qbk_).
mark_seenboolean

get_quote Show one quote in full

One quote in full: lines, totals, VAT working with HMRC sources, margins (trade only), the customer's answer, history (drafted, sent, opened, accepted) and links.

ParameterTypeDescription
quote *stringQuote number, for example BLE-0007.
trade_key *stringThe trade's secret key from setup_trade (starts qbk_).

list_quotes List quotes

Recent quotes, newest first, with status (draft, sent, viewed, queried, accepted, declined, expired, withdrawn), total and whether there is news. Filter by status or search customer name, job title or number.

ParameterTypeDescription
trade_key *stringThe trade's secret key from setup_trade (starts qbk_).
limitnumber
searchstring
statusstring

reply_to_customer Answer a customer question on the quote page

Answer a customer's question. The answer shows on their quote page under their question. Price or scope changes are made with revise_quote, not here.

ParameterTypeDescription
message *string
quote *stringQuote number, for example BLE-0007.
trade_key *stringThe trade's secret key from setup_trade (starts qbk_).

export_to_nero_work Export a quote in Nero Work format

The quote in the exact argument shape of the Nero Work exchange's submit_quote tool (labour_minor, materials_minor, vat_minor in pence, validity_hours, exclusions, notes), checked with Nero Work's own rules. If the customer accepted with extras, they are included.

ParameterTypeDescription
quote *stringQuote number, for example BLE-0007.
trade_key *stringThe trade's secret key from setup_trade (starts qbk_).