Focusing on managing products, variants, and collections through the API.
Hi there,
We use /admin/api/2023-10/products.json?fields=variants to get item info, however, that info does not show if an item is archived or active. Is there a way to get those filtered and if so how?
Solved! Go to the solution
This is an accepted solution.
Hi DutchDelight,
You can retrieve additional fields by adding them to the fields sections. So if you need to retrieve a product's status as well as its variants you can do something like this:
/admin/api/2023-10/products.json?fields=variants,status
That should return all the variants and the status of each product.
If you need to only return the products with a certain status you can add an additional parameter shown below.
Lets say you want to only retrieve "active" products, you would add "&status=active" like so:
/admin/api/2023-10/products.json?fields=variants,status&status=active
This will return all variants and the status of all products that are active. You can change the "active" to whatever you need.
Hope this helps.
This is an accepted solution.
Hi DutchDelight,
You can retrieve additional fields by adding them to the fields sections. So if you need to retrieve a product's status as well as its variants you can do something like this:
/admin/api/2023-10/products.json?fields=variants,status
That should return all the variants and the status of each product.
If you need to only return the products with a certain status you can add an additional parameter shown below.
Lets say you want to only retrieve "active" products, you would add "&status=active" like so:
/admin/api/2023-10/products.json?fields=variants,status&status=active
This will return all variants and the status of all products that are active. You can change the "active" to whatever you need.
Hope this helps.
Thank you! I haven't tried this out yet, but it makes sense. Thanks!
No worries, if my answer solved your issue I’d really appreciate if you could mark it as the solution.
if not, let me know what happened and I’ll help troubleshoot.
Cheers, have a good day!