@huloglobal/vendure-plugin-quotations
v0.10.1
Published
End-to-end quotation engine for Vendure: build, send, track, chase and convert quotes to orders — with signatures, PDFs, pay links, deposits, approvals, templates, follow-ups, webhooks and sales reports.
Downloads
1,759
Maintainers
Readme
@huloglobal/vendure-plugin-quotations
End-to-end quotation engine for Vendure:
- Build quotes from your catalogue (live prices, per-line + quote-level discounts, VAT, validity) or free-text lines — multi-channel, branded.
- Send a branded email with a signed customer link.
- Track viewed / accepted / declined — acceptance captures a typed-name signature; every step lands in a per-quote audit trail.
- Chase automatically: one reminder for unopened quotes and an expires-soon nudge, plus auto-expiry.
- Convert accepted quotes to Vendure draft orders at the exact quoted total and VAT (a pricing surcharge reconciles quoted vs catalogue pricing), in the quote's own channel and currency. The price holds through checkout: Vendure 3.8+ recalculates draft orders when they leave Draft, and the plugin re-balances the surcharge so a later catalogue price or promotion change does not move the quoted total (unless an admin has changed the lines).
- Receive requests from your storefront: customers ask for a quote from a basket, product page or form, and it lands in your inbox pre-priced.
- Get paid: a HULO Payments pay link on acceptance (optional deposit, then the balance); the quote is marked paid when the order is.
- PDF of every quote, a staff preview of the customer page, "My quotes" for signed-in customers, a 12-month report and EventBus events.
- Premium: templates, follow-up sequences, discount approval, webhooks (JSON, Slack, Teams), sales reports with CSV, deposits, the weekly report and the set-up checklist.
Works on MySQL, MariaDB and PostgreSQL. Admin UI included (Quotes, editor with catalogue search, Settings, a Help drawer and a set-up checklist), a dashboard widget, and a weekly report by email. Licence activation in the admin, one-click in-app updates.
Catalogue search in the editor reads Vendure's search index once the
channel has been indexed (the default search plugin's search_index_item
table) and falls back to the live product tables when it is empty or absent,
so it works with or without the default search plugin.
Install
yarn add @huloglobal/vendure-plugin-quotations// vendure-config.ts
import { QuotationsPlugin } from '@huloglobal/vendure-plugin-quotations';
plugins: [
QuotationsPlugin.init({
publicBaseUrl: 'https://shop.example.com',
licenceKey: process.env.HULO_LICENCE_KEY_QUOTATIONS, // optional — or activate in the admin
}),
AdminUiPlugin.init({
app: compileUiExtensions({ extensions: [QuotationsPlugin.uiExtensions /* … */] }),
}),
]SMTP comes from SMTP_SERVER / SMTP_PORT / SMTP_USER / SMTP_PASSWORD
/ SMTP_FROM (or pass smtp in init()).
Let customers request a quote
Post JSON from your storefront (server-side or from the browser — the
endpoint is public and CORS follows your Vendure apiOptions.cors). Send
the channel's token so the request lands on the right channel:
await fetch('https://shop.example.com/quotations/request', {
method: 'POST',
headers: { 'content-type': 'application/json', 'vendure-token': CHANNEL_TOKEN },
body: JSON.stringify({
name: 'Jane Buyer',
email: '[email protected]',
company: 'Example Ltd', // optional
phone: '+44 20 7946 0000', // optional
message: 'Renewing in November — PO required.',
source: 'basket', // free text: basket, product:<slug>, calculator…
lines: [ // optional; catalogue lines are priced at list
{ productVariantId: 42, quantity: 25 },
{ sku: 'WS25-STD-16C', quantity: 2 },
{ description: 'Installation day on site', quantity: 1 },
],
}),
});
// → { ok: true, reference: 'Q-2026-0012', message: 'Thanks — …' }The quote appears under Sales → Quotations as requested; price any
free-text lines, then Send to customer. Turn requests off per channel in
Settings. Requests are throttled (10 an hour per client and 10 an hour per e-mail
address, the latter counted in the database) and a hidden website field
discards bots. A request posted with the customer's shop session (cookie or
bearer token) is linked to their account and shows under "My quotes"; guest
requests are never linked by e-mail address.
Prices and VAT. Catalogue lines are priced the way the channel prices them. On a channel with prices include tax the variant price already carries VAT, so the quote is VAT-inclusive: its total is the basket total and the VAT inside it is shown separately ("Includes VAT (20%)"). Otherwise VAT is added on top. The rate is the variant's own (its tax category in the channel's default tax zone). New admin quotes follow the channel too, and the editor's Pricing step has a Line prices include VAT switch.
Posting from your storefront's server
If your storefront relays the request from its own server, every visitor
reaches the API from that server's address and shares one per-IP budget. Pass
the visitor's address in x-real-client-ip with a shared secret, and tell the
plugin to trust it (off by default; the header is ignored without the secret):
QuotationsPlugin.init({
// …
trustedClientIp: {
secret: process.env.QUOTATIONS_PROXY_SECRET, // sent by the relay in `x-quotations-proxy`
// secretHeader: 'x-checkout-guard-proxy', // reuse HULO Checkout Guard's header and secret
// trustedProxies: ['127.0.0.1', '::1'], // optional: only from these socket peers
},
}),// In the storefront's server code:
headers: {
'content-type': 'application/json', 'vendure-token': CHANNEL_TOKEN,
'x-real-client-ip': visitorIp, 'x-quotations-proxy': process.env.QUOTATIONS_PROXY_SECRET,
}The address the request was counted against is kept on the quote
(requestIp) for the admin.
"My quotes" for signed-in customers
const res = await fetch('https://shop.example.com/quotations/my', {
headers: { authorization: `Bearer ${shopToken}`, 'vendure-token': CHANNEL_TOKEN },
});
// → { items: [{ reference, status, statusLabel, date, validUntil, totalPence, currency,
// url, pdfUrl, payUrl, paid, canRespond }] } (401 when not signed in)Only quotes linked to the customer's account are listed (staff link them with the customer picker); drafts are never shown.
E-mails
Every message the plugin sends shares one design: a 600px white card, your logo (or business name) over a 3px bar in your accent colour, a heading, the quote's reference, validity and total in a summary box, a button, a "Kind regards" sign-off with your reply-to address, and a footer strip with your address, phone, website and footer note. Inline styles only, with a plain-text part. It is set from Settings (business name, logo URL, accent colour, reply-to, address, phone, website, footer note); nothing extra.
- To customers: the quote, test sends (marked "Test send"), the chaser,
the expiry reminder, follow-up steps, pay-link e-mails (whole amount,
deposit or balance) and the request acknowledgement. Your subject and body
templates are used as written; the summary box and button go where the
body has
{{quoteUrl}}on a line of its own, else before your sign-off. - To your team (compact): new request, first view, accepted, declined, approval requested, approved or not.
- Weekly report: the licence SDK's report layout with your logo and accent colour.
GET /quotations/quote/:token/pdf (the customer link, rate-limited, never
cached, does not count as opening the quote) and GET /quotations/quotes/:id/pdf
(admin). Built in, no dependency: A4, Helvetica, Western European text
(other scripts print as "?"; the customer page shows every language). Turn on
Settings → Attach the quote as a PDF to attach it to the quote e-mail.
Pay links and deposits
With HULO Payments for Vendure installed (or your own provider passed as
payLinks in init()), an accepted quote can be paid online: the quote
becomes a draft order at the quoted total, the order moves to
ArrangingPayment (a free shipping method is chosen when the channel has one;
otherwise the admin is told what is missing), and the customer gets a pay
link. Turn on Settings → Pay link on acceptance to do this the moment the
customer accepts, or use Create pay link on the quote. The quote is marked
paid when the order's settled payments cover the quoted total. Quotations
works the same with or without HULO Payments.
QuotationsPlugin.init({
payLinks: { create: async (ctx, { orderCode, amount, currency, description, reference }) => ({ url, ref }) },
});Deposits (premium): set a percentage (and optionally a per-currency
threshold, e.g. GBP 1000, EUR 1200) or a per-quote override. The customer
pays the deposit link first, then the balance link, both on the same order;
deposit + balance equal the quoted total exactly.
EventBus events
import { QuotationEvent } from '@huloglobal/vendure-plugin-quotations';
eventBus.ofType(QuotationEvent).pipe(filter(e => e.type === 'accepted')).subscribe(e => { /* e.quote, e.detail, e.actor */ });Types: created, requested, updated, sent, viewed, accepted,
declined, expired, cancelled, converted, paid, payment,
approval, followup, deleted.
Premium features
- Templates (Templates tab): save a quote's lines, discounts, VAT, notes, terms, validity and currency; start new drafts from them.
- Follow-up sequences (Settings): up to three e-mails N days after sending, while the quote is open and unpaid.
- Discount approval (Settings): a quote whose discount off list (percent or amount) or total is over a limit cannot be sent or marked as sent until an approver approves that exact version; any edit needs a new approval.
- Webhooks (Settings, up to five): JSON (signed
X-Hulo-Signature: sha256=HMAC-SHA256(secret, "<X-Hulo-Timestamp>.<body>")), Slack or Microsoft Teams. Events: request created, quote sent, opened, accepted, declined, paid, expired, converted, approval requested. Public addresses only, retries with back-off, a 30-day delivery log. - Sales reports (Reports tab) by member of staff and by source, per currency, with a CSV export.
- Deposits, the weekly report and the set-up checklist.
Admin UI
Sales → Quotations (requires the ReadSettings permission; writes need
UpdateSettings). The page has five tabs — Quotes (inbox, KPIs per
currency, detail with payment, deposit and approval, activity trail), the
step-by-step editor, Reports (12 months; sales by staff and source),
Templates, and Settings — plus a
Help button in the header that opens a three-step drawer (New quote →
Send → Convert).
Dashboard → Add widget → Quotations adds a card with the last 7 days' quotes sent, accepted and value won, the licence notice when one applies, and a link into the page.
Weekly report, setup checklist and dashboard widget
The weekly report and the set-up checklist are premium (licence or the 14-day evaluation). Without premium the report is not sent and the checklist is not shown; their settings are kept and they resume when a licence is active.
Set-up checklist. The top of the Quotes tab shows what is left to do,
each item checked against the real state: an email server reachable
(SMTP_* env or the smtp option), a reply-to or notify address saved
for a channel, your business name or logo saved, quote requests arriving
from the storefront (or dismissed, if you only quote by hand) and the
first quote sent. Hide collapses it; it disappears for good once every
item is done and comes back if one becomes undone.
Weekly report. Every Monday at 08:00 (server-local time) the plugin emails one short report for the week just gone: quotes created, sent and accepted, value won from accepted quotes, storefront requests received and the win rate on quotes sent, each against the previous week, plus up to three next steps taken from the checklist. The numbers are the same ones the plugin reports anonymously to the licence server (counts and totals only, never customer data).
- Recipient: Settings → Weekly report. Left empty it goes to the first channel's notify address, else its reply-to address, else the email on your licence, else the address you gave for the trial reminder.
- Turn it off with the switch on the same card; Send me a test sends the week-to-date report now, Preview opens it in a new tab.
- It uses the same SMTP settings as quote emails (
SMTP_SERVER,SMTP_PORT,SMTP_USER,SMTP_PASSWORD,SMTP_FROMorsmtpininit()); without them nothing is sent and the test button says why. - Runs on the worker only, once per install however many workers you run;
disableCron: truealso disables it.
Endpoints (admin session): GET /quotations/setup,
POST /quotations/setup/dismiss, GET|POST /quotations/digest/settings,
POST /quotations/digest/send-test, GET /quotations/digest/preview,
GET /quotations/widget.
Licensing
Unlicensed installs run in the free tier, with a 14-day evaluation of the premium features (no card). Free: building, sending, test sends, mark as sent, the customer page with signature, PDF, storefront requests, "My quotes", the chaser and expiry reminder, auto-expiry, pay links on acceptance, KPIs, the 12-month report and EventBus events. Premium (licence from https://huloglobal.com/vendure-plugins/quotations/): converting to a draft order from the admin, templates, follow-up sequences, discount approval, webhooks, sales reports with CSV, deposits, the weekly report and the set-up checklist.
Buying a licence
Pick monthly or annual on the plugin's admin banner and click Subscribe (cancel any time), or choose lifetime — checkout opens in a new tab and the key installs itself within a minute. You can also buy at https://elite.charity/licence/buy/vendure-plugin-quotations and paste the emailed key into the admin.
