Changes data

quotecloud_patch_pricing_table

Edit the rows of one pricing table. Supply exactly one operation family. rowOperations (addRow, addHeadingRow, insertProductRow, updateRow, deleteRow, replaceAllRows) is the normalized family: it addresses rows by the stable rowId reported by quotecloud_inspect_structure plus that response's document revisionToken, and works on documents in either contentMode: a data_file_blob document is rewritten in storage, a fine-grained one has the same operations applied to its revisioned rows, and the arguments and result shape are identical either way. operations is the revisioned family for fine-grained documents: it patches settings, rows, and cells directly, needs expectedBlockRevision plus each row/cell revision, and requires cells to be deleted before their row. Rows reported with addressable: false have no stable id and cannot be targeted individually; replaceAllRows rewrites the whole table instead. Headings are plain unless given an optionalType; a single priced row is made optional with optional: true. Every write recomputes the document totals. deleteRow and replaceAllRows destroy rows and require confirmation: a call containing either is answered with status confirmation_required, a preview naming every operation, and a one-time confirmToken; re-send the identical arguments with that confirmToken to apply them. A call that only adds, inserts or updates rows applies immediately: updateRow overwrites only the fields it names, so correcting a price or a label needs no confirmation. insertProductRow links a row to the product catalogue instead of describing it: give it a productId (or a planId) and the server builds the row the editor's own product picker would build for that product, field for field: the catalogue price with its quantity-discount tier applied, SKU, cost, tax, term, the product's locks (price/label/description/term), recipient-editable quantity and term from the product's options, its attachments, and the full product snapshot the row carries for later re-pricing. A bundle expands to its heading, parent and member rows sharing one bundle group; a plan expands to a plan group whose rows are all locked to the plan's term, or, when the plan is priced at zero, to plain rows on that term. Multi-row insertions land contiguously at the requested position. Missing product descriptions stay empty and never receive placeholder text. Products the picker cannot reach are refused rather than approximated: an inactive product with product_inactive, an inactive or out-of-window plan with product_plan_inactive / product_plan_not_sellable, an unknown variant with product_variant_not_found. Inserting a term-based product or a plan into a table with no term column adds one, and a product carrying data items adds a column per item; the response reports these as addedColumnIds on the change entry. Use updateRow afterwards to depart from the catalogue values. addRow, updateRow and replaceAllRows take a lineAdjustment for a per-line discount, markup or margin, with the same options and checks as the editor; a table with no discount or cost column gets a hidden one, reported as addedColumnIds. New rows copy the table's default adjustment if it has one. insertProductRow takes none, so follow it with updateRow.

Inputs

documentIdRequired
Convex document ID or company-scoped numeric display ID. string
blockIdRequired
string
lockTokenRequired
Stable opaque token for this agent edit session. Reuse it to heartbeat owned element locks. string
revisionTokenOptional
Document revisionToken from quotecloud_inspect_structure. Selects the normalized argument family, which works in either contentMode; the write is refused with a *_revision_conflict if the document moved since it was read. string
rowOperationsOptional
Normalized row operations applied in order, all-or-nothing. Requires revisionToken. list of value
expectedBlockRevisionOptional
number
operationsOptional
Revisioned fine-grained operations. Requires expectedBlockRevision. list of value
confirmTokenOptional
One-time code from the preview. Send it with otherwise identical inputs to run the change. string