POST
/api/public/v1/productsCreate 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
| Property | Type | Description |
|---|---|---|
businessId | string | Business that owns the product. |
name | string | Product name. |
description | string | Product description (may be empty). |
price | number | Price in cents. |
stock | number | Current stock count (default 0). |
stockUnit | string | Unit label (e.g. "unit", "lb"). |
stockEnabled | boolean | Whether stock tracking is on. |
recurring | boolean | Whether the product is a subscription. |
recurringInterval | string | Billing interval for subscriptions. |
recurringIntervalCount | number | Number 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"
}
}
}