Importing orders from Woocommerce as Entity using REST API

Massive long shot i know, but this is where we are;

Soft play centre uses Samba, 3 till system and has done for a long time. Since covid, its been very important sessions are booked online as they no longer offer walk ins (for the moment anyway). The owner currently has to print off sessions and give a piece of paper to the staff of that days booked sessions, however the sessions can be booked up to 10 minutes in advance so this isnt a viable option. The owner doesnt want to give staff access to the website.

The website uses Woocommerce that has a large REST API outpit (if thats the terminology) and my thoughts is for either Samba to pick up the orders, or the website pushes them to Samba.

When samba gets the order, it will create an Entity with the name of the customer, entity data will be the date, time and then an entity screen will show the orders for that day.

When the entity button is pressed, the option is to check them in and if confirmed samba will send the request back to that order and mark it as complete.

THis is going to be a large task i understand, but i dont think its too far fetched. On another website I have, Royal Mail picks up the orders, and when i buy the postage it marks them as complete so there must be something that can be done?

If not just forum help, im willing to even get a price from someone to help with this.

Any advice, help or comments would be appreciated.


I am currently reading through here to see if i can get any pointers

It’s definitely possible. I would imagine using Node and GQL if Woocomerce would push or maybe a SambaPOS trigger system with a script if trying to pull. I’m sure @JTRTech will have a good idea on this setup.

1 Like

I already got asked :rofl:
Got too much on at the minute.

1 Like

Thats too bad. Sometimes I wish we didn’t need to sleep. Whats your opinion on the design though?

Do you think it could be a simple setup with trigger system? Something like:

  1. Trigger executes every minute by admin user/terminal
  2. Run script call API
  3. If new exists add reservation

That’s how I did PMS, the advantage here is both ends can be developed meaning a push type setup could be done but I don’t have huge experiance with samba gql.
Middle ground would be a push ping from woocom to tell samba the new booking id and then samba gather the data via woo rest.

Not knowing how their booking system is configured it would be a matter of polling the WC API (if they have poll to get orders) or something to receive webhooks. THen either via GQL->Automation create the booking or if they’re using tickets for reservations use GQL to create the ticket.

I would be hesitant using something within SambaPOS to poll for orders because if someone closes the app at the end of shift there’s nothing to receive orders.

a node.js script or windows service would do the trick

I went the windows service route for simplicity (for me) and am in the process of migrating everything to use webhooks.

Na, just log last order ID to a system setting and check for new orders with higher ID.

My PMS system does tickets similarly but by time, it syncs and logs last cut of time of last successful sync, I built it in such a way rather than on ticket paid or similar to avoid delay on ticket closing while posted or if internet is down.
Server runs a sync event every 5 minutes. Built in variables for a delay time so say you could say sync 1hr behind closed time to alow say a period for reopening/correcting mistakes if we’re enabled.
The above covers pretty much all issues I’ve seen at hotel, PMS outage, Internet outage, samba closed on server.
The samba closed on server means that 5min sync triggers don’t run but there is a final eod push on wp close, as well as a 23.59 push since PMS reports are date rather than WP/shift based so that late drinks processed before midnight don’t get posted am time.
That’s for cash sales, room posts and account charges are posted on demand and has a verification message in samba showing account name and details before actually posting.

For the room info side it’s a bit different since it’s not orders or etc, it checks current in-house bookings and updates room entities in samba with in-house booking details.
It has a cheeky shortcut where it saves the in-house bookings response which 1st check is if different to last responce, could probably be more sofisticated with hash or something but just compairs raw response json data.

Mainly through previous experiance as familierality ID make samba pull the data.
I’d probably have the script structured as such that it is variable with subscripts to grab and process and update entities etc such that easy to say have it run a double check/update on a booking for changes etc on demand and on entity selection or something.
And would make having say a during the night sync to double check for updates etc, although imagine woocom will have a modification type data/request.

I’d keep wooc9m order id or whatever as a custom field rather than entity I’d or something ready for say future reopening for walk ins.
Depends how you would want to handle walkins, might need to look at a walking creating a booking or something in woocom if bookings and walkins go together

Walkins can be handles separately, we can just do them as and when they come in. The task in hand specifically would be to receive bookings. Bookings are created as an order, so every time a booking is made it comes through as an order with details.

I’ve just got back from work but I have a few hours tomorrow. I’ll research a bit more on the booking plugin, but I’m sure they’ll all work just the same.

If I can get this working, it can potentially be adapted for anything woocommerce.


Advantage you’ll have is don’t have to link woo products o samba products.