How to edit wp json rest api response for product?

  php, wordpress, wordpress-rest-api

Currently I am using wp-json rest API (wp-json/wc/v3/). I want to get all products with thumbnail/featured image. Current API gives list of images but not featured/thumbnail image.

I am using this API to get products :

https://example.com/wp-json/wc/v3/products?status=publish&per_page=20&page=1&skip_cache=1&category=99&consumer_key=c65&consumer_secret=cs_ac77c

I am getting all products with their info but not getting thumbnail/featured image. So how to edit this response to add thumbnail image ?

I have seen many blog/article but none of them provide any proper information. Also i do not want to use any plugin for that.

Source: Ask PHP

LEAVE A COMMENT