Skip to main content

Pricing & Currency

Quark Commerce supports multi-currency pricing at the variant level. Each product variant can have different prices in different currencies.

How Pricing Works​

Prices are not dynamically converted. Each currency has an explicitly set price per variant. This gives full control over pricing strategy per market.

Price Fields​

FieldDescriptionStorefront Visible
priceCurrent selling priceYes
compareAtPriceOriginal/strikethrough priceYes
costPriceInternal cost priceNo (admin only)

Displaying Sale Prices​

When compareAtPrice is set and greater than price, the product is on sale:

Was: $39.99  →  Now: $29.99  (25% off)
const isOnSale = variant.compareAtPrice && variant.compareAtPrice > variant.price;
const discountPercent = isOnSale
? Math.round((1 - variant.price / variant.compareAtPrice) * 100)
: 0;

Currency Resolution​

The X-Currency-Code header determines which price is returned. If no price exists for the requested currency, the API falls back to the store's default currency.

GET /api/storefront/products/{id}
X-Store-Code: us-store
X-Currency-Code: TRY

The response will include prices in TRY if available.

Getting Available Currencies​

GET /api/storefront/store-config
X-Store-Code: us-store

Returns all currencies configured for the store:

{
"currencies": [
{ "code": "USD", "symbol": "$", "name": "US Dollar", "isDefault": true },
{ "code": "TRY", "symbol": "₺", "name": "Turkish Lira", "isDefault": false }
]
}

Promotion Discounts​

In addition to static pricing, the API evaluates automatic promotions on basket operations. Promotion discounts are calculated server-side and returned as part of the basket response. See Promotions & Discounts for details.

Currency Formatting

The API returns raw numeric values. Your frontend should format prices according to locale conventions (e.g., $29.99 vs 29,99 $). Use Intl.NumberFormat or equivalent for proper formatting.