REST API
The documents attached to products are readable over the REST API, so a mobile app, a headless front end, a migration script, or an audit can reach the data without opening the database.
Namespace: wcdp/v1. Both routes are read only.
Permissions
Section titled “Permissions”A caller must be able to edit products or edit posts (edit_products or edit_posts). Otherwise the route returns a 401 or 403. The routes never bypass WordPress permissions.
List products with documents
Section titled “List products with documents”GET /wp-json/wcdp/v1/documentsQuery parameters:
page(integer, default 1)per_page(integer, default 20, maximum 100)problems(boolean, default false) returns only products that have a link which cannot preview
The response is an array of products. Pagination is returned in the X-WP-Total and X-WP-TotalPages response headers.
One product’s documents
Section titled “One product’s documents”GET /wp-json/wcdp/v1/documents/<product_id>Returns a 404 if the ID is not a product.
Response shape
Section titled “Response shape”Each product includes its product_id, name, edit_link, a documents array, and a problems array of URLs that will not preview. Each document reports its name, url, detected service (or null), the chosen renderer (pdfjs or google), and a previewable boolean.

