When you use API call to place a new order in the store, the order is made exactly as you specify it in JSON. But what to do if you need to calculate taxes, fees, discounts, and shipping costs?
This is what the call is for. It accepts a cart JSON object and responds with the order JSON object. The resulting object can be instantly used in the Create order call.
Pass cart details
Upon receiving a new request, Ecwid API checks the following cart details to calculate the order:
Product details: items array for ID, selected options, quantity, wholesale prices, combination ID, and other details of products.
Ecwid API doesn't validate product details. You must send product prices in the request, but they can not match the real products from your store.
Shipping details: shippingPerson/billingPerson objects for delivery address, shippingOption object for shipping costs.
Pass the correct shipping method name, ID, and type in the shippingOption object to get rate calculation.
Tax settings: items’ tax classes, customer’s ID and tax exemption.
Store tax settings are automatically added to the request and are used in calculations.
Discounts/surcharges: gift cards, discount coupons, promotions, and custom surcharges.
Ecwid API doesn't validate discount/surcharge details. You can send any discounts/surcharges in the request, even if they don't match the ones from your store.