Skip to content

Price calculation ​

The Orisha Commerce platform provides a flexible endpoint to calculate the price of a specific item for a specific customer, in a specific currency and unit of measure (UOM).

Multiple pricing sources are evaluated in a specific order, and the first available price is returned (not necessarily the lowest). Promotional prices based on quantity tiers may override fixed prices.

Pricing sources ​

In order of priority.

  1. Customer-specific pricing on items (tiers only): Prices directly assigned to an item for a specific customer (including quantity tiers).
  2. Customer-specific price lists: Prices from a price list assigned to a specific customer.
  3. Default price lists: Platform-wide price lists used when no customer-specific list is set.

INFO

If the requested unit of measure doesn’t have a price set, the system attempts to use the base UOM and applies a conversion factor to calculate the price. This only applies to non-tiered prices.

Calculation summary ​

Below a high overview of how we get to a result.

StepDescription
1Get item, customer, and currency
2Validate unit of measure
3Look for prices: customer price list β†’ default price list
4Apply UOM conversion if needed
5Look for discount in tiers: item customer tier β†’ customer price list tier β†’ default price list tier
6Run post-pricing hook
7Return calculated price

VAT Handling ​

The VAT rate is determined by:

  • The country code in the request.
  • The VAT tariff of the item.

If no VAT rate is configured for this combination, an error is returned.

Post-processing with hooks ​

After the base price is calculated, a PostPricingCalculation hook is executed. This allows for custom logic (e.g. discounts, rounding) defined by the customer to adjust the final price before it is returned.