setup_trade
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.
get_trade
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.
save_price_items
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.
draft_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 past quote's lines for a new customer. save false returns the numbers without saving.
revise_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
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.