Cir-Food reverse API implementation in NodeJS.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
README.md
example.js
index.js
package-lock.json
package.json

README.md

CIR-FOOD

Cir-Food reverse API implementation in NodeJS.

Configuration

All API are authenticated, so you must first of all configure your client.

const CirFood = require('cir-food');

const username = process.env.CIRFOOD_USERNAME;
const password = process.env.CIRFOOD_PASSWORD;
const client = new CirFood(username, password);

Start a booking

client.startBooking(new Date('2018-05-11');

Get courses

Once you start a booking, you can get all courses for that day.

const courses = client.booking.courses;

Add a course to current booking

Once you got courses, use that IDs to add a course to current booking

const course_id = courses.data[0].id;
client.addCourseToCurrentBooking(course_id)

Submit booking

client.submitCurrentBooking()