Skip to content

.NET API

PricingExtraApi

The company’s pricing PROFILES that live next to the manufacturer file but are not part of it (so PricingApi.GetSettingsJson/SetSetting cannot reach them): the markup profile (ArtisanMarkup, Markup.json) and the tax profile (ArtisanTaxes, Taxes.json), both in the pricing folder.

from ArtisanPlugin.Scripting import PricingExtraApi

See also the Python package, ra.pricing.

Methods

Method
GetMarkupJsonThe markup profile as indented JSON (the ArtisanMarkup dialog).
GetTaxesJsonThe tax profile as indented JSON (the ArtisanTaxes dialog): Mode (None, European, American, Canadian, OtherCountry), the region and tax id of that mode (EuropeanCountry/EuropeanVatId, AmericanState/ AmericanSaleTaxId, CanadianProvince/CanadianSaleTaxId, OtherCountry/ UniqueTaxPercentage) and IncludeTaxesToPricing.
SetMarkupUpdates one or more markup values and saves Markup.json (the dialog’s Accept).
SetTaxesUpdates the tax profile and saves Taxes.json (the dialog’s Accept).
TaxRegionsThe valid regions for a tax mode, to pick region in SetTaxes: EU member countries (European), US states (American), Canadian provinces (Canadian) or every country (OtherCountry).

GetMarkupJson

string PricingExtraApi.GetMarkupJson()

The markup profile as indented JSON (the ArtisanMarkup dialog). Every block is “fixed” (one percentage) or “dynamic”: the setting (SettingMode, OnlySettingMarkup as the fixed %, P100_90 … P10_0 as the tiers by the main stone’s share of the cost), natural diamonds (DiamondMode, DiamondMarkup, DiamondMatrix: shape -> carat range -> %, where the ALL row is the base and a shape only holds the cells that differ), lab-grown diamonds (LabMode, LabMarkup, LabMatrix; while the three are null they follow the natural ones) and colored gemstones (GemstoneMode, GemstoneMarkup, GemstoneRanges by cost, each with UpTo and Percentage, UpTo null for the open last one). Also Name and Notes; D0_030 … D10 are the carat tiers of older profiles, read only when there is no DiamondMatrix. All values are percentages. Read-only.

Returns string.

GetTaxesJson

string PricingExtraApi.GetTaxesJson()

The tax profile as indented JSON (the ArtisanTaxes dialog): Mode (None, European, American, Canadian, OtherCountry), the region and tax id of that mode (EuropeanCountry/EuropeanVatId, AmericanState/ AmericanSaleTaxId, CanadianProvince/CanadianSaleTaxId, OtherCountry/ UniqueTaxPercentage) and IncludeTaxesToPricing. Read-only.

Returns string.

SetMarkup

string PricingExtraApi.SetMarkup(IDictionary<string, string> values)

Updates one or more markup values and saves Markup.json (the dialog’s Accept). values maps field name -> value, e.g. {“SettingMode”: “dynamic”, “P100_90”: “35”, “diamond_markup”: “40”, “Name”: “Retail”}; names are matched ignoring case and underscores, modes are “fixed” or “dynamic”, and an empty value clears an optional percentage. DiamondMatrix and LabMatrix take a JSON object that is merged cell by cell, e.g. {“ALL”: {“c100_149”: 40}, “ROUND”: {“c100_149”: 45}}: shapes are ALL, ROUND, PRINCESS, CUSHION, EMERALD, PEAR, OVAL, RADIANT, ASSCHER, MARQUISE and HEART, ranges are c030_049, c050_069, c070_099, c100_149, c150_199, c200_299 and c300, and null empties a cell. GemstoneRanges takes the whole JSON list, e.g. [{“UpTo”: 300, “Percentage”: 150}, {“Percentage”: 100}], where the range without UpTo is the open last one. Setting a lab-grown field gives the lab-grown diamonds their own copy of the natural values first; an empty LabMode makes them follow the natural ones again. Fields not given keep their value, and nothing is saved when a value is rejected. Returns the profile JSON after the change.

ParameterTypeDefault
valuesIDictionary<string, string>required

Returns string.

SetTaxes

string PricingExtraApi.SetTaxes(
    string mode = null,
    string region = null,
    string taxId = null,
    double uniqueTaxPercentage = double.NaN,
    bool? includeTaxesToPricing = null,
    string name = null,
    string notes = null)

Updates the tax profile and saves Taxes.json (the dialog’s Accept). Every argument is optional; null/NaN keeps the stored value. mode None, European, American, Canadian or OtherCountry region country / state / province of the (new or stored) mode, by code or name — see TaxRegions() taxId the VAT id (European) or sale tax id (American, Canadian); ignored by the other modes uniqueTaxPercentage flat tax % (OtherCountry only) includeTaxesToPricing bake the tax into prices (European and OtherCountry only, as in the dialog) name, notes the profile’s info fields Returns the profile JSON after the change.

ParameterTypeDefault
modestringnull
regionstringnull
taxIdstringnull
uniqueTaxPercentagedoubledouble.NaN
includeTaxesToPricingbool?null
namestringnull
notesstringnull

Returns string.

TaxRegions

IReadOnlyList<TaxRegion> PricingExtraApi.TaxRegions(string mode)

The valid regions for a tax mode, to pick region in SetTaxes: EU member countries (European), US states (American), Canadian provinces (Canadian) or every country (OtherCountry). Read-only.

ParameterTypeDefault
modestringrequired

Returns IReadOnlyList<TaxRegion>.