Login / Register
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. `cost` (the wholesale cost) is `null` unless the credential also holds `purchasing:costs` at that location.

Required scope

The access token must carry this scope. A token missing it gets 403 Forbidden. Grant them to an API client under Dev Tools → API, to an assistant or CLI sign-in when you approve or edit it under Dev Tools, 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.
allergensarrayWhat it contains that people are allergic to: any of `milk`, `eggs`, `fish`, `shellfish`, `tree-nuts`, `peanuts`, `wheat`, `soy`, `sesame`. Replaces the list.
dietaryTagsarrayWhat it suits: any of `vegetarian`, `vegan`, `gluten-free`, `dairy-free`, `halal`, `kosher`, `spicy`. Replaces the list.
prepMinutesnumberMinutes one takes to make (1–240), or `null` for none. A kitchen ticket holding it is given at least this long before it reads as late.
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.