Online ordering -> receipts/order printing

sdbkwiliasdbkwilia Member Posts: 18
edited February 20 in Development

Dear,

 

We are building an API link for our mutual client so that products can be sold online via the website.

 

We have a test environment, and some regular contact with account managers of Lightspeed. However, they could not answer the questions we still have. That's why we need your help.

 

Here is also some background / context.

 

Our client has 17 locations where your POS systems are already in use. At any given location there is often a cash register system in the store, one in the restaurant, one in the snack bar, etc.

We use Lightspeed Restaurant. So this API is relevant: https://developers.lightspeedhq.com/resto-api/introduction/gettingstarted/

 

So; for each location there will be an online endpoint that we communicate with (with the respective oauth client identifier). However, what is still unclear to us is how we indicate for which POS system (& receipt printer so it seems to me?) the order is.

This should of course end up in the right place so that the kitchen can start preparing (in this case) the sandwiches.


Looking at the ordering API we can't see anything that would take care of this? Are we misinterpreting the functionality? Could you help us out a little here?


Then a second question that we have asked the account manager(s) several times but have not received a clear answer to.

May we assume that:

  • Each location has its own online database (we known this for a fact)
  • All these locations have the same endpoint, but identification is handled through the clientid/consumer key. IE. the correct id will ensure the orders are routed to the right POSes (as mentioned in the documentation).


 

Many thanks in advance.

 

Kind regards,

SDB

Post edited by Katherine_Welford on
<1

