WebshopappApiException: Invalid API language Error

mattangermattanger Member Posts: 34 ✭
Hi, I'm working on a small integration that depends on the Ecom API. It is not an app that would be published in the Ecom app store.

I've attempted to make some basic GET requests to different endpoints just to test some things out, and I receive the error that is the title of this post each time. The first way I tried was with a well know HTTP library called Guzzlehttp, and the second way was with the PHP client offered by Lightspeed: https://github.com/SEOshop/API-PHP-Client.

I've followed the documentation as close as I possibly can, and from all the examples I have seen the language short code is "en" (this is code I've been trying to use). In the documentation, all of the examples use the EU cluster URL. The store I'm working with is a US site and uses the US cluster URL. (I'm using the cluster_id "us1", as specified on the Github page)

I would like to know if there is something different for the US accounts, or if there is some setting my client needs to address that would resolve this issue?


  • jamesratcliffejamesratcliffe Administrator, Lightspeed Staff Posts: 160 moderator
    Hi Mark,

    The code for US English is 'us'; British English is 'en'. Most shops on the 'us1' cluster will be using 'us', but there are exceptions.

    If you have a registered app in the eCom app store, the main shop language is sent to you when the shop installs your app. If you're just using an API key for the shop, you'll need to ask which language the shop is using (or try a few until you get it).

    You can use the languages endpoint to see the list of active languages on a shop, but you need to know at least one of the active languages to be able to make that request.
    James Ratcliffe
    Lightspeed HQ
  • mattangermattanger Member Posts: 34 ✭
    I posted this before I had access to the admin side of the Ecom site. I now have that, and I've figured out the answer to my question.

    I would like to add that the documentation regarding the language codes is quite confusing to me. All examples use the "en" language code and the EU cluster URL. But, for the US the language code is "us". I'm unable to find anything in the documentation that indicates that there would be a difference given that English is the main language spoken in the US.
  • jamesratcliffejamesratcliffe Administrator, Lightspeed Staff Posts: 160 moderator
    Yes, the documentation should be clearer about this. We're working on improving it.
    James Ratcliffe
    Lightspeed HQ
Sign In or Register to comment.