I'm trying to retrieve product info from WooCommerce using their API.
I'm sending an request using the following URL: {url}/wp-json/wc/v2/products?filter[sku]=10008&consumer_key={key}&consumer_secret={key}
. However, the response I receive, contain various products, which have no relation whatsoever to SKU=10008.
I'm wondering why this filter, doesn't isolate the response, only containing products filtered by my specified SKU? Am I using the API wrongly?
For instance, this is my response (only printing the SKU):
pCb0760
pCb0855
pHn4000
pCh0900
pCb0752
pVg0210
pTa0111
pTa0110
pTa0101
pTa0100
pGd0130
pGd0120
pGd0110
pTa0120
pEg0030
pSu1015
pNd0400
pF27z
pF27w
pF27bb
pF27b
pF14z
pF14w
pF14bb
pF14b
pSp0360
pPa0300
pHp0100
pEk0400
pAb1665
pAs0100z
pLt0210
pLt0200
pLt0100
pCs0822
pIg0912
pIg0911
pIg0910
pIg0902
pIg0901
pIg0900
pIg0802
pIg0801
pIg0800
pIg0190
pIg0187
pIg0186
pIg0185
pIg0171
pIg0170
pIg0132
pIg0101
pHi1081
pHi1080
pHi1013
pHi1012
pHi1011
pHi1010
I really can't see any correlation between my request and this response...
Try with this call:
/wp-json/wc/v3/products?sku=<your_sku>"
Replacing <your_sku>
with your SKU.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With