@bambulabs/node-simpra
v0.0.14
Published
Node.js wrapper for Simpra API
Readme
node-simpra
Simple Node.js wrapper for Simpra API.
Getting Started
Installation
npm install node-simpraSetup
Basically require node-simpra and create a new instance with new NodeSimpra().
If you have all of your credentials, you can use new NodeSimpra(token) initialization to access all functions.
If you already have your token, then you can create instance using new NodeSimpra(token) OR you can set token using simpra.setToken(token).
Example
const NodeSimpra = require("node-simpra");
..
const simpra = new NodeSimpra(token);
// OR
const simpra = new NodeSimpra();
simpra.setToken(token);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 menu_items = await simpra.menu_items.list({
page: 1,
per_page_50,
status: "active"
});Available Functions
| Endpoint | Function | Usage | Detail | | -------------------- | -------- | -------------------------------------------------------------- | ----------------------------------------------------------- | | Checks | LIST | checks.list() | https://developers.simpra.app/#checks | | Checks | GET | checks.get(id) | https://developers.simpra.app/#checks | | Checks | CREATE | checks.create() | https://developers.simpra.app/#checks-create | | Check Item | CREATE | check_item.create(check_id, payload) | https://developers.simpra.app/#checks-create-item | | Check Payment | CREATE | check_payment.create(check_id, payload) | https://developers.simpra.app/#checks-add-payment | | Check Item | CANCEL | check_item.cancel(check_id, check_item_id, payload) | https://developers.simpra.app/#checks-cancel-item | | Check Discount | CREATE | check_discount.create(check_id, payload) | https://developers.simpra.app/#checks-add-discount | | Check Discount | DELETE | check_discount.delete(check_id, check_discount_id) | https://developers.simpra.app/#checks-remove-discount | | Check Service Charge | CREATE | check_service_charge.create(check_id, payload) | https://developers.simpra.app/#checks-add-service-charge | | Check Service Charge | DELETE | check_service_charge.delete(check_id, check_service_charge_id) | https://developers.simpra.app/#checks-remove-service-charge | | Menu Items | LIST | menu_items.list() | https://developers.simpra.app/#menu-items | | Menu Item Groups | LIST | menu_item_groups.list() | https://developers.simpra.app/#get-menu-item-groups | | Condiments | LIST | condiments.list() | https://developers.simpra.app/#condiment-groups | | Condiment Groups | LIST | condiment_groups.list() | https://developers.simpra.app/#condiment-groups | | Sales Channels | LIST | sales_channels.list() | https://developers.simpra.app/#get-sales-channels | | Revenue Centers | LIST | revenue_centers.list() | https://developers.simpra.app/#revenue-centers | | Tables | LIST | tables.list() | https://developers.simpra.app/#tables | | Employees | LIST | employees.list() | https://developers.simpra.app/#employees | | Discounts | LIST | discounts.list() | https://developers.simpra.app/#discounts | | Service Charges | LIST | service_charges.list() | https://developers.simpra.app/#service-charges | | Taxes | LIST | taxes.list() | https://developers.simpra.app/#taxes | | Payment Types | LIST | payment_types.list() | https://developers.simpra.app/#payment-types | | Currencies | LIST | currencies.list() | https://developers.simpra.app/#currencies | | Customers | LIST | customers.list() | https://developers.simpra.app/#customers |
Contributing
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
