A
A
Ahmad Dusmatov2019-09-19 14:06:08
WordPress
Ahmad Dusmatov, 2019-09-19 14:06:08

How to get user by phone in Woocommerce REST Api?

You need to get user data by his phone number. I use the following request
https://site.com/wp-json/wc/v3/customers?billing={ "phone":"(1555) 555-5555"}
In response, I get a list of all customers.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Neverov, 2019-09-19
@dusmatoff

As far as I can see, in the GET /customers method there is only one way to filter - by customer status: https://woocommerce.github.io/woocommerce-rest-api...
In this case, just add your method. This is easy to do in WordPress: https://wp-kama.ru/handbook/rest/extending/routes-...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question