Answers

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 734 moderator

    Hi @sdbkwilia,

    Thank you for contacting us.


    • Each location has its own online database (we known this for a fact) This is correct.
    • All these locations have the same endpoint, but identification is handled through the clientid/consumer key. IE. the correct id will ensure the orders are routed to the right POSes (as mentioned in the documentation). Every location/account has its own companyID and token.

    I hope this helps.

  • sdbkwiliasdbkwilia Member Posts: 18

    Hi @LucienVersendaal ,


    Thank you for your reply.

    Could you please help us out with the following (copy/paste from the original question):


    "So; for each location there will be an online endpoint that we communicate with (with the respective oauth client identifier). However, what is still unclear to us is how we indicate for which POS system (& receipt printer so it seems to me?) the order is.

    This should of course end up in the right place so that the kitchen can start preparing (in this case) the sandwiches.


    Looking at the ordering API we can't see anything that would take care of this? Are we misinterpreting the functionality? Could you help us out a little here?"


    Essentially we want to know: how do we go from a given online order to 'this will be rolling out of a printer in the kitchen as an order for sandwhiches' for instance.


    Thanks in advance.

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 734 moderator

    Hi @sdbkwilia,

    This is done by our FSS team, this is something that needs to be setup in the account. In a nutshell, they(FSS team) are creating printer templates, this templates are connected to the correct printers. After that the products or categories are connected to the correct printer template. So when creating an online order with different products e.g. coke and a burger. The coke is going to the bar printer and the burger is going to the kitchen.

    I hope this helps.

  • sdbkwiliasdbkwilia Member Posts: 18

    Hi @LucienVersendaal ,


    Thanks for your answer. This was the 'missing link' for us and has cleared up some confusion here.

    It does however have some (possible) implications for our setup however.


    To ensure the offered products and pricing is in line across all locations we intend to have a central Lightspeed environment where all products are set up. From there they will be copied to the specific locations.

    Question 1) How will this work with printer templates. Can they be setup centrally and copied to different environments, or will they need to be created 'locally' on each location. I am guessing the latter, because as I understand it, a 'printer template' will also refer to a specific printer and as such probably can't be created centrally?


    Question 2) How does this work (in general) w.r.t. products and categories. Let's say we have a coca cola for sale in both the cafetaria and the restaurant. Same product, same price. How will a printer template know where to send (that part of) the order?


    Thanks again.

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 734 moderator

    Hi @sdbkwilia,

    Okay perfect.

    Question 1) All printer templates are setup 'locally' per location, there is NO centralization for templates. Good to know is that our FSS team already set everything up(printing templates) in the account.

    Question 2) The template is attached to a floor(e.g. snackbar) so when sending the cola from that floor(based on floorID), the attached printer template will print the cola to the snackbar printer.

    I hope this helps.

  • sdbkwiliasdbkwilia Member Posts: 18

    Hi @LucienVersendaal ,

    1) Ok that's good to hear. Although I'm not sure the printer templates are fully set up. As far as I know the definitive configuration (what to offer, on which location it gets offered, etc.) isn't known yet. And so the printer templates cannot be finished yet. Alas, we'll check.

    2) This leaves some questions still. I understand the set up of a template and its connection to a floor. However.. when we send an (online) order, you don't provide a floor.

    This is the API call we're looking at:


    I suppose this could work via the tableID? So what would be the recommended set up for an online ordering system in this case? Do we 'hardcode' the tableID which is tied to a floorID and exert control over 'where the order goes' that way?

    Thanks again.

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 734 moderator

    Hi @sdbkwilia,

    1. You'll have to check that with Molecaten, yesterday I talked with the FSS guys and they told me everything was set up.
    2. First you'll need to get the floors by hitting the /core/floors endpoint then you'll need to grab the unique ID of the table and use that ID in your payload when sending the online order.
    3. When posting this Online order the type will be restaurant and the tableId is the unique ID that you found in the endpoint above.
  • sdbkwiliasdbkwilia Member Posts: 18

    Hi @LucienVersendaal ,

    1. I have done. They're looking into it.
    2. This makes sense, sort of. When we're online ordering, we're not -actually- ordering for a table. So querying /core/floors for each order seems abundant. It's just a dummy floor / table for our use. I assume we can just re-use the same tableid for each online order repeatedly, right?
    3. Alright thanks.

    Kind regards.

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 734 moderator

    Hi @sdbkwilia,

    1. Okay perfect
    2. I didn't say that you need to query the /core/floors everytime you send an online-order. It is just to get the tableID, because these tableIDs are fixed and don't change(unless they're removed and added again). Yes you can re-use the same tableIds.


  • sdbkwiliasdbkwilia Member Posts: 18

    Hi @LucienVersendaal ,

    W.r.t. reusing the tableid/floorid: Ok that's good to hear, thanks.


    We are currently going through setting up an order, and are running into the following.

    When trying to create an order we provide an id for a table. In this case we're using a newly set up table of type 'Takeaway'. However when trying to create an order for this table, we are met with the following error:

    {"description":"Illegal argument: Cannot create a Takeaway order on a takeaway table"}

    Could you let us know what we're doing wrong here?


    Thanks again.

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 734 moderator

    @sdbkwilia,

    Can you provide me your payload?

  • sdbkwiliasdbkwilia Member Posts: 18

    Hi @LucienVersendaal ,


    Yes I can. Please find attached.

    Text file contains:

    • URL to where we post.
    • Body (json) content of order creation
    • Response body (json)
  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 734 moderator

    @sdbkwilia,

    Sorry I forgot to ask which account you're testing in? Do you have a companyID?

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 734 moderator

    I see what is going wrond please check:

    "type":"Takeaway"

    Takeaway must be all small caps. This is also documented.


  • sdbkwiliasdbkwilia Member Posts: 18

    @LucienVersendaal ,

    Where might I find the companyID?

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 734 moderator

    @sdbkwilia,

    You can find the companyID using the company endpoint.

    But check my last post.

  • sdbkwiliasdbkwilia Member Posts: 18

    Hi @LucienVersendaal ,


    Ok great - that helped (lowercase).

    On to the next error.


    {"description":"Illegal argument: Order payment paymentTypeId '4' does not exist"}


    According to the documentation that default list is supported (incl. ID 4) but I understand the actual configuration may differ. So I looked at the set up and see a bunch of payment methods, but the web interface does not show ID's.

    And the API doesn't list the paymenttypes as an endpoint you can get information from, only create a new one.


    So.. the question becomes:

    • What do I provide as paymentTypeID
    • And also: what do I provide as paymentTypeTypeId

    In our case I would like to add a payment type 'Online Payment' and add a PaymentType-Type 'Ingenico' (rather than Adyen, as we're not using Adyen).

    • Can I add PaymentType-Types?
    • And again, where do I get the right IDs from?


    Thanks a lot.

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 734 moderator

    Hi @sdbkwilia,

    Please do a little digging in our documentation, all this information you're looking for is in there.

    About the error message is saying, the paymentTypeId doesn't exists, so you'll have to create one or use one of the available https://developers.lightspeedhq.com/resto-api/endpoints/onlineordering/#get-available-payment-types

    You can create one here: https://developers.lightspeedhq.com/resto-api/endpoints/corepaymenttype/

    I hope this helps.

  • sdbkwiliasdbkwilia Member Posts: 18

    Hi @LucienVersendaal ,


    Thanks. I'll ignore the snarky comment.

    So: I want to create a payment type, e.g. 'Online payment' using the core/paymenttype endpoint. I have to provide a 'type' there. For this I would like to use our own type, e.g. 'Ingenico'. So this would be a PaymentType-Type.

    I can see the type-types in the web interface:


    But I can't find their ID's, let alone info on how to create our own. I'm sure it's in the documentation but after a little digging, I can't find it.

    Thanks again.

  • sdbkwiliasdbkwilia Member Posts: 18

    Hi @LucienVersendaal ,

    Having retrieved the PaymentTypes I've now used some values from that list to enter a order in the system. This worked at last.

    Some observations so far:

    1. I provide both a note and a description when creating the order. When retrieving the order using /rest/onlineordering/order/{orderId} I notice 'description' is not there in the response. Is this known behavior, or should I be looking elsewhere?
    2. When creating the order, the documentation states we get the full order details returned as response. We don't get this. Instead, we get the ID of the freshly created order (e.g. 12345). Is this known behavior, or should we be creating an order with a flag/switch that indicates the full order will be returned on creation?
    3. Am I correct in assuming I can't look at orders in the web interface (the Lightspeed Restaurant dashboard)?


    Thanks once more.

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 734 moderator

    @sdbkwilia,

    After you've created the paymentType you can choose external from the list.

    This is how this payment looks in paymentType endpoint


  • sdbkwiliasdbkwilia Member Posts: 18

    Hi @LucienVersendaal ,


    Could you take a look at this comment:

    I think you might have missed it, as you answered another comment, but not that one yet.


    Thanks.

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 734 moderator
    edited March 2

    @sdbkwilia

    Sorry I must have missed that one.

    1. You can check the financial endpoint and do a call like this /rest/financial/receipt?receiptId=82417066
    2. To use the ID in the response after creating an online order, please use this: /rest/onlineordering/customer/{{customerId}}/order/{{order_id}}
    3. You can, look for the receiptId in the response above(2) go in the dashboard to Reports -> Receipts and search for the receipt.


  • sdbkwiliasdbkwilia Member Posts: 18

    Hi @LucienVersendaal ,


    Thanks for answering. I'm not sure I understand the workings just yet.

    • I create an order, and get returned an order ID (I presume). For instance 2149191 just now.
    • I can query for that order using the /rest/onlineordering/order/{id} here. That's working fine. I can see the order I have just created. Is there any reason I would use the /rest/onlineordering/customer/{customerid}/order/{orderid} endpoint over the one I just listed?


    I can't find this order in the Dashboard however. Also, it doesn't show up as a receipt. It's not listed in the customer I've created it for, e.g. here:


    Also, it's not there when I go to Reports -> Receipts -> Create an export.


    Couple of questions:

    1. Is an order the same thing as a receipt? I would imagine that it is not.
    2. This order I have created, is created using payment status 'WAITING FOR PAYMENT' as it's an online order that needs to be paid via our online payment provider and we will then (on success) flag it as paid. Does the payment status determine whether or not an order is/has a receipt?


    Thank you once again. I have a few more questions, I will post them in a separate post.

  • sdbkwiliasdbkwilia Member Posts: 18

    Hi @LucienVersendaal ,

    As mentioned in my previous post, I also had another question. This is separate from the previous order questions.


    There are two custom bits of text we would like to display on the receipt that gets printed (and probably attached to the bag that customers come and takeaway).

    1. Timeslot information (e.g. `8:00 - 8:30`) and;
    2. Custom order ID in customer friendly format (e.g. `LK0503-100`) for easy takeaway.


    On the receipt definition, is there some way to include custom text? Perhaps we could include the contents of the 'Notes' or 'Description' fields somewhere? That way, when creating the order, we can simply provide this information in either of those fields, and it should be there when it's printed.


    Looking forward to your thoughts on this. Thanks!

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 734 moderator

    @sdbkwilia,

    Answering on the first of two posts.

    • I can query for that order using the /rest/onlineordering/order/{id} here. That's working fine. I can see the order I have just created. Is there any reason I would use the /rest/onlineordering/customer/{customerid}/order/{orderid} endpoint over the one I just listed? You can search more specific to use the customerID.

    You can't find it in the resto manager because it's not finished, it is WAITING_FOR_PAYMENT

    Only completed orders are visible.

    Couple of questions:

    1. Is an order the same thing as a receipt? I would imagine that it is not. No they're not the same. A receipt is a completed order. You can't update receipts. But you can update orders more info here.
    2. This order I have created, is created using payment status 'WAITING FOR PAYMENT' as it's an online order that needs to be paid via our online payment provider and we will then (on success) flag it as paid. Does the payment status determine whether or not an order is/has a receipt? Yes it needs to be paid to become a receipt and visible in the reports.


  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 734 moderator

    @sdbkwilia ,

    I've created a small example of how it looks like using "note". Unfortunately we can't change or remove:


    API:

    Kitchen:

    Receipt:


    I hope this helps.

  • sdbkwiliasdbkwilia Member Posts: 18

    Hi @LucienVersendaal ,

    With regards to your first answer (https://community.lightspeedhq.com/en/discussion/comment/17359/#Comment_17359) - great, that answers my questions there. I'll create an order and submit an update that changes it to paid to check out the receipts.


    With regards to the second answer (https://community.lightspeedhq.com/en/discussion/comment/17360/#Comment_17360) - Oh that looks good!


    Looking at the orders JSON I would guess the '18:00' is the time component from the 'deliverydate' that is present on the order. Is that correct?

    So presumably if I create that with e.g. 18:15 it will display 'OPHAALTIJD 18.15' ?

    If so, that's great. Then we can probably just use the 'creationdate' for that part of the receipt. And then we'll only have to use 'note' for our custom order id for instance.


    Could you confirm if this works as I presume?

    Thanks once more, and have a good weekend.

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 734 moderator

    @sdbkwilia

    Looking at the orders JSON I would guess the '18:00' is the time component from the 'deliverydate' that is present on the order. Is that correct? Yes that is correct.

    So presumably if I create that with e.g. 18:15 it will display 'OPHAALTIJD 18.15' ? Correct

    It is easy to play around with it if you have an iPad, so you can see how these receipts look like. For that I recommend calling our support to help you with that.


    Marked in red square is the creation date, you can't move this unfortunately.

    I hope this helps.

  • sdbkwiliasdbkwilia Member Posts: 18

    Hi @LucienVersendaal ,

    We are currently trying to figure out how the multiple environments will work.

    For testing we have a set of credentials

    1. We use the provided staging account (email address), and the provided consumerkey/secret to connect to the staging environment.
    2. We have asked for an account/information to be able to connect to all the other locations. One of your colleagues (Field Support) has created a new account (email); [email protected] Supposedly this account has rights to all locations.

    It feels like we are missing something.. either different URLs for all locations, or different consumerkey/secret credential sets for all locations.

    If not.. how does this work? Right now I don't think we're 'identifying' the location we want to communicate with via API in any way.

    I would assume we would need a separate set of (OAuth) credentials for all of these?


    Could you help us out a little here?

    Thanks again in advance.


    Kind regards

Sign In or Register to comment.