Basket (Warenkorb) - Specification in ENG
The basket is the interface for handling orders.
Two functions: → action
Calculate without triggering the order → calculate
Trigger order with calculations → order
the order is written to the VinX table Online Order, which allows the orders to be transferred to VinX.
Data schema
Addresses
The assignment of an order to an address is done either directly by specifying the corresponding ID (address table) or as subobjects of online addresses.
orderingAddressID / orderingOnlineAddress = Order address (at least this address must be given)
billingAddressID / billingOnlineAddress = invoicing-adress
deliveryAddressID / deliveryOnlineAddress = delivery-adress
If no direct reference to the address table is given to the shopping basket, an attempt is made to find and assign a unique address using the loginName (online address). This applies to ordering, billing and delivery addresses. If the assignment is made via this loginName, the online address must be given the changeType = nop. This means that this data record is not persisted. |
---|
Â
The address for the conditions (for calculations) is determined as follows:
Overriding the condition address with conditionAddressID
orderingAddressID
If orderingAddressID has not been overridden by conditionAddressID, the condition address can be overridden again (VinX internal) depending on the setting on the VinX address (orderingAddressID).
Invoice address stored on this address
stored condition address on this address
if no address is found (e.g. guest order) the condition address is fetched from the service provider.Â
Order items
The following values must be entered for each order item:
articleID: Article ID
orderedQuantity: Order quantity
Optionally, the price can be specified by the shop:
unitPrice (or unitPriceWithTax): Unit price excl. (or incl. VAT)
priceCalculationRule = « fromShop »
Dealing with promo codes, vouchers etc.
VinX does not currently support the management of promo codes, vouchers, one-off discounts etc.. The reason for this is the enormous variety of discount and promotion options that cannot be meaningfully mapped in a general interface.
In the shopping cart interface, however, these functionalities can be transferred to VinX if the shop can manage them. To do this, proceed as follows:
 The special conditions, promotions, vouchers etc. must be managed in the shop.
Depending on the requirements, at least one promo article must be created in VinX for the financial accounting, cost accounting or post-calculation. This must be known to the shop, analogous to the shipping costs.
If a discount is redeemed, the shop must proceed as follows:
The shopping cart must be transmitted in "calculate only" mode (flag "action" = "calculate").
Determine discounts, e.g. fixed price promo, e.g. 20.- from 100.- order value:
In the shopping basket, a new order item is to be added which
has the above promo item as the article
has the negative discount as the price, in the example here this would be -20.-.
in the price rule (field priceCalculationRule) must be "fromShop". This means that the shopping basket does not recalculate the price.
The shopping cart is transmitted normally
Â
Calculate shopping cart :
{
"action": "calculate",
"conditionAddressId": 1002,
"positions": [
{
"posNumber": "1",
"orderedQuantity": 12,
"articleId": 5000
}
]
}
Response Calculation
{
"action": "calculate",
"customerWithVat": true,
"conditionAddressId": 1002,
"orderingAddressId": 1002,
"deliveryConditionId": 0,
"amountPayed": 0.0,
"validDate": "2022-03-17T16:15:38.6155297+01:00",
"deliveryDateRequested": "2022-03-17T16:15:38.6155313+01:00",
"providerId": 6,
"positions": [
{
"stockQuantity": 0.0000,
"charges": [],
"discounts": [
{
"posType": "discount",
"articleId": 0,
"orderedQuantity": 0.0,
"billedQuantity": 1.0,
"description": "LSVA",
"priceCalculationRule": "override",
"unitPrice": 0.369000,
"unitPriceWithTax": 0.378225,
"applicableTaxRate": 2.5000,
"lineTotalAmount": 0.3690,
"lineCumulativeTotalAmount": 0.3690,
"taxBaseTotalAmount": 0.3690,
"taxTotalAmount": 0.0092,
"grandTotalAmount": 0.3782
}
],
"packages": [
{
"posType": "package",
"articleId": 50,
"orderedQuantity": 12.0,
"billedQuantity": 12.0,
"description": "Flaschen Fr. -.50",
"priceCalculationRule": "article",
"unitPrice": 0.500000,
"unitPriceWithTax": 0.500000,
"applicableTaxRate": 0.0,
"lineTotalAmount": 6.0000,
"lineCumulativeTotalAmount": 6.0000,
"taxBaseTotalAmount": 6.0000,
"taxTotalAmount": 0.0000,
"grandTotalAmount": 6.0000
},
{
"posType": "package",
"articleId": 5,
"orderedQuantity": 1.0,
"billedQuantity": 1.0,
"description": "Harasse",
"priceCalculationRule": "article",
"unitPrice": 5.000000,
"unitPriceWithTax": 5.000000,
"applicableTaxRate": 0.0,
"lineTotalAmount": 5.0000,
"lineCumulativeTotalAmount": 5.0000,
"taxBaseTotalAmount": 5.0000,
"taxTotalAmount": 0.0000,
"grandTotalAmount": 5.0000
}
],
"chargeTotalAmount": 0.0,
"discountTotalAmount": 0.3690,
"packagesTotalAmount": 11.0000,
"posType": "orderPos",
"posNumber": "1",
"articleId": 5000,
"orderedQuantity": 12.0,
"billedQuantity": 12.0,
"articleNumber": "5000",
"description": "Adelbodner Nature",
"priceCalculationRule": "priceGroup",
"unitPrice": 0.829268,
"unitPriceWithTax": 0.850000,
"applicableTaxRate": 2.5000,
"lineTotalAmount": 9.9512,
"lineCumulativeTotalAmount": 21.3000,
"taxBaseTotalAmount": 10.3000,
"taxTotalAmount": 0.3000,
"grandTotalAmount": 21.6000
}
],
"charges": [],
"discounts": [],
"packages": [],
"vatSummations": [
{
"applicableTaxRate": 2.5000,
"taxBaseTotalAmount": 10.3000,
"taxTotalAmount": 0.3000
},
{
"applicableTaxRate": 0.0,
"taxBaseTotalAmount": 11.0000,
"taxTotalAmount": 0.0000
}
],
"lineTotalAmount": 9.9512,
"lineCumulativeTotalAmount": 21.3000,
"chargeTotalAmount": 0.0,
"discountTotalAmount": 0.3690,
"packagesTotalAmount": 11.0000,
"taxBaseTotalAmount": 21.3000,
"taxTotalAmount": 0.3000,
"roundingAmount": 0.0000,
"grandTotalAmount": 21.6000
}
Â