Skip to main content
GET
/
products
/
{productId}
/
cost-summary
Get the cost summary of a product
curl --request GET \
  --url https://api.example.com/products/{productId}/cost-summary
{
  "hasEntries": true,
  "currentAverageCost": 45.75,
  "lastEntryCost": 42.3,
  "lastEntryDate": "2026-02-25T12:00:00.000Z",
  "costMethod": "WEIGHTED_AVERAGE",
  "totalStock": 150,
  "manualUnitCost": 50,
  "effectiveUnitCost": 50
}
Returns a read-only snapshot of the produto cost. For KIT produtos, the calculation is summed up recursively based on components. Note: This endpoint is highly cached. Changes to stock or components may take a few seconds to reflect (Eventual Consistency).

Parâmetros de Rota (Path)

productId
string
required
UUID of the produto

Resposta de Sucesso

hasEntries
boolean
Whether the produto has any estoque entries
currentAverageCost
number
Current weighted Custo Médio based on estoque entries. Null if no entries exist.
lastEntryCost
number
Unit cost from the most recent estoque entry. Null if no entries exist.
lastEntryDate
string
Date of the most recent estoque entry. Null if no entries exist.
costMethod
string
Método de Custo used in the last entry calculation (WEIGHTED_AVERAGE or REPLACEMENT). Null if no entries.
totalStock
number
Total stock quantity (sum of entries minus exits). Always >= 0.
manualUnitCost
number
Manually set unit cost by the usuário. Null if not defined.
effectiveUnitCost
number
Effective unit cost used for pricing and margin calculations. Priority: manualUnitCost ?? calculatedUnitCost. For KIT produtos, this is the sum of all component effective costs × quantities. Note: This value may be eventually consistent for KIT produtos (recalculation SLA: ~5s).
{
  "hasEntries": true,
  "currentAverageCost": 45.75,
  "lastEntryCost": 42.3,
  "lastEntryDate": "2026-02-25T12:00:00.000Z",
  "costMethod": "WEIGHTED_AVERAGE",
  "totalStock": 150,
  "manualUnitCost": 50,
  "effectiveUnitCost": 50
}

Path Parameters

productId
string
required

UUID of the product

Response

Cost summary data

hasEntries
boolean
required

Whether the product has any inventory entries

Example:

true

totalStock
number
required

Total stock quantity (sum of entries minus exits). Always >= 0.

Example:

150

effectiveUnitCost
number | null
required

Effective unit cost used for pricing and margin calculations. Priority: manualUnitCost ?? calculatedUnitCost. For KIT products, this is the sum of all component effective costs × quantities. Note: This value may be eventually consistent for KIT products (recalculation SLA: ~5s).

Example:

50

currentAverageCost
number | null

Current weighted average cost based on inventory entries. Null if no entries exist.

Example:

45.75

lastEntryCost
number | null

Unit cost from the most recent inventory entry. Null if no entries exist.

Example:

42.3

lastEntryDate
string<date-time> | null

Date of the most recent inventory entry. Null if no entries exist.

Example:

"2026-02-25T12:00:00.000Z"

costMethod
enum<string> | null

Cost method used in the last entry calculation (WEIGHTED_AVERAGE or REPLACEMENT). Null if no entries.

Available options:
REPLACEMENT,
WEIGHTED_AVERAGE
Example:

"WEIGHTED_AVERAGE"

manualUnitCost
number | null

Manually set unit cost by the user. Null if not defined.

Example:

50