Search the eCom API for brand by url, or product by sku

randycillekensrandycillekens Member Posts: 4

Hi,

I am using the WebshopappApiClient which is realy great.

I trief something like

$brand = $api->brands->get(null, ['url' => 'test123']);

I expect brand to be filled with the brand which had the url 'test123'. But in stead it is returning a whole set of all brands. (first page)

I have looked into the code of the WebshopappApiClient code which is calling a url which looks like

@api.webshopapp.com/nl/brands.json?url=test123


How do I search for specific attributes of brands, products, customers etc.

5 comments

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 975 moderator

    Hi @randycillekens,

    Thank you for contacting us.

    Unfortunately, this won't work for the product fields. The params you can fill in there is listed here:

    I hope this helps.

  • randycillekensrandycillekens Member Posts: 4

    So @LucienVersendaal , if I understand this correctly it is best for me to keep a shadow database with all the brands and their Lightspeed ID and all product Lightspeed ID's including the fields I would like to search on?

    So when creating a product throught the API, and I need the Lightspeed Brand ID, I first search in my own shadow database for the Lightspeed ID before inserting this product?

    I also need a shadow database for some parts of the products? When I want to update a product, I first need to search this shadow database for the Lightspeed Product ID before I can update it?

    Sounds a little odd / oldschool to do it this way, right?

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 975 moderator

    Hi @randycillekens,

    You can work with webhooks, so when a product is created, the webhook is triggered. You can save this product information from the webhook in your DB.

  • randycillekensrandycillekens Member Posts: 4

    Hi Lucien,

    Thanks for your quick response. I allready started creating a small shadow database. This makes me also a little bit more in control for new imports and the quality of the import before sending it to Lightspeed.

    Thanks.

    Kind regards,


    Randy

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 975 moderator

    Hi Randy,

    For sure, a shadow DB makes you more in control, now you can match the data with your DB and what is in Lightspeed via API or Webhook.

    Good luck.

Sign In or Register to comment.