Product visibility and main/variant updated time

Hi.
I'm working on an API integration for a customer. I dont have access to the shop backend, so I dont know how the shop is set up, but I do have a working set of API credentials.
I have two questions:
1: I have two products where one is visible in the storefront and one isn't. When I request these two products in the API both of them have visibility:auto and isVisible:false. Both of them also have stocktracking:true and stocklevel:0
I can't seem to find a way to tell which product is visible in the storefront based on the API response - is there something i'm missing?
2: When i request all the variants that are updated in the past 6 hours and all the main products that are updated in the past 6 hours (using updated_at_min filter), it seems that a lot of variants have been changed, but not necessarily the related main products.
What triggers an update on the main product? More specifically i'm interested in knowing what happens if you change the price of a variant - will that update both the main and the variant or just the variant?
10 comments
Hi @aal,
Thank you for contacting us. For all details about the product endpoint, please visit: https://developers.lightspeedhq.com/ecom/endpoints/product/
For your first question, there are a few settings for the visibility of the product you can choose:
{“visibility”: “hidden(hidden)|visible(always visible)|auto(visible when on stock)”}
When you change the price only the variant with update, because you're hitting the variant endpoint. If you do a request to the product endpoint this will trigger, so the update_at field will be updated.
Please check the documentation with our collection so you can test everything in Postman. :)
I hope this helps.
1: You didn't really answer my question about the visibility. How can i tell which of the two is visible in the storefront? Both of them have identical info when returned by the API.
I'm wondering if there are other API calls I can use for this, if the shop owner must have done something wrong to create this scenario or if the API is flawed.
If you have some sort of super admin access to all shops you can look at them here:
https://www.blisso.nl/royal-24-glue-on-nail-tips-pearlesque-met-nagellij.html
https://www.blisso.nl/maybelline-fit-me-matte-poreless-foundation-120-cl.html
2: So if i want to create a delta feed with only updated products(master product with nested variants) I would need to request all products and all variants with the updated filter, and for each one of them i would need to request its master or variant individually. This would quickly be a lot of requests that easily exceeds your rate limiting. how is this actually doable?
Hi @aal,
1: So you are saying it shouldn't be possible for a product to return isVisible:false in the api and then still have it be visible in the storefront?
What could be causing this then? since this is the case with this product: https://www.blisso.nl/royal-24-glue-on-nail-tips-pearlesque-met-nagellij.html
2: I'm generating a delta feed on request with a python script, so webhooks are not really an option. Even if, i would still need to call the api each time the webhook was triggered, resulting in the same amount of daily requests - or have i misunderstood something?
1: I see what you mean, it looks like something is going wrong here, but this doesn't look like an API related issue. So I will create a ticket for it so our support agents can help you with this. When I click in the backoffice to view this item I get a message that this product is hidden. See below:
2: Why do you need to call the API if a webhooks was triggered? The webhooks will be triggered each time the user is making a change.
Hi @aal,
My colleague has checked on this one, and fixed the issue. This product wasn't saved good enough. So now the product isn't visible any more.
@LucienVersendaal
1: Thanks for fixing the visibility issue.
2: I thought the webhook only contained info on which product was updated, not the updates themselves. this would mean i need to call the api to get the actual updates.
@aal,
2: The webhook contains all information of the product, so after that you'll need to compare in this your middleware with the previous one to check what's the difference.
Ah, in that case, if my setup was different, I would be able to use the webhooks. Thanks for clarifying.
Hi @aal,
Perfect!