Get the cost summary of a product
curl --request GET \
--url https://api.example.com/products/{productId}/cost-summaryimport requests
url = "https://api.example.com/products/{productId}/cost-summary"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/products/{productId}/cost-summary', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/products/{productId}/cost-summary",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/products/{productId}/cost-summary"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/products/{productId}/cost-summary")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/products/{productId}/cost-summary")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"hasEntries": true,
"currentAverageCost": 45.75,
"lastEntryCost": 42.3,
"lastEntryDate": "2026-02-25T12:00:00.000Z",
"costMethod": "WEIGHTED_AVERAGE",
"totalStock": 150,
"manualUnitCost": 50,
"effectiveUnitCost": 50
}
Product Cost
Buscar the cost summary of a produto
Returns a read-only snapshot of the product cost. For KIT products, 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).
GET
/
products
/
{productId}
/
cost-summary
Get the cost summary of a product
curl --request GET \
--url https://api.example.com/products/{productId}/cost-summaryimport requests
url = "https://api.example.com/products/{productId}/cost-summary"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/products/{productId}/cost-summary', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/products/{productId}/cost-summary",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/products/{productId}/cost-summary"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/products/{productId}/cost-summary")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/products/{productId}/cost-summary")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"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)
Resposta de Sucesso
Método de Custo used in the last entry calculation (WEIGHTED_AVERAGE or REPLACEMENT). Null if no entries.
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
}
Response
Cost summary data
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