404 when converting lite server id

pauldpauld Member Posts: 3

I'm getting a 404 from the /PosServer/rest/liteserverConversion/receipt/{receiptId} API call. If I try the same call again a bit later it works.

I understand from the docs that it "periodically syncs to the cloud", can you explain how that works, exactly what "periodically" means, and what I need to do to reliably convert the liteserver receipt ID?

Thanks.

4 comments

  • pauldpauld Member Posts: 3

    Hi, can someone explain more precisely what "periodically" means? I need to know how soon I can attempt to convert the liteserver receipt ID, or what steps I need to take to do it reliably.

    Thanks.

  • Adrian SamuelAdrian Samuel Moderator, Lightspeed Staff Posts: 556 moderator

    Hey @pauld,

    The liteserver's purpose is to enable you to have a local network of devices that can still function in operation (i.e. take sales and payments) even when your internet is down. It does this by first sending the data to the Liteserver, and then it will sync in real time to the cloud.

    In the event that internet goes down, the liteserver will enable the network to be sustained and will batch the data to be synced.


    The period in between the loss of internet will be the time-frame in which you won't be able to get a cloud receiptId because the data hasn't been synced yet, that's why you're getting a 404, as the data hasn't reached the cloud servers yet.

    To get around this, you might want to either simply batch those liteserver receiptID conversions to a slower schedule, do periodic retries for failures and or have some kind of internet network analyser that will tell you the health of the internet and have the conversions be done only when the internet is connected.

    I hope this helps!

    Adrian Samuel

    API Integrations Consultant - Strategic Solutions

    Lightspeed HQ

  • Adrian SamuelAdrian Samuel Moderator, Lightspeed Staff Posts: 556 moderator

    Hey @pauld I can confirm that this is the case :)

    Adrian Samuel

    API Integrations Consultant - Strategic Solutions

    Lightspeed HQ

Sign In or Register to comment.