List product costs
Returns the four cost columns used by the product-profit page for an inclusive sales-month range of at most 24 months. Use the first day of each month (YYYY-MM-01). A null amount means the cost is not available; a numeric zero is a costed zero.
GET
/external/v1/product-costsAuthorization
AuthorizationBearer token · headerrequiredDedicated Bearer API key for product-cost exports.
Query parameters
month_fromstring<date>requiredInclusive sales-month start; use YYYY-MM-01.
month_tostring<date>requiredInclusive sales-month end; use YYYY-MM-01.
segmentstringProduct segment: normal products, samples, or both.
default: "normal"
Allowed:
normalsampleallResponses
200Product cost rows.
Array of
ExternalProductCostRowinbound_freight_usdnumber | anyInbound freight in USD; null means not costed.
Show propertiesHide properties
Any of:
number
numberany
anylingxing_product_idinteger | anyLingxing product ID; null for unmapped rows.
Show propertiesHide properties
Any of:
integer
integerany
anylingxing_skustring | anyLingxing SKU; null for unmapped rows.
Show propertiesHide properties
Any of:
string
stringany
anyproduct_namestring | anyProduct name.
Show propertiesHide properties
Any of:
string
stringany
anypurchase_cost_usdnumber | anyPurchase cost in USD; null means not costed.
Show propertiesHide properties
Any of:
number
numberany
anyshipping_to_customer_usdnumber | anyShipping-to-customer cost in USD; null means not costed.
Show propertiesHide properties
Any of:
number
numberany
anywarehouse_fees_usdnumber | anyWarehouse fees in USD; null means not costed.
Show propertiesHide properties
Any of:
number
numberany
any400Invalid or oversized month range.
401Missing or invalid API key.
422Validation Error
detailValidationError[]Show propertiesHide properties
Array of
ValidationErrorctxobjectinputanylocstring | integer[]requiredShow propertiesHide properties
Array of
string | integerAny of:
string
stringinteger
integermsgstringrequiredtypestringrequired429Rate limit exceeded; honor Retry-After.
503External API key is not configured.
504Database query timed out.
Try it
Server
Authorization
Parameters
Request
curl -X GET "https://api.mellow-dev.billgateai.com/external/v1/product-costs?month_from=2026-07-01&month_to=2026-07-01" \
-H "Authorization: Bearer YOUR_TOKEN"const response = await fetch("https://api.mellow-dev.billgateai.com/external/v1/product-costs?month_from=2026-07-01&month_to=2026-07-01", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_TOKEN"
}
});import requests
response = requests.get(
"https://api.mellow-dev.billgateai.com/external/v1/product-costs?month_from=2026-07-01&month_to=2026-07-01",
headers={
"Authorization": "Bearer YOUR_TOKEN"
},
)Response
[
{
"inbound_freight_usd": 20,
"lingxing_product_id": 123,
"lingxing_sku": "860014330490",
"product_name": "Example",
"purchase_cost_usd": 100,
"warehouse_fees_usd": 5
}
]Invalid or oversized month range.
{
"detail": "INVALID_API_KEY"
}{
"detail": [
{
"ctx": {},
"input": null,
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}{
"detail": "RATE_LIMIT_EXCEEDED"
}{
"detail": "EXTERNAL_API_NOT_CONFIGURED"
}{
"detail": "QUERY_TIMEOUT"
}