List product costs / 获取产品四项成本
Returns the four cost columns used by the product-profit page for an inclusive date range. A null amount means the cost is not available; a numeric zero is a costed zero. / 返回产品利润页面使用的四项成本,日期边界均包含。金额为 null 表示未核算,数字 0 表示已核算的真实零值。
GET
/external/v1/product-costsAuthorization
AuthorizationBearer token · headerrequiredDedicated Bearer API key for product-cost exports. / 产品成本导出专用 Bearer API Key。
Query parameters
month_fromstring<date>requiredInclusive start date in ISO format. / 包含边界的 ISO 起始日期。
month_tostring<date>requiredInclusive end date in ISO format. / 包含边界的 ISO 结束日期。
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. / 头程成本(USD);null 表示未核算。
Show propertiesHide properties
Any of:
number
numberany
anylingxing_product_idinteger | anyLingxing product ID; null for unmapped rows. / 领星产品 ID;未映射行为空。
Show propertiesHide properties
Any of:
integer
integerany
anylingxing_skustring | anyLingxing SKU; null for unmapped rows. / 领星 SKU;未映射行为空。
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. / 采购成本(USD);null 表示未核算。
Show propertiesHide properties
Any of:
number
numberany
anyshipping_to_customer_usdnumber | anyShipping-to-customer cost in USD; null means not costed. / 尾程成本(USD);null 表示未核算。
Show propertiesHide properties
Any of:
number
numberany
anywarehouse_fees_usdnumber | anyWarehouse fees in USD; null means not costed. / 仓库费用(USD);null 表示未核算。
Show propertiesHide properties
Any of:
number
numberany
any400Invalid date range. / 日期范围无效。
401Missing or invalid API key. / API Key 缺失或无效。
422Validation Error
detailValidationError[]Show propertiesHide properties
Array of
ValidationErrorctxobjectinputanylocstring | integer[]requiredShow propertiesHide properties
Array of
string | integerAny of:
string
stringinteger
integermsgstringrequiredtypestringrequired503External API key is not configured. / 服务端未配置外部 API Key。
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-31" \
-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-31", {
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-31",
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
}
]{
"detail": "INVALID_MONTH_RANGE"
}{
"detail": "INVALID_API_KEY"
}{
"detail": [
{
"ctx": {},
"input": null,
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}{
"detail": "EXTERNAL_API_NOT_CONFIGURED"
}