Does samba have API function to throw final bill and discount amount to 3rd party app?
Example use case:
customer order through 3rd party app and send item name x quantity to samba
samba engine calculates using ongoing promotional rules and throw the total bill amount and also discount amount back to 3rd party app. This way, 3rd party app does not need to have a promo engine since samba is doing the calculations and throwing back the data to the 3rd party app
From an initial quick study of the gloriafood intergration, it seems that it is using gloriafood promo engine and pushing that promotion data to samba.
I am hoping that the 3rd party app only sends item name x quantity to samba, and samba engine does the promo calculation before sending it back to 3rd party app to display the bill to customer
You can fetch the data and then use built in calculation features to assign promos, though if the 3rd party app is not calculating this for you, it will be a lot of hands on management of this integration.
If you’re going to build an integration of your own, I would query the ticket after closing to get the details you need and the send that back to the service you’re using.
Theoretically (never tried using it for this purpose), you could use an Event called “Before Ticket Closing” to execute your script to fetch whatever you want and do whatever it needs to do.
But isn’t that a hook, dont think there will be a way to exit closing flow once initiated.
If your using api is can interact like a terminal and build the ticket, its hard to see clearly the data flow of your planned use, have you got any kind of data flow diagram intended?
3rd party app is our own development
Objective is to allow seamless flow for user to scan QR code to make order from their own mobile phone, custom UI from wordpress, confirmed orders get sent to samba terminal for outlet operations, payment integration to local payment gateway
We are not familiar with sambapos API, specifically how to utilize samba engine to calculate the promotion discount and throw that data back to the app
Below is example of 2 basic use case.
Thank you
Case: When new customer at table scan QR code and reach checkout page, but not yet made payment. This is so customer can check price and change item ordered before confirming order:
addTicket
addOrderToTicket
→ how to throw the final ticket price including discount, service, tax calculation back to app?
clearTerminalTicketOrders
closeTerminalTicket
Case: customer add order to open ticket and confirm order
getTicket
addOrderToTicket
→ how to throw new ticket total price to app?
payTerminalTicket
closeTerminalTicket
Samba api is not build for The flow you want, It wouldn’t be efficient since you need a lot of mutations/query every time that a product is added to the cart, the best that you can do is to fetch the menu, save it and find a way to share the discounts with your app to show the correct total in the app.