POST
/api/public/v1/products

Create a product

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

Required scope

The access token must carry this scope. A token missing it gets 403 Forbidden. Grant them to an API client under Settings → Company → API, and to a teammate under Employee → Permissions.

products:write

Request Body

PropertyTypeDescription
locationIdstringLocation 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 "Authorization: Bearer your_access_token" \
  -H "Content-Type: application/json" \
  -d '{
    "locationId": "loc_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"
    }
  }
}

In the console

The same thing done by hand, for anyone comparing the API against the screen they already use.

Inventory → Products
/inventory/products
  1. Add a product.