.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 | |
|---|---|
GetMarkupJson | The markup profile as indented JSON (the ArtisanMarkup dialog): Name, Notes, the main-stone cost bands P100_90 … |
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. |
SetMarkup | Updates one or more markup values and saves Markup.json (the dialog’s Accept). |
SetTaxes | Updates the tax profile and saves Taxes.json (the dialog’s Accept). |
TaxRegions | 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). |
GetMarkupJson
string PricingExtraApi.GetMarkupJson()
The markup profile as indented JSON (the ArtisanMarkup dialog): Name, Notes, the main-stone cost bands P100_90 … P10_0 (markup % by how much of the total cost the main stone represents), OnlySettingMarkup (% when only the setting is sold) and the loose diamonds/gemstones bands D0_030, D030_049, D050_069, D070_099, D10 (by carat). 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. {“P100_90”: “35”, “only_setting_markup”: “120”, “Name”: “Retail”}; names are matched ignoring case and underscores. Fields not given keep their value. Returns the profile JSON after the change.
| Parameter | Type | Default |
|---|---|---|
values | IDictionary<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.
| Parameter | Type | Default |
|---|---|---|
mode | string | null |
region | string | null |
taxId | string | null |
uniqueTaxPercentage | double | double.NaN |
includeTaxesToPricing | bool? | null |
name | string | null |
notes | string | null |
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.
| Parameter | Type | Default |
|---|---|---|
mode | string | required |
Returns IReadOnlyList<TaxRegion>.