-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get variations by sku #31370
Comments
Issue-Label Bot is automatically applying the label Links: app homepage, dashboard and code for this bot. |
This is supported by using Similarly That said, I am closing the issue because we likely won't support endpoints with |
@vedanshujain I really don't understand your answer. E.g.: When you make a POS and you want to scan the barcode you can scan this sku code to retrieve the product/variation. I can not wrap my head around why the woocommerce dev team does not see the issue in this. Or am i missing something here? |
You can use /wp-json/wc/v3/products?sku=variation_sku to get the variation id and the parent_id (product_id) |
@jorgemd24 When I try to get the variation with this endpoint, I get a critical Error response from the server. |
@jorgemd24, You posted:
Has this worked for you? When I created this issue the /wp-json/wc/v3/products endpoint would only search by the product sku, not variation sku (what I need). The documentation still implies that it's only by product sku: "sku: Limit result set to products with a specific SKU" |
Yes it does work, have you tried it recently?
I think they are talking "in the broad sense" of products (parent products, variations, simple products, groups etc). Otherwise they will need to specify that only works for parent products or simple products. |
Do you have more information about the error? have you tried to debug it? |
Hi @maxim-skuvault, Thank you for opening the issue! It requires further feedback from the WooCommerce Core team. I am adding the Please note it may take a few days for them to get to this issue. Thank you for your patience. |
Thanks for the further discussion of this issue. Supporting |
|
Thanks. Yes, this would work for our purposes. |
Is there any progress or feedback on this? |
Hi! This is not something we are actively working on at present, as it is a low priority from our perspective. However, we are always interested in contributions from the community—and would be receptive to a pull request. |
Came here for a solution and got none. Such a life :D. I'll leave my solution here to make someone else's life easier. You're welcome
|
Hi everyone! 👋 Filtering the results of I'm going to close this issue as it seemsthis can't be reproduced on a recent version, but feel free to re-open or add any other details if you think we've missed something. |
It would be very useful to have an endpoint to get variations by sku, without having so supply the productId.
We use the sku to look up variations in WooCommerce and then update the stock quantity. Currently, to get a variation from the api, the only option is to pass the parent productId, which we don't have nor do we want to keep track of outside wooCommerce. This severely limits the usefulness of the api for the purpose of updating quantities. We're having to get all products and then all variations for each product and then filter variations by sku, which is a huge performance hit
The text was updated successfully, but these errors were encountered: