So our GloriaFood integration is based off of Emre’s API Integration Guide (I think the thread has been removed) and it’s been working perfectly fine for years.
However, as of yesterday, a few orders come out scrambled (the Product Names come out incorrectly).
So I thought maybe the error was on GloriaFood’s side. Maybe GloriaFood’s API endpoint gave incorrect data when polled, but that didn’t seem to be the case. The returned JSON from their endpoint was fine and the resulting GQL query from the code was fine as well.
mutation m{addTicket(
ticket:{type:"Delivery Ticket",
department:"Delivery",
user:"Administrator",
terminal:"Server",
note:"",
entities:[{entityType:"Customers",name:"EDITED OUT"}],
states:[
{stateName:"Status",state:"New Orders"},
{stateName:"Source",state:"GloriaFood Delivery Prepaid"},
{stateName:"Payment",state:"ONLINE"},
{stateName:"Delivery",state:"Waiting"},
{stateName:"OnlineType",state:"delivery"}
],
tags:[
{tagName:"Delivery Minutes",tag:"60"},
{tagName:"Paid",tag:"GloriaFood Paid"},
{tagName:"Delivery Tip",tag:"1.47"},
{tagName:"GH Name",tag:"EDITED OUT"},
{tagName:"DeliveryAddress",tag:"EDITED OUT"}
],
calculations:[],
orders:[{
name:"Hot Coffee",
menuItemName:"",
quantity:1,
portion:"Large",
price:3.05,
tags:[{tagName:"Coffee Milk",tag:"Whole Milk",price:0,quantity:1},{tagName:"Sweetener",tag:"Sugar",price:0,quantity:1},{tagName:"Comment",tag:"Instructions",note:"only 1 sugar. a lot of milk"}],
states:[
{stateName:"Status",state:"New"}
]
},{
name:"Western Omelet",
menuItemName:"",
quantity:1,
portion:"Platter",
price:10.45,
tags:[{tagName:"Select a Toast",tag:"White Toast",price:0,quantity:1},{tagName:"Comment",tag:"Instructions",note:"French fries instead of home fries"}],
states:[
{stateName:"Status",state:"New"},{stateName:"KDOrderStatus",state:"KDFNewDelivery"}
]
}]
}){id}}
As you can see, this query should input an order with a Hot Coffee and a Western Omelet.
But this is the resulting order:

Any ideas on what might be happening?
Thanks for taking the time to read all of this.
EDIT: this doesn’t happen with every order. Happens like once or twice a day. All of the other orders come out just fine.