Use API to get samba total bill and discount amount to 3rd party app

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

Thanks

Yes, SambaPOS does have an API and this has already been done for GloriaFood.

Have a look at this discussion, it will guide you in the right direction
https://forum.sambapos.com/t/gloriafood-integrations/14388/16

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

would this be possible with samba API?

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 are going to build all of that. Then why would you need a third party app?

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.

what I mean by the 3rd party app is the app that we plan to build :grinning:

would samba API support that function?

can it query before closing ticket stage?
since closing the ticket will send orders to kitchen printer.

however, we want to allow customer to see the total bill (after promotion discount) and make changes to order before click “confirm order”

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.

is “before ticket closing” event available in Samba API?

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?

IT would help if you described what the third party app is and what it does.

1 Like

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

Do you plan to sell this app to sambapos customers?

No plans for that
It is for our own internal use

Any guidance would be greatly appreciated
Thank you

Here you can study Sambapos api:
https://forum.sambapos.com/t/integrators-graphql-api-guide/14047/7?u=francisco_lopez

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.