Woocommerce Bookings REST Api Bookings order filter
-
Hi,
We use the WooCommerce API to sync the orders from WooCommerce in our own system. For this we use the endpoint:
/wp-json/wc/v3/orders?updated_at_min=2020-03-10T00:00:00Z&per_page=10This gives us all the info needed. Now we want to start using WooCommerce Bookings. Unfortunately the booking period is not included within the above call.
I have found that I could call:
/wp-json/wc-bookings/v1/bookings
to list all bookings. But as more and more orders are coming in, this is going to be a large list. So, I want to filter on order_id or order_item_idI’ve tried things like:
/wp-json/wc-bookings/v1/bookings?order_id=12345
/wp-json/wc-bookings/v1/bookings?order_item_id=321
wp-json/wc-bookings/v1/bookings?filter[order_id]=12345
wp-json/wc-bookings/v1/bookings?filter[order_item_id]=321This all seems to not do anything, it returns the same bookings even when I change the order or order item id to something that does not exist.
I’ve tried to look at this page: https://docs.woocommerce.com/document/bookings-action-and-filter-reference/
Unfortunately I have no idea how to use this. I could findwoocommerce_booking_json_search_order_number
which should “The order number being searched for when editing a booking.” but adding this to the url doesn’t work.Any help would be appreciated, thanks.
The page I need help with: [log in to see the link]
- The topic ‘Woocommerce Bookings REST Api Bookings order filter’ is closed to new replies.