/node-foodics

Simple NodeJS wrapper for Foodics API

Primary LanguageJavaScriptMIT LicenseMIT

NPM version

node-foodics

Simple Node.js wrapper for Foodics API.

Getting Started

Installation


npm install node-foodics

Setup

Basically require node-foodics and create a new instance with new NodeFoodics().

If you have all of your credentials, you can use new NodeFoodics(token, xbusiness, branchHid) initialization to access all functions.

If you already have your token, then you can create instance using new NodeFoodics(token) OR you can set token using foodics.setToken(token). Using this initialization you'll be able to use Get Allowed Businesses function. All other endpoints require X-Business.

After you have your X-Business, you can set it using foodics.setXBusiness(xbusiness).

Example


const NodeFoodics = require("node-foodics");
..
const foodics = new NodeFoodics(token, xbusiness, branchHid);
// OR
const foodics = new NodeFoodics();
foodics.setToken(token);
const businesses = await foodics.allowedbusinesses.list();
foodics.setXBusiness(businesses[0].hid);

Filtering

You can find more information about allowed filters in detail pages. For LIST functions, you can pass a filter object for filtering.

Example

const businesses = await foodics.categories.list({
  sku: "SKU_01"
});

Available Functions

Endpoint Function Usage Detail
Authentication authentication(secret) Detail
Allowed Businesses LIST allowedbusinesses.list() Detail
Branches LIST branches.list(filter) Detail
Branches GET branches.get(hid) Detail
Branches UPDATE branches.update(hid, payload) Detail
Categories LIST categories.list(filter) Detail
Categories GET categories.get(hid) Detail
Categories UPDATE categories.update(hid, payload) Detail
Categories CREATE categories.create(payload) Detail
Categories DELETE categories.delete(hid) Detail
Cities LIST cities.list(filter) Detail
Combos CREATE combos.create(payload) Detail
Countries LIST countries.list(filter) Detail
Customers LIST customers.list(filter) Detail
Customers GET customers.get(hid) Detail
Customers UPDATE customers.update(hid, payload) Detail
Customers CREATE customers.create(payload) Detail
CustomerAddresses LIST customeraddresses.list(filter) Detail
CustomerAddresses GET customeraddresses.get(hid) Detail
CustomerAddresses UPDATE customeraddresses.update(hid, payload) Detail
CustomerAddresses CREATE customeraddresses.create(payload) Detail
CustomerAddresses DELETE customeraddresses.delete(hid) Detail
DeliveryZones LIST deliveryzones.list(filter) Detail
DeliveryZones GET deliveryzones.get(hid) Detail
DeliveryZones UPDATE deliveryzones.update(hid, payload) Detail
DeliveryZones CREATE deliveryzones.create(payload) Detail
DeliveryZones DELETE deliveryzones.delete(hid) Detail
Devices LIST devices.list(filter) Detail
Devices GET devices.get(hid) Detail
Discounts LIST discounts.list(filter) Detail
Discounts GET discounts.get(hid) Detail
Discounts UPDATE discounts.update(hid, payload) Detail
Discounts CREATE discounts.create(payload) Detail
Discounts DELETE discounts.delete(hid) Detail
FloorLocations LIST floorlocations.list(filter) Detail
FloorLocations GET floorlocations.get(hid) Detail
FloorLocations UPDATE floorlocations.update(hid, payload) Detail
FloorLocations CREATE floorlocations.create(payload) Detail
FloorLocations DELETE floorlocations.delete(hid) Detail
FloorTables LIST floortables.list(filter) Detail
FloorTables GET floortables.get(hid) Detail
FloorTables UPDATE floortables.update(hid, payload) Detail
FloorTables CREATE floortables.create(payload) Detail
FloorTables DELETE floortables.delete(hid) Detail
InventoryItemTags LIST inventoryitemtags.list(filter) Detail
InventoryItemTags GET inventoryitemtags.get(hid) Detail
InventoryItemTags UPDATE inventoryitemtags.update(hid, payload) Detail
InventoryItemTags CREATE inventoryitemtags.create(payload) Detail
InventoryItemTags DELETE inventoryitemtags.delete(hid) Detail
InventoryItems LIST inventoryitems.list(filter) Detail
InventoryItems GET inventoryitems.get(hid) Detail
InventoryItems UPDATE inventoryitems.update(hid, payload) Detail
InventoryItems CREATE inventoryitems.create(payload) Detail
InventoryItems DELETE inventoryitems.delete(hid) Detail
InventoryLevels LIST inventorylevels.list(filter) Detail
InventorySnapshots LIST inventorysnapshots.list(filter) Detail
InventorySnapshots GET inventorysnapshots.get(hid) Detail
InventoryTransactions LIST inventorytransactions.list(filter) Detail
InventoryTransactions GET inventorytransactions.get(hid) Detail
InventoryTransactions CREATE inventorytransactions.create(payload) Detail
Modifiers LIST modifiers.list(filter) Detail
Modifiers GET modifiers.get(hid) Detail
Modifiers UPDATE modifiers.update(hid, payload) Detail
Modifiers CREATE modifiers.create(payload) Detail
Modifiers DELETE modifiers.delete(hid) Detail
OrderTags LIST ordertags.list(filter) Detail
Orders LIST orders.list(filter) Detail
Orders GET orders.get(hid) Detail
Orders CREATE orders.create(payload) Detail
Orders UPDATE orders.update(hid, payload) Detail
Orders CANCEL orders.cancel(hid) Detail
PaymentMethods LIST paymentmethods.list(filter) Detail
PaymentMethods GET paymentmethods.get(hid) Detail
PaymentMethods CREATE paymentmethods.create(payload) Detail
PaymentMethods UPDATE paymentmethods.update(hid, payload) Detail
ProductTags LIST producttags.list(filter) Detail
ProductTags GET producttags.get(hid) Detail
ProductTags CREATE producttags.create(payload) Detail
ProductTags UPDATE producttags.update(hid, payload) Detail
ProductTags DELETE producttags.delete(hid) Detail
Products LIST products.list(filter) Detail
Products GET products.get(hid) Detail
Products CREATE products.create(payload) Detail
Products UPDATE products.update(hid, payload) Detail
Products DELETE products.delete(hid) Detail
PurchaseOrders LIST purchaseorders.list(filter) Detail
PurchaseOrders GET purchaseorders.get(hid) Detail
PurchaseOrders CREATE purchaseorders.create(payload) Detail
CurrentBusiness LIST currentbusiness.list(filter) Detail
RestoreData LIST restoredata.list(filter) Detail
Shifts LIST shifts.list(filter) Detail
Suppliers LIST suppliers.list(filter) Detail
Suppliers GET suppliers.get(hid) Detail
Suppliers CREATE suppliers.create(payload) Detail
Suppliers UPDATE suppliers.update(hid, payload) Detail
Suppliers DELETE suppliers.delete(hid) Detail
Taxes LIST taxes.list(filter) Detail
Taxes GET taxes.get(hid) Detail
Taxes CREATE taxes.create(payload) Detail
Taxes UPDATE taxes.update(hid, payload) Detail
Taxes DELETE taxes.delete(hid) Detail
TimedEvents LIST timedevents.list(filter) Detail
TimedEvents GET timedevents.get(hid) Detail
TimedEvents CREATE timedevents.create(payload) Detail
TimedEvents UPDATE timedevents.update(hid, payload) Detail
TimedEvents DELETE timedevents.delete(hid) Detail
TillLogs LIST tilllogs.list(filter) Detail
TillOperations LIST tilloperations.list(filter) Detail
Users LIST users.list(filter) Detail
Users GET users.get(hid) Detail
Users CREATE users.create(payload) Detail
Users UPDATE users.update(hid, payload) Detail
Warehouses LIST warehouses.list(filter) Detail
Warehouses GET warehouses.get(hid) Detail

Contributing

If you want to contribute to a project and make it better, your help is very welcome.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.