Skip to main content

Storefront Product Cost Price (workspace) (v1)

Method & Path

POST /v1/workspace/:workspaceId/storefront/products
PATCH /v1/workspace/:workspaceId/storefront/products/:productId

Actual backend paths match the above.

Description

Workspace product create/update accepts an optional costPrice (non-negative number, default 0). It is used internally for POS cost of goods sold (COGS) snapshots on invoice line items.

costPrice is returned only in workspace management responses (store.products.manage). It is not included in public storefront customer APIs.

Authentication

Required: JWT. Permission: store.products.manage

Persona: Workspace Owner, Staff with product management permission.

Request Body (fragment)

Create or update payload may include:

{
"name": "Example",
"basePrice": 99,
"costPrice": 45
}
ParameterTypeRequiredDescription
costPricenumberNoInternal cost per unit; ≥ 0. Omitted on create defaults to 0

Response

Product objects from list/get/create/update in the workspace include costPrice when present.

Common Errors

  • 422 Unprocessable Entity: costPrice negative
  • 403 Forbidden: Missing store.products.manage