Skip to content
Light
English

Quantity Pricing Integration

This article explains how to integrate the quantity pricing module.

Quantity pricing integration is performed by sending a JSON string containing the price-by-quantity variations in field 27 of records in Table 13 - Product Prices.

Below is a practical scenario to facilitate understanding.

Suppose the price of the product 20 KG BAG RICE FEED has the following tier prices:

Tier Description

Minimum Quantity

(>=)

List PriceMaximum DiscountMinimum PriceMaximum MarkupMaximum Price
Under 100 KG0$ 19.0010%$ 17.1012%$ 21.28
Between 100 and 200 KG5$ 18.508%$ 17.0214%$ 21.09
Between 200 and 500 KG10$ 18.006%$ 16.9216%$ 20.88
Between 500 and 800 KG25$ 17.504%$ 16.8018%$ 20.65
800 KG or more40$ 17.002%$ 16.6620%$ 20.40

The JSON string representing the example scenario is shown below:

NOTE: At the end of this article you will find the documentation for each JSON attribute.

[
{
"descricao": "Under 100 KG",
"qtdeInicial": 0,
"valorUnitario": 19,
"percDescontoMaximo": 10,
"percAcrescimoMaximo": 12
},
{
"descricao": "Between 100 and 200 KG",
"qtdeInicial": 5,
"valorUnitario": 18.5,
"percDescontoMaximo": 8,
"percAcrescimoMaximo": 14
},
{
"descricao": "Between 200 and 500 KG",
"qtdeInicial": 10,
"valorUnitario": 18,
"percDescontoMaximo": 6,
"percAcrescimoMaximo": 16
},
{
"descricao": "Between 500 and 800 KG",
"qtdeInicial": 25,
"valorUnitario": 17.5,
"percDescontoMaximo": 4,
"percAcrescimoMaximo": 18
},
{
"descricao": "800 KG or more",
"qtdeInicial": 40,
"valorUnitario": 17,
"percDescontoMaximo": 2,
"percAcrescimoMaximo": 20
}
]

NOTE: For easier viewing, line breaks and formatting are shown; however, when sending data in Demander’s standard layout, line breaks should not be included.

Below is the simplest version of the JSON, containing only the mandatory attributes.

Notice that the initial tier starting at zero is optional; if omitted, the app uses the product’s regular price.

[
{
"qtdeInicial": 5,
"valorUnitario": 18.50
},
{
"qtdeInicial": 10,
"valorUnitario": 18.00
},
{
"qtdeInicial": 25,
"valorUnitario": 17.50
},
{
"qtdeInicial": 40,
"valorUnitario": 17.00
}
]

The JSON to be sent consists of an array of objects, where each object can have the following attributes:

NameAttributeRequiredExplanation
Tier namedescricaoNo

Optional attribute.

Used to provide a descriptive name for the tier.

EX: Up to 100 KG, Above 800 KG

Initial quantityqtdeInicialYes

Determines from which product quantity the price applies.

NOTE: We use >= (greater than or equal to) to match the tier based on quantity.

PricevalorUnitarioYes

Determines the unit value of the product.
% Max discountpercDescontoMaximoNo

Optional attribute.

Determines the maximum discount percentage allowed in this tier.

When omitted, the system uses the default percentage from Table 13 or company settings.

% Max markuppercAcrescimoMaximoNo

Optional attribute.

Determines the maximum markup percentage allowed in this tier.

When omitted, the system uses the default percentage from Table 13 or company settings.

Below is an example of a product price line/record including the quantity pricing JSON:

13|99999|48|UN||200.00|20|0|0|||||||||7.57|2.8||||||||[ { "descricao": "Under 100 KG", "qtdeInicial": 0, "valorUnitario": 19, "percDescontoMaximo": 10, "percAcrescimoMaximo": 12 }, { "descricao": "Between 100 and 200 KG", "qtdeInicial": 5, "valorUnitario": 18.5, "percDescontoMaximo": 8, "percAcrescimoMaximo": 14 }, { "descricao": "Between 200 and 500 KG", "qtdeInicial": 10, "valorUnitario": 18, "percDescontoMaximo": 6, "percAcrescimoMaximo": 16 }, { "descricao": "Between 500 and 800 KG", "qtdeInicial": 25, "valorUnitario": 17.5, "percDescontoMaximo": 4, "percAcrescimoMaximo": 18 }, { "descricao": "800 KG or more", "qtdeInicial": 40, "valorUnitario": 17, "percDescontoMaximo": 2, "percAcrescimoMaximo": 20 }]|
[
{
"qtdeInicial": "5",
"valorUnitario": "100.00",
"percDescontoMaximo": 10.00,
"percAcrescimoMaximo": 10.00
},
{
"qtdeInicial": "5",
"valorUnitario": "92.50",
"percDescontoMaximo": 5.00,
"percAcrescimoMaximo": 5.00
},
{
"qtdeInicial": "20",
"valorUnitario": "80.00"
}
]