Price Tutorials
Last updated
Was this helpful?
Last updated
Was this helpful?
Take a look at the relationships between prices and other resources in the Emporix Commerce Engine.
This tutorial will walk you through the following steps:
The tutorial skips the step of creating a new measurement unit as your Emporix tenant is configured with the most commonly used measurement units out-of-the-box.
A price model defines a repeatable way to sell products. You can create separate price models depending on measurement units for which prices are expressed or depending on products' pricing strategies.
When specifying a price for a product, you need to reference two values from a corresponding price model:
ID of the price model
ID of the model's relevant pricing tier
The ID can be found in the tierDefinition.tiers.id
field.
To learn more about pricing strategies available in the Emporix Commerce Engine, check out the [Pricing guide]((https://app.gitbook.com/o/z8MNPigQv25NZe33g3AV/s/bTY7EwZtYYQYC6GOcdTj/core-commerce/pricing/pricing-v2#price-models).
Implementing any pricing strategy is a process made up of three steps:
To define basic pricing in a PriceModel
object, you need to perform the following actions:
Set the tierDefinition.tierType
field to "BASIC"
.
Add a single tier to the tiers
array and set its quantity
field to 0
.
Here's an example of a request body for a basic price model:
To create a Price
object for basic pricing, you need to perform the following actions:
Set the priceModelId
field to the basic price model's ID.
Retrieve the price model's tierDefinition.tiers.id
value.
Add a single object to the tierValues
array.
Here's an example of a request body for a basic price:
To create a price model for tiered or volume pricing, you need to perform the following actions:
Set the tierDefinition.tierType
field to "TIERED"
or "VOLUME"
, respectively.
Define quantities for pricing tiers in the tiers
array.
When defining pricing tiers, be aware of the following restrictions to the PriceModel
object:
Each minQuantity.quantity
field must contain a unique value.
The tiers must be defined in an ascending order based on their quantity
value.
The quantity
field in the first tier must be set to 0
.
All unitCode
fields must contain the same value.
Here are examples of request bodies for tiered and volume price model:
To create a Price
object for tiered or volume pricing, you need to perform the following actions:
Set the priceModelId
field to the corresponding price model's ID.
Retrieve the price model's tierDefinition.tiers.id
values.
Add an object for each tier to the tierValues
array.
Here's an example of a request body for a tiered and volume-based price:
Take a look at the relationship between prices and customers in the Emporix Commerce Engine:
To make a price valid only for specific customers, you need to add their IDs to the principals
array inside an applicable Price
object.
Here's an example of a customer-restricted price:
Price lists allow you to create personalized sets of prices for selected products. You can manage price lists and their prices through the Emporix API Price Service.
Take a look at the relationships between price lists and other resources in the Emporix Commerce Engine.
Countries and regions are predefined in the Emporix API Country Service. You can check which countries and regions are available by sending requests to the following endpoints:
Price lists are site-specific. You can restrict a price list to particular groups of customers with the countries
, regions
, and customerGroups
fields, and make the list time-limited with the validity
field.
Prices in a list can be expressed in a different currency than originally defined for the list's products.
Make sure to set a value for the currency
field in the request body. Otherwise, the endpoint will respond with a 400
error.
Prices in lists are structured differently from catalog prices. Catalog prices are the ones defined for products in Price
objects, as opposed to PriceListPrice
objects. While each catalog price can be personalized on its own, the validity of all prices in a list is determined by the list's restrictions. A price in a price list needs to reference a relevant product, price model, and pricing tiers.
A single price list can be associated with multiple regions or countries. For this reason, all prices within a list are treated as net values, regardless of the includesTax
value in their indicated price models.
Bulk price creation
The price matching functionality compares all prices defined for specified products and retrieves the best ones based on a set of criteria. The criteria include:
targetCurrency
— Currency in which the prices should be returned.
siteCode
— Site for which the prices will be matched. The price matching functionality will only compare prices assigned to this site.
targetLocation
— Country for which the prices should be returned.
items
— List of products (and their quantities) for which the prices should be compared.
principal
— Customer to whom the prices should apply. When specified, the price matching functionality will compare both non-personalized prices as well as the ones offered exclusively to the specified customer.
useFallback
— If no price that matches the criteria is found for the specified site, the price matching functionality will try to find the best price for the main site. To enable this option, this field needs to be set to true
.
Prices are stored in the system as defined in the price model, with no initial net or gross calculations. Calculations occur during the PriceMatch and PriceSearch algorithms. However, PriceSearch is related to catalog prices only.
The includesTax
setting, defined at the site or price model level, determines if the algorithm returns net or gross prices. The tax service then manages specific cases:
Gross to Net: Returns a net price from a gross price for a specific country.
Net to Gross: Converts a net price to a gross price using a country's specific tax class.
Gross to Gross: Adjusts a gross price between countries by first converting to net, then applying the destination country's tax class.
To find out how the price matching functionality works in detail, check out the flowchart.
The process shown in the flowchart is repeated for each product indicated in the request.
To find out how the price matching functionality works in detail, check out the flowchart.
Price lists take precedence over catalog prices. Catalog prices are the ones defined for products in Price
objects, as opposed to PriceListPrice
objects. If there are price lists that match the request criteria, the price matching algorithm checks whether these lists contain prices for requested products before searching through catalog prices.
To find out how the price matching functionality handles price lists, check out the flowchart.
Now, define a couple of prices that the price matching functionality will be able to compare.
Then, define a price model where the price per kilogram changes based on the ordered quantity:
Check the best price for both one kilogram and ten kilograms of bananas:
The lowest prices are returned in the priceId
fields. The total price for defined quantities is returned in the totalValue
fields.
This tutorial presents how to calculate gross prices between countries based on Price
objects.
Gross prices between countries are calculated based on these countries' sales tax rates.
When calculating a gross price for another country, the price matching functionality checks tax classes assigned to the product that the original price is defined for.
The gross price calculated for the specified country is returned in the totalValue
field.
When calculating a price in another currency, the price matching functionality checks the defined exchange rate between the desired currency and the one in which price is originally expressed.
Important
Currently, the exchange rates are defined statically and are not influenced by actual currency exchange rates. If you want the statically defined exchange rates to reflect the actual rates more closely, you will need to manually update these on a regular basis.
The price calculated in the specified currency is returned in the totalValue
field.
To always retrieve prices for a particular site as net values, you need to set that site's includesTax
field to false
.
If you don't specify a site's includesTax
value, the price matching functionality will return a price as gross or net based on the includesTax
value specified in the price's model.
includesTax
field.
.
.
.
To learn more about measurement units in the Emporix Commerce Engine, check out the .
Each currency accepted by your business is stored as a separate object that can be managed through the Emporix API .
To add a new entry to your configuration of currencies, you need to send a request to the endpoint.
To learn more about price models in the Emporix Commerce Engine, check out the .
To create a new price model, you need to send a request to the endpoint.
Price models that use the basic pricing strategy have one tier. To retrieve its ID, you need to send a request to the endpoint.
To define a new price for a product, you need to send a request to the endpoint.
Creating a PriceModel
object through the endpoint.
Retrieving IDs of the model's pricing tiers through the endpoint.
Creating a Price
object through the endpoint.
Make sure you have already finished the tutorial.
Customer
objects are managed through the Emporix API .
Make sure you have already finished the tutorial.
To create a new price list, you need to send a request to the endpoint.
To create a new list-specific price, you need to send a request to the endpoint.
You can add multiple prices to a list at once by sending a request to the endpoint.
If you want the price matching functionality to compare prices expressed in multiple currencies, you need to define exchange rates between these currencies and the targetCurrency
through the endpoint.
To check out the flowchart for the Look for the best price in price lists subprocess, check out the section.
Make sure you have already finished the tutorial.
Create a sample product through the endpoint. For this tutorial, we've chosen bananas as an example:
Start with defining a price model with endpoint where the bananas' price per kilogram is constant regardless of the ordered quantity:
Now, retrieve the automatically-generated ID of the pricing tier, use the endpoint
Once you know the tier ID, define a price for the bananas, use the endpoint:
Now, retrieve the automatically-generated IDs of the pricing tiers, use the endpoint
Once you know the tier IDs, define another price for the bananas, use the endpoint.
Now that you have defined multiple prices for the bananas, you can send a request to the endpoint to find which price is the lowest.
You can calculate gross prices between countries through the endpoint.
To learn how to calculate gross prices between countries based on specific values, check out tutorial in the Tax classes — Developer Guide.
Make sure you have already finished the tutorial.
Define sales tax rates for the desired country by sending a request to the endpoint.
To update a product with applicable tax classes, send a request to the endpoint.
To calculate a gross price between countries, send a request to the endpoint.
You can calculate a price's value in another currency through the endpoint.
Make sure you have already finished the tutorial.
Add the currency in which the price will be retrieved to your configuration of currencies by sending a request to the endpoint.
To define a new exchange rate, send a request to the endpoint:
To retrieve a price in the desired currency, send a request to the endpoint.
When you retrieve prices through the endpoint, their values will be gross or net based on the includesTax
value specified in these prices' models.
To retrieve prices as gross or net based on their sites' settings, you need to retrieve them with the .
You can manage your sites through the Emporix API .
To add or update the includesTax
field in your site's settings, you need to send a request to the endpoint.
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.
To test the endpoint, open the API reference below or check the example of a curl request.