If your ERP has contract pricing functionality, the Stock2Shop B2B Trade Store allows you to create custom discount structures for each of your customers.
In the below documentation we will be covering:
A contract exists on either a customer or a product, and it defines the rule for calculating a price. With our contract pricing feature, Stock2Shop can model complex pricing rule hierarchies that may exist in your ERP / accounting system to assign customers to pricing discounts per product.
Think of a contract as a set of rules to determine the price of a product for a specific customer. Below are some examples of how contracts can be set up:
A contract consists of the following elements:
The string representation of a contract looks like this:
order_{int}|entity_{string}|key_{string}|value_{string}|type_{string}
We could fill out a contract like this:
order_0|entity_product|key_category|value_fruit|type_discount
Contracts are stored internally as key value data on customers and products. We call this meta data. Below is an example of some Meta data stored for a customer and product:
{
"customer": {
"company": "Acme Ltd",
"meta": [
{
"key": "Group",
"value": "Wholesale",
}
]
}
}
{
"product": {
"title": "Banana",
"meta": [
{
"key": "Category",
"value": "Fruit",
}
]
}
}
Adding in a contract to a product could look like this:
{
"product": {
"title": "Banana",
"meta": [
{
"key": "Category",
"value": "Fruit",
},
{
"key": "order_0|entity_customer|key_Group|value_Wholesale|type_discount",
"value": "8",
}
]
}
}
The above translates as follows:
For customers in group "wholesale", give 8% off on "bananas".
Adding in a contract to a customer could look like this:
{
"customer": {
"company": "Acme Ltd",
"meta": [
{
"key": "Group",
"value": "Wholesale",
},
{
"key": "order_0|entity_product|key_Category|value_Fruit|type_discount",
"value": "10",
}
]
}
}
The above translates as follows:
For products in category "fruit", give 10% off for "wholesale" customers.