Prices
Saleor API has four different types that represent prices. The most basic type consists of a currency code and a numeric amount. The most complex one can define a range of prices, including net, gross, and tax amounts. The numeric amount precision is determined by the precision of the price currency. For example, USD has a precision value of 2, such as $1.00.
Saleor does not enforce any particular set of currency codes, but we strongly recommend using the three-letter codes defined by the ISO 4217 standard.
Displaying prices
Presenting a number depends on the language and region. If you are building a web application, we recommend using the internationalization API provided by the browser.
- See MDN documentation on
Intl.NumberFormat
API Reference
Money
Money
is a type for keeping prices without taxes. We do not restrict currency code values, so a user can use crypto-currencies or other custom currencies.
type Money {
currency: String!
amount: Float!
}
currency
: Currency code for price. Currency depends on the chosen Channel.amount
: Price amount.
TaxedMoney
The most common example of TaxedMoney
is a ProductVariant
price. If a user does not use any tax integration, both net and gross prices will be populated with the same value.
type TaxedMoney {
currency: String!
gross: Money!
net: Money!
tax: Money!
}
currency
: Currency code for price. Currency depends on the chosen Channel.gross
: Gross value (price with taxes).net
: Net value (price without taxes).tax
: Tax value.
MoneyRange
MoneyRange
is used to display prices for a ShippingZone
.
type MoneyRange {
start: Money
stop: Money
}
start
: Lowest price in the range.stop
: Highest price in the range.
TaxedMoneyRange
TaxedMoneyRange
is used in Products
, because variants can differ in prices. You can display it as "price starts from $10" or "$10–$20".
type TaxedMoneyRange {
start: TaxedMoney
stop: TaxedMoney
}
start
: Lowest price in the range.stop
: Highest price in the range.