woocommerce / woocommerce-rest-api

This is the WooCommerce core REST API Package. It runs standalone as a feature plugin too.
71 stars 46 forks source link

Coupons are ignoring query params #201

Closed hicreate closed 3 years ago

hicreate commented 4 years ago

If I retrieve a coupon using /coupons?code=sometexthere the get request ignores the query params and just returns all coupons - is this intended and if not can we implement search by query params so that I can pass a code to the end point and retrieve just the coupon associated?

vedanshujain commented 3 years ago

Looks like you are using one of the legacy API, however, in recent APIs we do support fetching only limited coupons by using code or search query param. You can using like so: wp-json/wc/v3/coupons?search=foo.

I am closing the issue, but if you are already using the new API, then please comment back with following details so that we can debug further:

  1. System status report
  2. Exact request and reponse payload.