Title: Extend cpt api endpoint
Last modified: December 12, 2023

---

# Extend cpt api endpoint

 *  Resolved [danielwerner23](https://wordpress.org/support/users/danielwerner23/)
 * (@danielwerner23)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/extend-cpt-api-endpoint/)
 * Hi there,
 * i’ve added the endpoint **products** and **product-categories** with acf and 
   activated it via the api-switch. Now i can get all my products with **/wp-json/
   wp/v2/products?_fields=title** – fine. My questions is, how i can extend this
   request, to get only products, where has **product-category=slug/id** (slug or
   id from product-categories).
 * My only idea is to do a pre request with a custom endpoint (eg. _get\_product\
   _ids\_by\_category__slug) and after that the normal request like **/wp-json/wp/
   v2/products?_fields=title&include=55,56** …
 * Any ideas?

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

 *  Thread Starter [danielwerner23](https://wordpress.org/support/users/danielwerner23/)
 * (@danielwerner23)
 * [2 years, 5 months ago](https://wordpress.org/support/topic/extend-cpt-api-endpoint/#post-17280768)
 * Hi there. This is NOT a special ACF question/problem. There are 2 existing CPTs:
   products and products-category. It doesnt matter if you are create these 2 with
   acf or manualy in your functions.php. So please move the question into the normal
   support forum. Thanks a lot.
 * You can edit my question and remove the “acf wording”.
    -  This reply was modified 2 years, 5 months ago by [danielwerner23](https://wordpress.org/support/users/danielwerner23/).
 *  Plugin Support [ACF Support](https://wordpress.org/support/users/acfsupport/)
 * (@acfsupport)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/extend-cpt-api-endpoint/#post-17317273)
 * Hi [@danielwerner23](https://wordpress.org/support/users/danielwerner23/)
 * ACF Support Team here. This forum is generally used by ACF users to help each
   other out.
 *  Unfortunately, we do not have a way to move the conversation to the main forum,
   I’d request you to post it once more there.
 * Please don’t hesitate to reach out to us in case anything else comes up, we are
   happy to help.

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

The topic ‘Extend cpt api endpoint’ is closed to new replies.

 * ![](https://ps.w.org/advanced-custom-fields/assets/icon.svg?rev=3207824)
 * [Advanced Custom Fields (ACF®)](https://wordpress.org/plugins/advanced-custom-fields/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/advanced-custom-fields/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-custom-fields/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-custom-fields/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-custom-fields/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-custom-fields/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [ACF Support](https://wordpress.org/support/users/acfsupport/)
 * Last activity: [2 years, 4 months ago](https://wordpress.org/support/topic/extend-cpt-api-endpoint/#post-17317273)
 * Status: resolved