API suggestion-

mutation closeTerminalTicket returns ticketID

mutation addOrder accepts portionID in place of portion name

I didnt understand what you mean or what you want ?

@memo please help us understand the request better by showing us a use case scenario in how you would use these features.

My apologies, gentlemen; let me elaborate:

Current functionality:

mutation closeTicket{closeTerminalTicket(
  terminalId:"TERMINALID")}

returns

{
  "data": {
    "closeTerminalTicket": null
  },
  "errors": null
}

suggested functionality (add {id} sub-selection):

mutation closeTicket{closeTerminalTicket(
  terminalId:"TERMINALID"){id}}

would then return:

{
  "data": {
    "closeTerminalTicket": {
       "id": 1234
    }
  },
  "errors": null
}

where ‘1234’ is the TicketId (either current or the one generated when a new ticket is closed and written to the database).

Right now I have the following methods in C#:

public static void CloseTicket()
public static int TicketID()

One to close the ticket and the other to query the DB and select TicketId.
With the API change CloseTicket() could return the ticketId taken from the mutation response:

public static int CloseTicket()


With addOrderToTerminalTicket we have the ability to pass the menu item ID as such:

mutation addOrder{addOrderToTerminalTicket(
terminalId:“TERMINALID”,
productId:1234,
quantity:1,
price:195,
enforceQuantity:true,
portion:“Normal”)
{orders{uid}}}

suggested functionality: have the ability to specify the portion as portionId (portionID in place of portion name):

mutation addOrder{addOrderToTerminalTicket(
  terminalId:"TERMINALID",
  productId:1234,
  quantity:1,
  price:195,
  enforceQuantity:true,
  portionId:5678)
  {orders{uid}}}

The above would help as I’ve run into a problem with adding an order to a terminal ticket when the portion name contains a quotation mark (inches mark - ASCII 34) (Like Pizza.12" or Sub.6"). Currently I work around this by using two single quotes: '' instead of ".

mutation addOrder{addOrderToTerminalTicket(
  terminalId:"TERMINALID",
  productId:1234,
  quantity:1,
  price:195,
  enforceQuantity:true,
  portionId:"12\"")
  {orders{uid}}}

the above does not create an order with the portion 12", rather it defaults to the first listed portion in the product definition. I’ve tried to escape it to no avail.

Being able to pass the portionId in place of portion name would allow me the use of quotes in the portion name.

What are you building?

I’m building a program to process online orders. Right now I have GloriaFood about 99% finished, I just have to make sure combos are working properly.

After than, I would like to build integrations for the two gruhub/ubereats-type services available on the island.

I’d be very interested in the grubhub integration.

The ones I was referring to are like grubhub, but not grubhub. One is only on the island, the other is in Central America.

From what I understand, grubhub doesn’t have a public API. You’d have to contact them to see what it takes to integrate. Other than that, you’d have to have a something scrape your emails, extract the information, and then load it into SambaPOS. Not impossible, but it would be a lot of work, I think.

Grubhub does not allow their api to be used openly. They do allow POS companies to integrate though and I have requested information about this. If we decide to build an integration for the USA I will let you know.

@memo I am curious but does the official Gloriafood Integration not solve your need?

Honestly, it started as a “can I do this” project and something to keep me busy. There are some things I’ve done that are more tailored to individual requirements/use case scenarios. By and large, I don’t find the features of the official app lacking.

I am not sure if you are aware but the Terminal Ticket mutations do trigger several of the rules in SambaPOS. You could use automation there to get ticket #. I am not sure exactly what you are trying to do though.

I know the overall goal you have but you have not shown us what you are doing. Why the need for Ticket #?

I know that automation commands fire when using the API. I didn’t know they could return a value through the API. This is new to me. How would I go about testing such functionality?

When the ticket is closed, the order information is written to table for future reference, with TicketID being the Primary Key.

2020-07-04_13;52_1593892332_Ssms

As it stands, I have a method that queries the database and selects the record with the matching the TicketUID and returns the TickedID and then passes that off to the another method to insert the record into a database.

It’s not a big deal, just thinking about reducing steps to achieve the same outcome.

It helps if you tell us what you are doing. Why do you need to query ticket id?

It’s merely for record keeping - tying order details with the ticket created.

So your inserting it into accounting software?

You can execute a script on Ticket Closed event and grab ticket ID. But its hard to offer good suggestions when we dont know what you are building.

That’s on the to-do list down the road, but as it stands right now, no.

Having the TicketID could be used to directly execute an automation command via the API within the application (e.g. broadcast a message containing the TicketID).

This can be returned though an API call?

I’ll try and put something together outlining the flow when I get back. The hound wants to go swimming.

You can just broadcast a message through automation… No need to script that. Im not understanding what you need it for.

You can execute some GQL inside SambaPOS rule events. But again I am not sure if that is what you want to do as I have no idea what you are building.