Get Product

GET /wp-json/content-api/v1/product/

Retrieves product details by ID or SKU, or lists products missing descriptions.

Authentication

This endpoint requires a Bearer token in the Authorization header. To authenticate:

  1. Go to Content API > Settings in your WordPress admin panel.
  2. Set a secure token in the “Token” field and save it.
  3. Include the token in your request header as follows:
Authorization: Bearer <your-token-here>

Replace <your-token-here> with the token you configured.

Parameters

Name Type Description Required
product_id integer The ID of the product Yes if no sku provided
sku string The SKU of the product Yes if no product_id provided
missing_description boolean If true, returns products without descriptions No
missing_description_limit integer Limit for missing description results (default: 100) No

Example Request Using SKU

GET /wp-json/content-api/v1/product/?sku=SUNGLASS-1

Example Request Using Product ID

GET /wp-json/content-api/v1/product/?product_id=123

Example Response

{
  "product_id": 123,
  "name": "Sunglasses",
  "slug": "sunglasses",
  "description": "Description",
  "short_description": "Short Description",
  "price": 118.35,
  "sale_price": "116.35",
  "map_price": "99.99",
  "cost": "87.99",
  "sku": "SUNGLASS-1",
  "upc": "123456-789",
  "weight": "10.59",
  "stock_status": "instock",
  "manage_stock": true,
  "stock_quantity": 3,
  "tags": ["sunglasses"],
  "categories": ["eyewear"],
  "attributes": [
    {
      "name": "Color",
      "value": ["Red", "Blue", "Yellow"]
    }
  ],
  "images": [],
  "featured_image": "https://www.example.com/image.jpg",
  "yoast": {
    "title": "Title",
    "description": "Description",
    "premium": {
      "social_appearance": {
        "title": "Social Title",
        "description": "Social Desc",
        "image": "https://www.example.com/image.jpg"
      },
      "x": {
        "title": "X Title",
        "description": "X Desc",
        "image": "https://www.example.com/image.jpg"
      }
    }
  }
}

Example Request For Missing Descriptions

GET /wp-json/content-api/v1/product/?missing_description=true&missing_description_limit=2

Example Response

[
  {
    "product_id": "123",
    "sku": "SUNGLASS-1"
  },
  {
    "product_id": "456",
    "sku": "SUNGLASS-2"
  }
]

Possible Errors

Code Message Description HTTP Status
not_authorized Not Authorized The provided Bearer token is invalid or does not match the configured token. 401
missing_identifier Product ID or SKU is required Neither a product ID nor SKU was provided in the request parameters. 400
product_id_invalid Product ID is invalid The provided product ID is not a valid numeric value. 400
sku_invalid SKU is invalid The provided SKU contains invalid characters or is not properly sanitized. 400
conflicting_identifiers Both Product ID and SKU are provided. Please provide only one. Both product ID and SKU were provided in the same request, which is not allowed. 400
product_not_found Product not found No product was found matching the provided product ID. 404
product_not_found Product not found with provided SKU No product was found matching the provided SKU. 404
no_products No products missing descriptions No products were found when querying for products missing descriptions (if missing_description parameter is used). 404