Quotes
Quotes with line items, sections and optional lines, document discounts, tax-inclusive prices, deposits and tax per rate, published versions, a public link and a portal the customer answers through, expiry, and quotes made from deals.
quotes is the offer you send a customer: a title, a company and a contact, lines with quantities, unit amounts, discounts and tax in minor units, totals the database keeps, a valid-until date and terms. You send it as a link the customer opens without an account, or share it with a signed-in guest, and they accept it, reject it or ask for changes. Every send publishes a version that never changes, so you can show what the customer saw at each revision. With the deals module installed, a quote starts from a deal.
Reading needs quotes.read, and creating, sending and recording decisions needs quotes.write. Admins get every permission, and members get quotes.read and quotes.write.
permissions.send (send and publish), permissions.decide and permissions.withdraw take their own keys, each falling back to write, so members can edit quotes while only some roles send them:
blocks: {
quotes: {
permissions: {
write: "quote.update",
send: "quote.send",
decide: "quote.markAccepted",
withdraw: "quote.withdraw",
},
},
}permissions.accept, permissions.reject and permissions.requestChanges split decide by answer, each falling back to decide, so a member can record that a customer said no while only an admin records a yes:
blocks: {
quotes: {
permissions: { decide: "quote.decide", accept: "quote.markAccepted", reject: "quote.markRejected" },
},
}better-supabase add quotesThe module needs tenant, permissions and subjects.
Server code calls the quotes instance on db, in the caller's organization. With gen.hooks set, better-supabase gen writes the hooks:
export const { useList: useQuotes } = defineDataHooks(
"quotes",
(db: AppDb) => db.quotes,
);import { createQuotes } from "better-supabase/blocks/quotes";
import { money } from "better-supabase/commerce";
const quote = await db.quotes.fromDeal(dealId).orThrow();
await db.quotes
.setLines(quote.id, [
{
description: "Licences",
quantity: 10,
unitAmount: money(100_000n, "EUR"),
taxRateBps: 2100,
},
{
description: "Setup",
unitAmount: money(50_000n, "EUR"),
discountBps: 2000,
taxRateBps: 2100,
},
])
.orThrow();
const { token } = await db.quotes.send(quote.id).orThrow();
// Email the customer a link such as https://app.example.com/q/{token}"use client";
import { useQuotes } from "@/lib/supabase/hooks";
const rows = useQuotes({ limit: 50 });Paging quotes
page pages quotes by keyset (ADR 1077), and get(id) reads one and returns a not_found error for an unknown id. list({ subject, limit }) stays as the read for the quotes of one record. Sorts are createdAt (the default, newest first), validUntil and title. status, ownerId, currency, companyId and contactId filter by a list of values, and q searches the title and the identifier. The facets are status, currency and ownerId. The organization comes from organizationId or the block's tenant option.
const first = await quotes
.page({
filters: { status: ["sent", "accepted"] },
sort: { by: "validUntil", direction: "asc" },
limit: 50,
})
.orThrow();
const facets = await quotes.facets().orThrow();
const total = await quotes.count({ filters: { status: ["sent"] } }).orThrow();
const one = await quotes.get(first.items[0].id).orThrow();A cursor belongs to the sort it came from, so start again from the first page when sort changes. A sort, filter, facet or text the entity does not declare returns an invalid_input error. Block lists describes the options every block list shares.
Lifecycle
| Status | How it gets there |
|---|---|
draft | create or fromDeal; lines and fields can change |
sent | send; the quote freezes and gets its link |
viewed | the customer opened the link |
accepted, rejected | the customer answered through the link, or decide recorded their answer |
changes_requested | the customer asked for changes; it can be edited and sent again, or revised |
expired | its valid-until date passed (expire_quotes, or an answer after the date) |
withdrawn | withdraw of a sent or expired quote; it isn't answered until sent again |
The block's expire timer (daily at 03:00) runs expire(), which marks the sent quotes past their
valid-until date expired: schedule it with the other block timers
and run it with the service role's client.
const run = blockTickHandler({ "quotes.expire": () => quotes.expire() });create gives a quote the next number (Q-12, or the format of a quote entity in numbering) and a valid-until date options.validDays (default 30) from today. Its company and contact are records in config.recordTypes (the parties types company and person by default), checked like a deal's (QUOTE_COMPANY_FORBIDDEN).
An imported quote without a title gets options.titleTemplate (default Quote {number}; {number} is the quote's number), so a Dutch tenant sets Offerte {number}.
Over your own quotes table, a company or contact can be one id column of a fixed type, such as a foreign key to your customers, as on invoices. Map the type column to null and name the type in options.company (or options.contact): create and update write the id in the column's own type, refuse another type (QUOTE_COMPANY_UNSUPPORTED), and a read returns the fixed type as company_type. fromQuote on invoices passes the customer on to the invoice.
blocks: {
quotes: {
tables: { quotes: "public.quotes", lines: "public.quote_lines" },
columns: { quotes: { companyType: null, companyId: "customer_id" } },
options: { company: "customer" },
},
}
await quotes.create(organizationId, {
title: "Repair",
company: { type: "customer", id: customerId },
});A line table without a product type column keeps the product id: setLines writes product.id in the column's own type, such as uuid, and the published lines keep it, so restoring a version keeps each line's product.
Unit amounts and totals are Money values from commerce, sent to the database as text so they stay exact past 2^53. Every line must be in the quote's currency (CURRENCY_MISMATCH, checked before the database call), and a quote created without a currency takes the currency of its lines. An unknown code returns CURRENCY_INVALID.
With the catalog block installed, a line can name a
product variant instead of pricing it: { product: { type: "product_variant", id }, quantity: 2 }.
The database takes the variant's price in the quote's currency (from
variant_price) and its title, or its product's title, when the line has no
unitAmount or description. A variant of another organization or without
a price in that currency fails with LINES_INVALID.
send needs at least one line (QUOTE_EMPTY). It returns the link's token once; only its hash is stored.
With options.resend: true, send and publish also take a rejected, withdrawn or expired quote and send it again in one call: the next revision, a fresh valid-until date and a cleared decision, without a draft step in between, so a state machine over quotes records one change from rejected to sent. With workingCopy, such a quote can also be edited before it goes out again. Without the option, those statuses answer QUOTE_NOT_EDITABLE as before.
blocks: { quotes: { options: { workingCopy: true, resend: true } } }await db.quotes.send(rejectedQuoteId, { actor: { name: "Sam" } }).orThrow();Versions
A quote is one working copy. Each send publishes the quote as it is to quote_versions: its revision, a snapshot of the row with its lines and tax lines, the total and who sent it. A published version never changes (QUOTE_VERSION_FROZEN).
revise(quoteId) puts a sent quote back to draft at the next revision, with a fresh valid-until date. It ends the old link and clears the decision, and the next send publishes the new revision. A quote with changes requested can also be edited and sent again; that send publishes the next revision too. An accepted quote can't be revised (QUOTE_ACCEPTED); start a new quote instead.
const history = await db.quotes.versions(quote.id).orThrow();
// [{ revision: 1, total, publishedAt, publishedBy }, ...]
const first = await db.quotes.version(quote.id, 1).orThrow();
first.quote.totals.total; // what the customer saw at revision 1Working copy
With options.workingCopy: true, staff keep editing a sent quote: update and setLines work on a sent or viewed quote and set unpublishedChanges, while the link, view and portalView keep showing the last published version with the quote's current status. publish(quoteId) (or send) publishes the working copy as the next revision on the same link: no new token, so publish returns only the quote. revise keeps the link and a sent quote's status; a declined or withdrawn quote goes back to draft until it is sent again.
When the customer accepts while the working copy has unpublished changes, the block puts the quote's title, currency, validity, terms, pricing, extra columns and lines back to the published version first, so the accepted quote is what the customer saw. A rejection or a change request leaves the working copy alone. The option needs the unpublishedChanges column; mapping it to null fails the render.
blocks: { quotes: { options: { workingCopy: true, versionLines: true } } }await db.quotes.update(quote.id, { title: "Website v2" }).orThrow(); // still sent
await db.quotes.publish(quote.id, { actor: { name: "Sam" } }).orThrow(); // revision 2, same linkVersion lines
With options.versionLines: true, each publish also copies the quote's lines to quote_version_lines: one row per line with its own id, the version's id and the line's position, amounts, rates, section and option flags. The rows never change (QUOTE_VERSION_FROZEN), so a stock hold or the optional lines a customer took can point at them. view, portalView and version return each line's versionLineId, and a decision's selected takes those ids as well as positions. Map tables.versionLines and its columns to keep the rows in your own table, as with the other quote tables.
Each publish copies the line column of the same name into the version lines' own columns that your schema files add, in the same insert, so a check or a reference on your version lines table holds. A version line column without a line column of that name keeps its default.
alter table "better_supabase"."your_table" add column "line_type" public.quote_line_type;
alter table "better_supabase"."your_table" add column "variant_id" uuid;
alter table "better_supabase"."your_table" add column "stock_mode" text;
alter table "better_supabase"."your_table" add column "line_type" public.quote_line_type;
alter table "better_supabase"."your_table" add column "variant_id" uuid;
alter table "better_supabase"."your_table" add column "stock_mode" text;Discount matrix
With options.discountMatrix: true and the catalog block installed, a line that names a catalog variant and has no discountBps takes the discount of the discount matrix for the quote's company (else its contact) and the line's quantity. A line without a unitAmount takes the matrix's fixed price before the catalog price. Values on the line win, and the option is off by default.
Stock holds
With options.holds: true and the inventory block installed, sending a quote holds stock for it. Each published version allocates its lines that name a tracked catalog variant through allocate_stock, at the location with the most stock available. The document type is quote_version, the document id is the version's id and the line id is the quote line's id. What isn't in stock waits on backorder, so a hold never stops a quote from going out, but the organization needs an active stock location. Optional lines the customer didn't take and lines with a zero quantity hold nothing.
The holds end when the quote goes back to draft (revise), is withdrawn, expires or is rejected, and when an order is made from it with order_from_quote, which allocates the order's own lines. Sending the next revision releases the holds of the earlier versions and allocates the new one, once per version. With workingCopy, a sent quote stays sent while staff edit it, so its holds stay until the next send. An accepted quote keeps its holds until the order takes over. list_allocations(tenant, 'quote_version', versionId) lists a version's holds, and release_quote_holds(quoteId) (service role) releases them all. Without the inventory block, the option fails when the SQL renders.
blocks: { quotes: { options: { holds: true } }, inventory: {} }Pricing
A quote can take prices that include tax, a discount on the whole document and a deposit:
await db.quotes.update(quote.id, {
pricesIncludeTax: true,
discountBps: 500, // 5% off the quote
discountAmount: money(1_000n, "EUR"), // then 10.00 off
depositBps: 3000, // ask 30% of the total on acceptance
});With pricesIncludeTax, unit amounts are gross and the tax is counted out of them, so total is the sum of the lines after discounts. Without it, tax is added on top. The document discount comes off after the line discounts: first discountBps of the net amount, then discountAmount, never more than the net amount.
depositAmount asks a fixed deposit instead of depositBps (one or the other, QUOTE_ATTRS_INVALID for both); depositDue is the amount, at most the total. depositRequired: true makes the customer pay before they accept: their own respond or portalRespond with accepted fails with QUOTE_DEPOSIT_REQUIRED, and the app records the acceptance with decide once the payment arrived. The customer's view returns depositAmount and depositRequired.
A subscription line counts its periods (default 1): { description: "Hosting", quantity: 2, periods: 12, unitAmount } adds quantity times periods times the unit amount, and invoices.fromQuote copies it as that quantity.
Three more line keys are base columns: periods: null is a subscription line with no end (it counts one period in the totals, and the line reads openEnded: true), unit says what one unit is (hour, month), and discountKind (percentage or fixed) says how the line's discount is given. Over your own lines table, discountKind takes the table's enum type and a key a line leaves out takes the column's default. A line that leaves out unit or discountKind on an update keeps the value it had. Delete an app column with one of these names from the block's own table and run better-supabase upgrade.
The database spreads the document discount over the tax rates in proportion to each rate's amount, then computes the tax per rate. quote.taxLines holds the result, one line per tax rate and tax code, with its net, tax, gross and its share of the discount. These lines add up exactly to subtotal, taxTotal and total, so an invoice can show the tax breakdown a VAT invoice needs. pricing.depositDue is depositBps of the total.
Totals your app keeps
With options.totals: "app", the block never counts or writes a quote's totals: your app does, for example with a fixed discount per line or a VAT regime such as reverse charge, exempt or a small-business scheme that keeps the line rates but counts no VAT. setLines returns the totals the quote holds after your triggers ran, and depositDue follows your total. The block still guards them: lines and pricing change only while the quote is open, a published version never changes, and a trigger refuses a change to listTotal, discountTotal, subtotal, taxTotal or total once the quote is accepted, rejected, expired or withdrawn (QUOTE_TOTALS_FROZEN). quote_tax_lines is then yours to fill. Your table may leave out listTotal and discountTotal (map them to null); reads then return the subtotal as the list total and a zero discount, as on invoices.
alter table "better_supabase"."your_table" add column "vat_regime" public.document_vat_regime not null default 'standard';
alter table "better_supabase"."your_table" add column "discount_amount_cents" bigint not null default 0;Sections and optional lines
A line can sit under a section heading and can be optional. An optional line is left out of the totals until it is selected; a required line always counts.
await db.quotes.setLines(quote.id, [
{
description: "Install",
unitAmount: money(121_00n, "EUR"),
taxRateBps: 2100,
section: "Work",
},
{
description: "Support plan",
unitAmount: money(100_00n, "EUR"),
taxRateBps: 2100,
section: "Extras",
optional: true,
},
]);The customer picks optional lines when they accept: selected takes the position of each optional line they take (1-based, as in quote.lines). The others drop out, the totals and tax lines are counted again, and the quote is accepted at those totals. A position that isn't an optional line answers QUOTE_SELECTION_INVALID. The version published when the quote was sent keeps the totals it was sent with.
The customer's page
The customer's page calls two functions that run without signing in:
const quote = await quotes.view(token).orThrow(); // marks it viewed
await quotes
.respond(token, "accepted", { name: "Els Jansen", selected: [2] })
.orThrow();view returns the quote without internal notes: its identifier, title, status, currency, valid-until date, terms, pricing, totals, lines and tax lines. respond takes accepted, rejected or changes_requested with the customer's name, a note and the optional lines they take; after the valid-until date it expires the quote instead. It resolves to the new status, the identifier and the revision. A revised or unknown link answers QUOTE_LINK_INVALID. Rate-limit the page with the rate-limit module or your edge.
The customer's answer records their name, the time, their IP address (the last x-forwarded-for entry) and their user agent, in decidedBy, decidedAt, decidedIp and decidedUserAgent.
decide(quoteId, decision, { by, note, selected }) records an answer the customer gave another way, such as by phone, with the member who recorded it in decidedUserId. decidedBy is the name you pass as by (or the actor's name or email); without one it stays empty, so a member's user id never shows as the signer. The note is also the history's reason when a state machine runs over the quotes table.
withdraw(quoteId, { reason, actor }) takes back a sent quote; the reason goes to the state machine's history.
await quotes
.decide(quoteId, "rejected", { by: "Els Jansen", note: "Too expensive" })
.orThrow();
await quotes.withdraw(otherId, { reason: "Prices changed" }).orThrow();In your own portal
An app with its own customer portal, without the guests block, reads and answers on the customer's behalf with the service role. portalView returns the customer's view of any quote that isn't a draft to the service role, and decide takes the customer as actor: their name, email, IP address and user agent go to decidedBy, decidedIp and decidedUserAgent, an id to decidedUserId, and a quote past its valid-until date expires instead, as with the link. decide then returns the expired quote, so check its status before you treat the answer as recorded.
await quotes
.decide(quoteId, "accepted", {
selected: [versionLineId],
actor: { name: "Els Jansen", email: "els@example.com", ip, userAgent },
})
.orThrow();portalView(quoteId, { actor }) passes the customer who opened the quote, so the viewed change keeps who they were; only the service role may name one (QUOTE_ACTOR_FORBIDDEN). send, publish, revise and withdraw take { actor } too. The actor goes to the state machine's history when a machine runs over the quotes table, and the customer's own answers and views through the link or the portal pass their name, email, IP address and user agent there as well. expire_quotes clears the actor, so an expiry never inherits one from earlier in the transaction. Every status change the block makes carries its actor, so a machine can write its history rows itself (history: { write: true }).
In the portal
A signed-in guest (see guests) answers without a token. The quote must be shared with them: through a guest grant on the quote, or as a guest of its company or contact. A draft is never shared.
const page = await db.quotes.portalView(quoteId).orThrow(); // marks it viewed
await db.quotes.portalRespond(quoteId, "accepted", { selected: [2] }).orThrow();portalView returns the same view as the link. portalRespond records the guest's user id with the name (their email unless you pass name), the IP address and the user agent. A quote that isn't shared with the caller answers QUOTE_NOT_FOUND.
From a deal
fromDeal(dealId) makes a draft from the deal's name, company, primary contact, currency, owner and lines, or one line for its amount when it has none. It returns the same quote when called again, and with the relations module installed, it links the quote to the deal with created_from, so lineage shows deal, quote, invoice.
Retry a create
create takes an idempotencyKey when createQuotes gets the idempotency option (createIdempotency(...) from better-supabase/blocks/queue). A retry with the same key and input returns the first quote and records no second quote.created, a retry that overlaps the first answers conflict (IDEMPOTENCY_KEY_IN_USE), and the same key with other input answers validation (IDEMPOTENCY_KEY_REUSED).
Duplicate a quote
duplicate({ quote, title?, input? }) starts a new draft from a quote you hold, such as the result of create, update or revise, or a row read from the table. It composes create: the copy keeps the customer, owner, currency, pricing, terms, note, extra columns and lines, and is titled <title> (copy) unless title says otherwise. It leaves out the validity date, the origin, the status, the number and the history, so the copy takes the next number and starts as a draft. input overrides any field. There is no database function behind it and no separate quote getter: load the quote with the method or table read you already use, then pass it in. create hooks and checks run for the copy.
const copy = await db.$blocks.quotes
.duplicate({
quote,
input: { validUntil: Temporal.PlainDate.from("2026-12-31") },
})
.orThrow();On a record page
quotesBinding loads the quotes that name a record as their company or contact, newest first, through quotes.list({ subject, limit }). The organization comes from options.tenant: without it the call fails with TENANT_REQUIRED. The read needs the quotes read key, shows at most limit quotes (default 50, up to 200) and goes stale on quote.* events. It has no writes, because a quote carries lines, money and dates, which a Server Action can't carry.
Events
| Event | Data |
|---|---|
quote.created, quote.updated, quote.viewed, quote.expired | organizationId, quoteId, subjectType, subjectId, identifier |
quote.sent, quote.revised | the same, with the revision |
quote.accepted | the same, with total, currency, byName, revision and depositDue |
quote.rejected, quote.changes_requested | the same, with the customer's note |
With the notifications module installed, the quote's owner gets a quote.decided notification when the customer answers, labeled with the quote's identifier and title. options.notifications: false sends none, so the app can send its own from the events.
blocks: {
quotes: {
options: {
notifications: false;
}
}
}Your own fields
Columns you add to quotes with alter table in your own schema files are fields of the block (details):; a published version keeps their values. create and update write them from fields,
and every method that returns a quote return them in fields. Pass a Standard Schema as fields
to type them: writes are validated before they reach the database (a
validation error), and reads are parsed. hooks refuses, rewrites or
observes any method; see extending blocks.
alter table "better_supabase"."line" add column "region" text;Columns you add to line with alter table in your own schema files are fields of the block (details):, keyed by column
name with their SQL type: each line's fields writes them, and lines come back with them under fields (untyped,
since fields validates the record's own columns). A line table of yours
runs the same way; see line tables.
setLines and the restore on acceptance write each line's own columns and its extra columns in
one statement, so a check across both holds, such as check (pricing_mode <> 'fixed' or quantity = 1).
A new line without a key in fields gets the column's default, and an existing line keeps its value.
const client = createQuotes({
transport,
fields: v.object({ region: v.optional(v.picklist(["eu", "us"])) }),
});
await client.create(organizationId, {
title: "Rollout",
fields: { region: "eu" },
});Hooks
The module calls before_quote_send(quote uuid), after_quote_send(quote uuid), before_quote_accept(quote uuid) and after_quote_accept(quote uuid), so an app can check margins before a quote goes out or start an order when it is accepted.
Errors
| Hint | Cause |
|---|---|
QUOTE_FORBIDDEN | the caller lacks quotes.write |
QUOTE_ATTRS_INVALID | a missing title or a field with a bad value |
QUOTE_NOT_FOUND | no quote the caller can edit |
QUOTE_NOT_EDITABLE | the quote was sent; revise it |
QUOTE_ACCEPTED | an accepted quote isn't revised; start a new quote |
QUOTE_SELECTION_INVALID | selected names a position that isn't an optional line |
QUOTE_VERSION_FROZEN | a published version never changes |
QUOTE_VERSION_NOT_FOUND | the quote has no version at that revision |
QUOTE_PRICING_UNSUPPORTED, QUOTE_DISCOUNT_UNSUPPORTED, QUOTE_DEPOSIT_UNSUPPORTED | your quotes table has no column for that setting |
QUOTE_DEPOSIT_REQUIRED | the customer pays the deposit before accepting; the app calls decide |
QUOTE_ACTOR_INVALID | actor isn't an object, or its ip or id isn't valid |
QUOTE_ACTOR_FORBIDDEN | only the service role names who opened a quote |
QUOTE_TOTALS_FROZEN | with totals: "app", an answered, expired or withdrawn quote's totals |
QUOTE_EMPTY | a quote without lines can't be sent |
QUOTE_NOT_OPEN | the quote doesn't take an answer now |
QUOTE_NOT_SENT | a draft is edited, not revised |
QUOTE_DECISION_INVALID | answer accepted, rejected or changes_requested |
QUOTE_LINK_INVALID | the link is unknown or was withdrawn |
QUOTE_NAME_REQUIRED | the customer's answer needs a name |
QUOTE_ORIGIN_NOT_FOUND | no deal the caller can quote |
CURRENCY_MISMATCH | a line isn't in the record's currency; returned before any database call |
CURRENCY_INVALID | the currency isn't an ISO 4217 code |
LINES_CURRENCY | a line sent straight to SQL isn't in the record's currency |
Without the client
db.quotes is this client. Code that does not go through bsb.db() builds it with a transport and an organization id:
import { createQuotes } from "better-supabase/blocks/quotes";
import { money } from "better-supabase/commerce";
const quotes = createQuotes({ transport });
const quote = await quotes.fromDeal(dealId).orThrow();
await quotes
.setLines(quote.id, [
{
description: "Licences",
quantity: 10,
unitAmount: money(100_000n, "EUR"),
taxRateBps: 2100,
},
{
description: "Setup",
unitAmount: money(50_000n, "EUR"),
discountBps: 2000,
taxRateBps: 2100,
},
])
.orThrow();
const { token } = await quotes.send(quote.id).orThrow();
// Email the customer a link such as https://app.example.com/q/{token}Line costs and billing parties
A line can carry discountAmount next to discountBps, a unitCost with a
costSource (catalog, average, manual or imported), a taxCodeId, a
locationId and a binId. A line without a product is free text, and the
same product can appear on several lines. billingParty says who pays a
line (customer, internal, own_warranty, supplier_warranty or
cost_account), with a billingPartyId or billingAccountId.
quote_totals_by_billing_party(document) returns the totals and the cost per billing party.
Variants
A quote can have several variants: alternative scopes or prices of one offer, such as an option A and an option B. createVariant copies a quote into a new draft with its own label. A row written directly through the Data API can't set the public link token or a customer decision (an insert outside an import or the service role clears them), and its variantOf must name a quote of the same organization (QUOTE_VARIANT_TENANT). No variant is selected at first, and an unselected variant can't become an order or an invoice (QUOTE_VARIANT_NOT_SELECTED). selectVariant marks one variant selected and its siblings not selected. With forward it also makes the order (order_from_quote) or the invoice (invoice_from_quote) from the selected variant.
const b = await bsb.quotes.createVariant(quoteId, "Option B").orThrow();
const picked = await bsb.quotes
.selectVariant(b.id, { forward: "order" })
.orThrow();
picked.orderId; // the order made from option B
picked.variants; // every variant of the group, with isSelectedlistVariants(quoteId) returns the group, the first quote first. Each variant has variantOf, variantLabel and isSelected. The SQL functions are create_quote_variant, list_quote_variants and select_quote_variant.
| Hint | Cause |
|---|---|
QUOTE_VARIANT_INVALID | a bad label or forward, or the quote has no variants |
QUOTE_VARIANT_TENANT | variantOf names another organization's quote |
QUOTE_VARIANT_LABEL_TAKEN | another variant of the quote has that label |
QUOTE_VARIANT_NOT_SELECTABLE | a withdrawn, rejected or expired variant can't be selected |
QUOTE_VARIANT_NOT_SELECTED | the quote is one of several variants and wasn't selected |
Draft from a deal
draftFromDeal({ dealId, title, validUntil, lines }) creates the quote from the deal, then sets the lines and the header you pass. With only dealId it is fromDeal. If setting the lines fails, the draft stays and the error comes back.
Last updated on
Deals
Deals on pipelines with amounts in minor units, a company and contacts, a deal team, line items, forecast calls with attainment, close-date slips, a next step, locking and batched edits that reject per change.
Goals
Goals per period for a member, a team or the organization, with progress the database computes for won deals, completed work items and paid invoices, or a value the app keeps.