foodbot-cart-calculations
v1.0.17
Published
Package for cart calculations in which it performs discount distribution and tax distribution on order
Downloads
248
Readme
foodbot-cart-calculations
foodbot-cart-calculations package for cart calculations in which it performs discount distribution or loyalty points distibution and tax calculations distribution on order items. There are some required keys which will be used for distibute discount , loyalty points and calculate tax. This package will return promise so we have to wait for this , so we have to use await for this.
Installation
npm install foodbot-cart-calculations
Usage
const cartPackage = require('foodbot-cart-calculations');
let json = {
restaurant_id: 'xxxx',
branch_id: 'xxxx',
tax_type: 2,
/*
.
.
.
.
*/
};
// Request Example
let finalJson= await cartPackage.calculateTax(json);
// Response Example
console.log("final json " , finaJson);
{
"status":"success",
"status_code":"200",
"message":"Tax calculated successfully",
"data":/* json*/
}