RemotePriceProvider¶
RemotePriceProvider
can contact an ERP system to get prices for one or more product.
To request prices from ERP, you must provide customer and optional contact number.
Using customer and contact numbers¶
- If the customer and contact numbers are set directly in the price request, they are used.
- If not, and the customer and contact numbers are set in the BuyerParty, they are used.
- If neither customer nor contact number is set and the usage of the template debitor is allowed in the configuration, the customer and/or contact number are determined from the StandardTemplateDebitorService and used.
1 2 |
|
Note
Using template debitor only works if price requests without customer number are enabled for the RemotePriceProvider
.
They can be enabled/disabled in the Configuration Settings of the shop (Price group).
While disabled, an exception is thrown in the remotePriceProvider
and fallback is used.
1 2 3 4 5 6 7 8 9 |
|
Request to the ERP/Web.Connector¶
The Web.Connector service uses the data from PriceRequest
to build the ERP Request object.
The ERP request contains header information such as the customer number and an optional contact number and, if applicable, the delivery address.
Information about requested products is also part of the request.
1 2 3 4 5 6 7 |
|
Delivery information (required for calculating shipping costs)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
|
Information about the requested products
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
|
Response from the ERP/Web.Connector¶
The ERP provides a price response using the UBL format.
The whole ERP response object is returned back to RemotePriceProvider
and is used for price calculation.
For each requested product an orderLine
in the response can be provided.
If ERP doesn't recognize the requested product, it might not return any information about this product at all.
It is also possible that ERP returns more order lines than requested.
This might have several reasons:
- additional costs such as shipping costs, costs for payment on delivery and others
- discounts
- additional products, that are MUST HAVE, if some special products were requested, or e.g. if the price totals of ordered products is over a specific amount
VAT¶
If the ERP System does not provide information about VAT, the VAT can be determined in the shop.
In that case the shop uses VatService to get the vatPercent
by the vatCode
.
SesExtension Fields¶
SesExtension Field | Type |
---|---|
LineType |
int |
CostType |
string |
StockNumeric |
int |
OnStock |
bool |
VatCode |
string |
VatPercent |
float |
PriceIsIncVat |
bool |
LineType¶
The tag LineType
controls whether the returned orderLine
is a product or a cost.
LineType | Description |
---|---|
1 | cost |
2 | product |
CostType¶
The tag CostType
indicates which kind of cost is returned.
CostType | Description |
---|---|
shipping |
indicates shipping costs |
charge |
indicates other (not shipping) costs |
discount |
indicates discounts |
StockNumeric¶
The tag StockNumeric
indicates how many items are in stock.
OnStock¶
The tag OnStock
indicates if the item is available in stock.
VatCode¶
The tag VatCode
indicates the code for VAT rate, e.g. 'download' or 'food'.
VatPercent¶
The tag VatPercent
indicates the VAT in %.
PriceIsIncVat¶
The tag PriceIsIncVat
indicates, if the returned price includes VAT or not.
Note
Either VatCode
or VatPercent
must be returned from ERP.
Example OrderLine
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
|