Skip to content

REST API

ProductBay registers its own REST API endpoints under the productbay/v1 namespace. All endpoints require the manage_options capability (WordPress administrator).

Internal API

These REST API endpoints are used internally by the ProductBay admin panel. They are not intended as a public API and may change in future versions. Do not build external integrations against these endpoints.

Authentication

All endpoints require:

  • The user to be logged in to WordPress
  • The user to have the manage_options capability
  • A valid WordPress REST API nonce (handled automatically by the admin panel)

Base URL

/wp-json/productbay/v1/

Endpoints

Tables

List All Tables

http
GET /wp-json/productbay/v1/tables

Returns an array of all ProductBay tables with their metadata.

Response:

json
[
  {
    "id": 1,
    "title": "All Products",
    "status": "publish",
    "source": { "type": "all" },
    "shortcode": "[productbay id=\"1\"]",
    "created": "2026-01-15T10:30:00",
    "modified": "2026-01-20T14:22:00"
  }
]

Get Single Table

http
GET /wp-json/productbay/v1/tables/{id}

Returns full table data including configuration.

ParameterTypeDescription
idintegerTable post ID

Create / Update Table

http
POST /wp-json/productbay/v1/tables

Creates a new table or updates an existing one. Send the full table configuration in the request body.

Body ParameterTypeDescription
dataobjectComplete table configuration (title, source, columns, style, settings)

Delete Table

http
DELETE /wp-json/productbay/v1/tables/{id}

Permanently deletes a table.

ParameterTypeDescription
idintegerTable post ID

Products

Search Products

http
GET /wp-json/productbay/v1/products

Search WooCommerce products by name, ID, or SKU.

ParameterTypeDescription
searchstringProduct name search (fuzzy match)
includeintegerExact product ID
skustringSKU exact or prefix match
limitintegerResults per page (default: 10)
pageintegerPage number (default: 1)

List Categories

http
GET /wp-json/productbay/v1/categories

Returns all WooCommerce product categories.

Response:

json
[
  {
    "id": 15,
    "name": "Clothing",
    "count": 42,
    "slug": "clothing"
  }
]

Source Statistics

http
GET /wp-json/productbay/v1/source-stats

Returns product and category counts for a source type.

ParameterTypeDescription
typestringSource type: all or sale

Response:

json
{
  "categories": 5,
  "products": 120
}

Settings

Get Settings

http
GET /wp-json/productbay/v1/settings

Returns current plugin settings merged with defaults.


Update Settings

http
POST /wp-json/productbay/v1/settings

Updates plugin settings.

Body ParameterTypeDescription
settingsobjectSettings key-value pairs to update

Reset All Data

http
POST /wp-json/productbay/v1/settings/reset

Destructive Action

This endpoint deletes all tables, clears all metadata, and resets settings to defaults. This cannot be undone.

Response:

json
{
  "success": true,
  "deleted_tables": 5,
  "settings": { ... }
}

System

System Status

http
GET /wp-json/productbay/v1/system/status

Returns system information (table counts, WooCommerce status, etc.).


Mark Onboarded

http
POST /wp-json/productbay/v1/system/onboard

Marks the onboarding process as completed.


Preview

Generate Preview

http
POST /wp-json/productbay/v1/preview

Renders a table preview from the provided configuration. Used by the Creation Wizard's live preview feature.

Released under the GPL-2.0+ License.