Merx

Price

How a price is rendered by the API: formatted and raw, gross and net, with its tax.

Fields

The following fields are available in the Price model and can be fetched with the select parameter.

Name Return type
currency null or string
price string
priceRaw float
priceNet string
priceNetRaw null or float
priceIncludingTax null or bool
tax null or Wagnerwagner\Merx\Tax

Views

The following fields are available in the Price model and can be fetched with the view parameter.

Name Fields
compact price
formatted price, priceNet, tax
raw currency, priceRaw, priceNetRaw, tax
default price, priceRaw, priceNet, priceNetRaw, priceIncludingTax, tax

Type

Wagnerwagner\Merx\Price

Examples

The Price model of an example cart, in each of its views.

View: default
{
    "price": "€89.90",
    "priceIncludingTax": true,
    "priceNet": "€75.55",
    "priceNetRaw": 75.5499999999999971578290569595992565155029296875,
    "priceRaw": 89.900000000000005684341886080801486968994140625,
    "tax": {
        "price": "€14.35",
        "priceRaw": 14.3499999999999996447286321199499070644378662109375,
        "rate": "19%",
        "rateRaw": 0.190000000000000002220446049250313080847263336181640625
    }
}
View: compact
{
    "price": "€89.90"
}
View: formatted
{
    "price": "€89.90",
    "priceNet": "€75.55",
    "tax": {
        "price": "€14.35",
        "priceRaw": 14.3499999999999996447286321199499070644378662109375,
        "rate": "19%",
        "rateRaw": 0.190000000000000002220446049250313080847263336181640625
    }
}
View: raw
{
    "currency": "EUR",
    "priceNetRaw": 75.5499999999999971578290569595992565155029296875,
    "priceRaw": 89.900000000000005684341886080801486968994140625,
    "tax": {
        "price": "€14.35",
        "priceRaw": 14.3499999999999996447286321199499070644378662109375,
        "rate": "19%",
        "rateRaw": 0.190000000000000002220446049250313080847263336181640625
    }
}