POST
/api/public/v1/products

Create a product

Create a new product within a business. Prices are in the smallest currency unit (cents for USD). Product images and options can be added via the dashboard.

Request Body

PropertyTypeDescription
businessIdstringBusiness that owns the product.
namestringProduct name.
descriptionstringProduct description (may be empty).
pricenumberPrice in cents.
stocknumberCurrent stock count (default 0).
stockUnitstringUnit label (e.g. "unit", "lb").
stockEnabledbooleanWhether stock tracking is on.
recurringbooleanWhether the product is a subscription.
recurringIntervalstringBilling interval for subscriptions.
recurringIntervalCountnumberNumber of intervals between billings.
POSTExample request
curl
curl -X POST "https://www.pxb.app/api/public/v1/products" \
  -H "X-Organization-Id: your_org_id" \
  -H "X-API-Key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "businessId": "biz_abc",
    "name": "Annual Subscription",
    "description": "Yearly access to the platform.",
    "price": 12000,
    "recurring": true,
    "recurringInterval": "year",
    "recurringIntervalCount": 1
  }'
200Example response
json
{
  "message": "Product created successfully!",
  "content": {
    "product": {
      "id": "prod_1"
    }
  }
}