Skip to content

.NET API

PricingApi

Headless pricing facade for scripts and Flow Studio. It wraps the SAME engine the Breakdown panel uses (BreakdownService -> BreakdownObject.Compute), so the number the chat reports and the number the panel shows can never diverge.

from ArtisanPlugin.Scripting import PricingApi

See also the guide, Pricing, and the Python package, ra.pricing.

Methods

Method
CalculateRecomputes the price for the current document using the active manufacturer / market and returns the totals plus the per-category breakdown.
CalculateDetailedLike Calculate(), but returning the SAME line-level detail the Breakdown panel shows: one line per metal (weight, waste, price), per certified diamond, per gem group (count, carats, sieve, price per carat, setting type), per process (metal processes, setting labor, additionals) and per extra component.
GetSettingsJsonThe settings as indented JSON — the whole manufacturer, or just the node at path (dot-separated, case-insensitive, [n] for list items: “Markets”, “Diamonds.CertificateFromCt”, “Cfp.Items[2]”).
SetSettingUpdates ONE cost value by path and persists the manufacturer file — e.g.
ShowPanelOpens the Breakdown (price details) panel.

Calculate

PriceResult PricingApi.Calculate(bool quoteCertified = true, bool? export = null)

Recomputes the price for the current document using the active manufacturer / market and returns the totals plus the per-category breakdown. Use it to answer “what’s the price?” without opening the panel. quoteCertified false = skip the live Nivoda quotes for the certified diamonds (every diamond above the manufacturer’s CertificateFromCt threshold): fast and offline, but those stones price as 0. Default true = quote them live with your saved Nivoda filter, like the panel. export true = export sale: metal is costed without the import duty / levy set in Breakdown Settings; false = domestic (duty included); null keeps the document’s current choice.

ParameterTypeDefault
quoteCertifiedbooltrue
exportbool?null

Returns PriceResult.

CalculateDetailed

PriceBreakdownDetails PricingApi.CalculateDetailed(
    bool quoteCertified = true,
    bool? export = null)

Like Calculate(), but returning the SAME line-level detail the Breakdown panel shows: one line per metal (weight, waste, price), per certified diamond, per gem group (count, carats, sieve, price per carat, setting type), per process (metal processes, setting labor, additionals) and per extra component. Read-only.

ParameterTypeDefault
quoteCertifiedbooltrue
exportbool?null

Returns PriceBreakdownDetails.

GetSettingsJson

string PricingApi.GetSettingsJson(string path = null)

The settings as indented JSON — the whole manufacturer, or just the node at path (dot-separated, case-insensitive, [n] for list items: “Markets”, “Diamonds.CertificateFromCt”, “Cfp.Items[2]”). Read-only.

ParameterTypeDefault
pathstringnull

Returns string.

SetSetting

void PricingApi.SetSetting(string path, string value)

Updates ONE cost value by path and persists the manufacturer file — e.g. SetSetting(“Markets.Gold”, “68.5”) or SetSetting(“Diamonds.CertificateFromCt”, “0.30”). The value string is converted to the target type (number, bool, string or enum name). The next Calculate() prices with the new value.

ParameterTypeDefault
pathstringrequired
valuestringrequired

ShowPanel

void PricingApi.ShowPanel()

Opens the Breakdown (price details) panel. Call after Calculate() so the panel shows the freshly computed totals. Must run on the UI thread (Flow Studio’s Apply does).