Item query with like wildcard description

jbrownjbrown Member Posts: 10

Hi,

i'm trying to put together a query for items with a similar description and i'm trying to use the ~ and % wildcards in the query string parameter but i'm not getting anywhere.

If I query on direct match:

{{base_url}}{{account_number}}/Item.json?description=shipping

the returned results are perfect and I get the item i expect, but if I try:

{{base_url}}{{account_number}}/Item.json?description=~%shipping%

I get 0 results and if I try url encoding the wildcard %, again 0.

{{base_url}}{{account_number}}/Item.json?description=~%25shipping%25


Can someone please clue me in to what i'm doing wrong here ?

Thanks!

3 comments

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

    Hey @jbrown,

    Great question!

    To get the wildcard to work, try adding a comma after the wildcard symbol like this:

    {{base_url}}{{account_number}}/Item.json?description=~,%shipping%

    Hope this helps!

    Adrian Samuel

    API Integrations Consultant - Strategic Solutions

    Lightspeed HQ

  • jbrownjbrown Member Posts: 10

    thats it! and it is mentionned too.. if i read close enough.


    Thanks!

  • jbrownjbrown Member Posts: 10

    Hi @Adrian Samuel ,


    Maybe you can help me again with a very similar issue.

    From the previous discussion i've ended up with the followin query which gives me exactly what i'm looking for, a listing of items matching "shipping" or "livraison":

    {{base_url}}{{account_number}}/Item.json?or=description%3D~,%shipping%|description%3D~,%livraison%


    Now i need to do exactly the same thing but for a new "Deposit" item that i've already added to my lightspeed account. The description is literally: "Deposit"

    I've copied the previous shipping query and replaced the desription as follows:


    {{base_url}}{{account_number}}/Item.json?or=description%3D~,%deposit%|description%3D~,%depot%


    But rather than getting just the 1 Deposit item, it returns all items from lightspeed.


    Any ideas ?

Sign In or Register to comment.