PATCH
/api/public/v1/products/{productId}Update a product
Update one or more fields on a product. `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
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
productId | string | Required | Product ID. |
Request Body
| Property | Type | Description |
|---|---|---|
name | string | Product name. |
description | string | Product description. |
price | number | Price in cents. |
stock | number | Current stock count. |
stockUnit | string | Unit label for stock. |
stockEnabled | boolean | Toggle stock tracking. |
recurring | boolean | Bill this product on a recurring schedule. |
recurringInterval | string | Billing interval. |
recurringIntervalCount | number | Number of intervals between charges. |
allergens | array | What it contains that people are allergic to: any of `milk`, `eggs`, `fish`, `shellfish`, `tree-nuts`, `peanuts`, `wheat`, `soy`, `sesame`. Replaces the list. |
dietaryTags | array | What it suits: any of `vegetarian`, `vegan`, `gluten-free`, `dairy-free`, `halal`, `kosher`, `spicy`. Replaces the list. |
prepMinutes | number | Minutes 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. |
PATCHExample request
curl
curl -X PATCH "https://www.pxb.app/api/public/v1/products/{productId}" \
-H "Authorization: Bearer your_access_token" \
-H "Content-Type: application/json" \
-d '{
"price": 14000,
"stock": 25,
"stockEnabled": true
}'200Example response
json
{
"message": "Product updated 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.