• Hello team,

    I would like to use REST API and this seems to work so far well. I tested it with postman.co and I do get a connection and can read products. The moment I get unhappy is when I try to fetch some tagged products or categories so instead of

    example.com/de/wp-json/wc/v3/products

    I use

    example.com/de/wp-json/wc/v3/products?tag=something

    It seems the query parameters do get ignored. Is there an option I have to set or is that maybe an issue on server side?

    Any input is highly appreciated! 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @hahnes,

    It’s good to hear that your WooCommerce REST API connection is functioning properly. If your query parameters, such as ?tag=something, aren’t working as expected, there are a few things to check.

    First, ensure you’re using the correct parameter. WooCommerce requires the tag ID rather than the tag name. The correct format is ?tag=<tag_id>, for example:

    example.com/de/wp-json/wc/v3/products?tag=123
    

    You can retrieve the tag ID using the /wp-json/wc/v3/products/tags endpoint.

    Next, verify that pretty permalinks are enabled in WordPress, as they are required for the WooCommerce REST API. Go to Settings > Permalinks and make sure a structure like /%postname%/ is selected.

    Additionally, check if server caching might be interfering. If caching is enabled, outdated responses could be served instead of updated results. Try clearing the cache or adding a query string like &_nocache=1 to force a fresh response.

    If the issue persists, please share the response you’re receiving when using the query parameter.

    Thread Starter wordpressnetwork

    (@hahnes)

    Hello @mosesmedh,

    thanks for your kind answer. You are absolutely correct, with the numbers it works fine! I could have sworn I tested that before… Anyway, thanks a lot! Also great tip with the endpoint!

    Plugin Support LovingBro (woo-hc)

    (@lovingbro)

    Hi @hahnes,

    Thank you so much for your kind follow-up! It’s great to hear that our earlier response helped and that everything is working smoothly with your REST API queries now—that’s exactly what we love to see.

    If you have any further questions or need additional support, please feel free to start a new topic here: https://ww.wp.xz.cn/support/plugin/woocommerce/#new-topic-0.

    If you have a few minutes, we’d appreciate it if you could leave us a review at https://ww.wp.xz.cn/support/plugin/woocommerce/reviews/. Your feedback means a lot and helps us continue improving the WooCommerce experience for everyone.

    Wishing you continued success with your store and development work!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘REST API Query Parameters Not Working’ is closed to new replies.