Endpoints: financial breakdown
These endpoints compute DataGlass's core numbers — true profit, true margin, and profit-adjusted ROAS — by netting out platform fees, commission, payment fees, shipping, ads cost, returns, VAT, and your COGS. See Getting started for auth and Conventions for the response envelope. All read-only.
Shopee — financial breakdown
POST/api/shopee/financial-breakdown/model-breakdowns/batch-by-model-ids
Computes financial breakdowns for a list of specific product model IDs. Each model gets a detailed profit analysis — revenue, costs, fees, and net profit. Use this for bulk variant analysis or to compare profitability across models within a product. True profit nets out platform fees, commission, ads cost, and COGS.
Request body
ShopeeGetModelBreakdownsByModelIdsDto
| Field | Type | Required | Description |
|---|---|---|---|
shopId | integer | yes | Shopee shop ID |
region | string | yes | Region code (e.g. TH) |
modelIds | array | yes | Model IDs to analyze |
lookbackDays | integer | no | Days of sales history to analyze (default 180) |
effectiveDate | string (date) | no | Override effective date for fee rates (default today) |
Response — Array of ShopeeModelBreakdownFlatEntry
One entry per model: item/model id, original price, the full cost breakdown, metadata (rates, VAT, inferred COGS, profit), and product-level aggregates.
| Field | Type | Description |
|---|---|---|
itemId | integer | Product item ID |
modelId | integer | Model/variant ID (null for single-variant products) |
originalPrice | number | List price before discounts |
breakdown | object | Fee-by-fee breakdown (commission, service fee, transaction fee, COGS, ads, returns…) |
metadata | object | Rates, VAT status, inferred COGS, profit summary |
modelUnitsSold | integer | Units sold in the lookback window |
productMargin | number | Product-level margin |
…and more — see the full schema in the OpenAPI spec.
POST/api/shopee/financial-breakdown/product
Analyzes one product's profit across all variants (models): aggregates revenue and costs across models sold in the lookback window, then returns a single per-unit profit breakdown — gross revenue, platform fees, commission, VAT, COGS, ads spend, and net margin.
Request body
ShopeeGetUnitFinancialBreakdownDto
| Field | Type | Required | Description |
|---|---|---|---|
shopId | integer | yes | Shopee shop ID |
region | string | yes | Region code |
itemId | integer | yes | Product item ID |
modelId | integer | no | Specific model; omit to aggregate all models |
lookbackDays | integer | no | Sales history window (default 180) |
includeVat | boolean | no | Include VAT computation (default true) |
effectiveDate | string (date) | no | Override effective date for rates |
Response — ShopeeFinancialBreakdown
A signed, line-by-line itemization (positive = revenue, negative = cost); summing all lines yields net profit per unit.
| Field | Type | Description |
|---|---|---|
originalModelPrice | object | List price before discounts |
sellerDiscount | object | Seller-funded item discount |
commissionFee | object | Shopee commission fee |
serviceFee | object | Shopee service fee |
manufacturingCogs | object | Product cost (explicit or inferred) |
adsCostPerSale | object | Marginal ads spend |
vat | object | Output VAT (if VAT-registered) |
…and more — see the full schema in the OpenAPI spec.
POST/api/shopee/financial-breakdown/new-product
Estimates profit for a product before listing. Supply price, category, COGS, and VAT mode and get the projected margin given your cost structure and the platform's fee schedule — useful for pricing strategy.
Request body
ShopeeGetNewProductFinancialBreakdownDto
| Field | Type | Required | Description |
|---|---|---|---|
shopId | integer | yes | Shopee shop ID |
region | string | yes | Region code |
listingPrice | number | yes | Proposed listing price |
categoryId | integer | yes | Shopee category ID (determines commission rate) |
manufacturingCogs | number | no | Unit product cost |
hasVat | boolean | no | Seller is VAT-registered (default false) |
buyerPaidShippingFee | number | no | Buyer-paid shipping (Seller-Own-Fleet only) |
effectiveDate | string (date) | no | Override effective date for rates |
Response — ShopeeFinancialBreakdownWithMetadata
| Field | Type | Description |
|---|---|---|
breakdown | object | Per-unit cost-line breakdown |
metadata | object | Commission/VAT rates, inferred COGS, profit, margin |
modelBreakdowns | array | Per-model breakdowns (usually empty for new products) |
POST/api/shopee/financial-breakdown/required-price
Reverse-calculates the listing price needed to hit a target profit (or margin) given COGS and a discount strategy, after all platform fees. Use before listing or repricing.
Request body
ShopeeComputeRequiredPriceDto
| Field | Type | Required | Description |
|---|---|---|---|
shopId | integer | yes | Shopee shop ID |
region | string | yes | Region code |
categoryId | integer | yes | Shopee category ID (for commission rate) |
cogs | number | yes | Unit product cost |
targetMargin | number | yes | Target profit per unit |
targetDiscount | number | no | Fixed discount amount |
targetDiscountPercent | number | no | Discount as % of listing price |
hasVat | boolean | no | VAT-registered seller (default false) |
adsCostPerSale | number | no | Estimated ads cost to factor in |
effectiveDate | string (date) | no | Override effective date for rates |
Response — ShopeeRequiredPriceResult
| Field | Type | Description |
|---|---|---|
requiredListingPrice | number | Minimum listing price to achieve the target |
breakdown | object | Full cost breakdown at that price |
POST/api/shopee/financial-breakdown/simulate
Projects the profit impact of changing a product's price, discount, or seller-funded promotions before applying them. Input proposed values and see the resulting margin and profit per unit. Does NOT change anything on Shopee.
Request body
ShopeeProfitImpactSimulationDto — shopId, region, itemId required; the rest are optional overrides.
| Field | Type | Required | Description |
|---|---|---|---|
shopId | integer | yes | Shopee shop ID |
region | string | yes | Region code |
itemId | integer | yes | Product item ID |
modelId | integer | no | Specific model; omit for product-level |
sellerDiscount | number | no | Proposed seller discount |
sellerVoucher | number | no | Proposed seller voucher |
manufacturingCogs | number | no | Override product cost |
adsCostPerSale | number | no | Override ads cost estimate |
commissionRate | number | no | Override commission rate |
effectiveDate | string (date) | no | Override effective date for rates |
Response — ShopeeFinancialBreakdownWithMetadata — the simulated breakdown and resulting margin/profit.
POST/api/shopee/financial-breakdown/item/{shopId}/{region}/{itemId}
Fetches the realized financial breakdown for a product, aggregating actual sales and costs across all variants in the lookback window (based on real sales data, not hypothetical pricing).
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
shopId | integer | yes | Shopee shop ID |
region | string | yes | Region code |
itemId | integer | yes | Product item ID |
Request body
ShopeeItemFinancialBreakdownFetchRequest (optional — defaults applied if omitted)
| Field | Type | Required | Description |
|---|---|---|---|
lookbackDays | integer | no | Sales history window (default 180) |
includeVat | boolean | no | Include VAT (default false) |
effectiveDate | string (date) | no | Override effective date for rates |
Response — ShopeeFinancialBreakdownWithMetadata — per-unit breakdown aggregated across models, plus per-model entries.
POST/api/shopee/financial-breakdown/products/{shopId}/{region}
Per-product breakdowns for the entire shop, cursor-paginated. Each product's breakdown is aggregated across its variants from actual sales. Use for dashboard tables ranking profitability.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
shopId | integer | yes | Shopee shop ID |
region | string | yes | Region code |
Request body
ShopeeProductLevelFinancialBreakdownFetchRequest (optional)
| Field | Type | Required | Description |
|---|---|---|---|
lookbackDays | integer | no | Sales history window (default 180) |
includeVat | boolean | no | Include VAT (default false) |
cursorRtProductId | integer | no | Pagination cursor (omit to start) |
pageSize | integer | no | Results per page (default 50) |
effectiveDate | string (date) | no | Override effective date for rates |
Response — CursorPaginatedResult<RtShopeeProductCursor, ShopeeProductFinancialBreakdownEntry>
| Field | Type | Description |
|---|---|---|
data | array | Product entries (item id, name, breakdown, units sold) |
nextCursor | object | Cursor for next page (null at end) |
dataFreshAt | string (date) | When product data was last synced |
POST/api/shopee/financial-breakdown/profit-adjusted-roas/{shopId}/{region}/{itemId}
Computes ROAS adjusted for actual profit (not just GMV), accounting for COGS, fees, and discounts — i.e. true profitability per ad dollar. Returns three frames: raw (as Shopee reports), cleaned, and deflated.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
shopId | integer | yes | Shopee shop ID |
region | string | yes | Region code |
itemId | integer | yes | Product item ID |
Request body
ShopeeProductProfitAdjustedRoasFetchRequest (optional)
| Field | Type | Required | Description |
|---|---|---|---|
lookbackDays | integer | no | Ads history window (default 180) |
includeVat | boolean | no | Include VAT in the profit calc (default false) |
effectiveDate | string (date) | no | Override effective date for rates |
Response — ShopeeProductProfitAdjustedRoasSummary
| Field | Type | Description |
|---|---|---|
itemId | integer | Product item ID |
totalAdExpense | number | Total ad spend in the period |
totalProfitFromAds | number | Profit from ads-attributed orders |
profitAdjustedRoas | number | Profit ÷ ad spend |
modelDetails | array | Per-variant margins and ROAS |
…and more — see the full schema in the OpenAPI spec.
POST/api/shopee/financial-breakdown/profit-adjusted-roas-dedup/{shopId}/{region}/{itemId}
Like the profit-adjusted ROAS endpoint, but applies ad-cancellation dedup: it distinguishes chain-rebuy cancels from solo cancels and returns three confidence levels — raw, cleaned (chain-rebuys removed), and deflated (net settled) — so you see true ad effectiveness after cancellations.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
shopId | integer | yes | Shopee shop ID |
region | string | yes | Region code |
itemId | integer | yes | Product item ID |
Request body
ShopeeProductProfitAdjustedRoasFetchRequest (optional) — same fields as above.
Response — ShopeeProductProfitAdjustedRoasSummary
| Field | Type | Description |
|---|---|---|
profitAdjustedRoas | number | Raw ROAS (Shopee-reported attribution) |
profitAdjustedCleanedRoas | number | Cleaned ROAS (chain-rebuy dedup) |
profitAdjustedDeflatedRoas | number | Deflated ROAS (all cancels removed) |
modelDetails | array | Per-variant ROAS and profit |
…and more — see the full schema in the OpenAPI spec.
POST/api/shopee/financial-breakdown/corrected-roas/{shopId}/{region}
Shop-level ad ROAS corrected for ad-cancellation dedup but without the profit-margin adjustment (based on GMV after fees, not after COGS). One entry per requested item — useful when COGS data is incomplete.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
shopId | integer | yes | Shopee shop ID |
region | string | yes | Region code |
Request body
ShopeeCorrectedRoasFetchRequest
| Field | Type | Required | Description |
|---|---|---|---|
itemIds | array | yes | Product item IDs |
lookbackDays | integer | no | Ads history window (default 30) |
Response — Array of ShopeeProductAdsCorrectedSummary
| Field | Type | Description |
|---|---|---|
itemId | integer | Product item ID |
totalAdExpense | number | Ad spend in the period |
attributedGmv | number | GMV attributed to ads (after dedup) |
correctedRoas | number | GMV ÷ ad spend (no COGS) |
…and more — see the full schema in the OpenAPI spec.
POST/api/shopee/financial-breakdown/products/{shopId}/{region}/sorted-by-profit
Ranks all shop products by realized profit (highest first) over the lookback window — for spotting top earners and loss-makers. Offset-paginated.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
shopId | integer | yes | Shopee shop ID |
region | string | yes | Region code |
Request body
ShopeeSortedProductBreakdownFetchRequest (optional)
| Field | Type | Required | Description |
|---|---|---|---|
lookbackDays | integer | no | Sales history window (default 180) |
includeVat | boolean | no | Include VAT (default false) |
page | integer | no | 0-based page (default 0) |
pageSize | integer | no | Results per page (default 50) |
effectiveDate | string (date) | no | Override effective date for rates |
Response — OffsetPaginatedResult<ShopeeProductProfitSortedEntry> — products ranked by total profit, with page metadata and dataFreshAt.
POST/api/shopee/financial-breakdown/products/{shopId}/{region}/sorted-by-profit-adjusted-roas
Ranks all shop products by profit-adjusted ROAS (highest first) — which products deliver the best return on ad spend, after real margins.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
shopId | integer | yes | Shopee shop ID |
region | string | yes | Region code |
Request body
ShopeeSortedProductBreakdownFetchRequest (optional) — same fields as sorted-by-profit.
Response — OffsetPaginatedResult<ShopeeProductProfitAdjustedRoasSummary> — products ranked by profit-adjusted ROAS, with page metadata.
POST/api/shopee/financial-breakdown/shop-overview/{shopId}/{region}
A comprehensive shop-level profit overview in one payload: total profit, average margin, top/worst products, cost breakdown, channel split (organic/ads/affiliate), margin distribution, and a money-flow Sankey. For better performance, prefer the focused sub-endpoints below.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
shopId | integer | yes | Shopee shop ID |
region | string | yes | Region code |
Request body
ShopeeShopFinancialOverviewFetchRequest (optional)
| Field | Type | Required | Description |
|---|---|---|---|
from | string (date) | no | Start date (default last 30 days) |
to | string (date) | no | End date (default today) |
topN | integer | no | Top N products to list (default 5) |
compareToPrevious | boolean | no | Include prior-period comparison (default true) |
includeVat | boolean | no | Include VAT (default false) |
Response — ShopeeShopFinancialOverview
| Field | Type | Description |
|---|---|---|
grossGmv | number | Gross merchandise value (after seller discount) |
totalProfit | number | Total shop profit |
avgMargin | number | Revenue-weighted average margin |
topProfitProducts | array | Top N most profitable products |
costBreakdown | array | P&L waterfall with all cost lines |
comparison | object | Prior-period comparison and KPI deltas |
channelBreakdown | object | Profit split across organic/ads/affiliate |
sankey | object | Money-flow Sankey diagram |
…and more — see the full schema in the OpenAPI spec.
POST/api/shopee/financial-breakdown/shop-overview/{shopId}/{region}/summary
The headline slice of the shop overview: total profit, average margin, COGS coverage, and period-over-period comparison. Lightweight — ideal for dashboard tiles. Same path params and body as the full overview.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
shopId | integer | yes | Shopee shop ID |
region | string | yes | Region code |
Request body — ShopeeShopFinancialOverviewFetchRequest (optional; same as the full overview).
Response — ShopeeShopOverviewSummary
| Field | Type | Description |
|---|---|---|
grossGmv | number | Gross GMV |
totalProfit | number | Total profit |
avgMargin | number | Average margin |
cogsCoverage | object | COGS coverage stats |
comparison | object | Prior-period KPI deltas |
POST/api/shopee/financial-breakdown/shop-overview/{shopId}/{region}/products
The four ranked product lists from the overview (top/worst × profit/margin). Same path params and body as the full overview.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
shopId | integer | yes | Shopee shop ID |
region | string | yes | Region code |
Request body — ShopeeShopFinancialOverviewFetchRequest (optional).
Response — ShopeeShopOverviewProducts
| Field | Type | Description |
|---|---|---|
topProfitProducts | array | Top N by profit |
topMarginProducts | array | Top N by margin |
worstProfitProducts | array | Biggest loss-makers |
worstMarginProducts | array | Thinnest margins |
POST/api/shopee/financial-breakdown/shop-overview/{shopId}/{region}/breakdowns
The cost-breakdown P&L waterfall, costs-only pie, and most-profitable categories. Same path params and body as the full overview.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
shopId | integer | yes | Shopee shop ID |
region | string | yes | Region code |
Request body — ShopeeShopFinancialOverviewFetchRequest (optional).
Response — ShopeeShopOverviewBreakdowns
| Field | Type | Description |
|---|---|---|
costBreakdown | array | Waterfall lines (commission, service fee, transaction fee, COGS, ads, returns, VAT) |
costBreakdownPie | object | Costs-only pie chart data |
categoryBreakdown | array | Top N most profitable categories |
POST/api/shopee/financial-breakdown/shop-overview/{shopId}/{region}/flow
The channel breakdown (organic/ads/affiliate) and the money-flow Sankey showing how gross revenue flows through costs to net profit. Same path params and body as the full overview.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
shopId | integer | yes | Shopee shop ID |
region | string | yes | Region code |
Request body — ShopeeShopFinancialOverviewFetchRequest (optional).
Response — ShopeeShopOverviewFlow
| Field | Type | Description |
|---|---|---|
channelBreakdown | object | Revenue and profit by channel |
sankey | object | Money-flow Sankey diagram |
POST/api/shopee/financial-breakdown/shop-overview/{shopId}/{region}/margin-distribution
The per-product margin box-and-whisker distribution — the spread of profitability across your catalog. Same path params and body as the full overview.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
shopId | integer | yes | Shopee shop ID |
region | string | yes | Region code |
Request body — ShopeeShopFinancialOverviewFetchRequest (optional).
Response — ShopeeShopOverviewDistribution
| Field | Type | Description |
|---|---|---|
marginDistribution | object | Box-and-whisker: min, q1, median, q3, max, outliers |
POST/api/shopee/financial-breakdown/commission-impact-summary/{shopId}/{region}
Estimates the profit impact of an upcoming commission-rate change, broken down by category with the most-affected products. Use when Shopee announces a commission change to assess the financial risk.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
shopId | integer | yes | Shopee shop ID |
region | string | yes | Region code |
Request body
ShopeeCommissionImpactSummaryFetchRequest
| Field | Type | Required | Description |
|---|---|---|---|
effectiveDate | string (date) | yes | Date the new rates take effect |
lookbackDays | integer | no | Sales history to extrapolate (default 180) |
includeVat | boolean | no | Include VAT (default false) |
topN | integer | no | Top affected products per category (default 20) |
Response — ShopeeCommissionImpactSummary
| Field | Type | Description |
|---|---|---|
totalCurrentMonthlyProfit | number | Extrapolated current-month profit (old rates) |
totalFutureMonthlyProfit | number | Extrapolated profit at new rates |
totalMonthlyProfitDelta | number | Monthly profit impact |
affectedProductCount | integer | Products with rate changes |
byCategory | array | Per-category impact with top-affected products |
…and more — see the full schema in the OpenAPI spec.
POST/api/shopee/financial-breakdown/commission-overview/{shopId}/{region}
Summarizes current commission rates and their impact across product categories — commission as a percentage of revenue, with top-commission products. Use to audit current commission exposure.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
shopId | integer | yes | Shopee shop ID |
region | string | yes | Region code |
Request body
ShopeeCommissionOverviewFetchRequest (optional)
| Field | Type | Required | Description |
|---|---|---|---|
lookbackDays | integer | no | Sales history (default 180) |
includeVat | boolean | no | Include VAT (default false) |
topN | integer | no | Top N categories to detail (default 20) |
Response — ShopeeCommissionOverview
| Field | Type | Description |
|---|---|---|
totalMonthlyRevenue | number | Extrapolated monthly revenue |
totalMonthlyCommission | number | Extrapolated monthly commission |
commissionAsPercentOfRevenue | number | Commission as % of revenue |
byCategory | array | Per-category breakdown with current rates |
…and more — see the full schema in the OpenAPI spec.
POST/api/shopee/financial-breakdown/preview-set-margin
Calculates the seller discount and voucher needed to hit a target margin (or fixed profit) on one or more models. A preview only — it does not apply anything. Backs the margin-tool UI.
Request body
ShopeeSetMarginDto
| Field | Type | Required | Description |
|---|---|---|---|
shopId | integer | yes | Shopee shop ID |
region | string | yes | Region code |
models | array | yes | Models to adjust (each: itemId, modelId, originalPrice) |
mode | string | no | PROFIT or MARGIN (default PROFIT) |
targetProfit | number | no | Target profit per unit (mode=PROFIT) |
targetMarginPercent | number | no | Target margin % (mode=MARGIN) |
includeVat | boolean | no | Include VAT (default true) |
effectiveDate | string (date) | no | Override effective date |
Response — ShopeeSetMarginResult
| Field | Type | Description |
|---|---|---|
adjustedItems | array | Per model: computed discount, voucher, simulated breakdown |
unadjustableItems | array | Models that can't hit the target (with reason) |
…and more — see the full schema in the OpenAPI spec.
POST/api/shopee/financial-breakdown/preview-set-buyer-price
Calculates the seller discount and voucher needed to achieve a target final buyer price (what the customer pays after discounts). A preview only. Useful for campaign planning.
Request body
ShopeeSetBuyerPriceDto
| Field | Type | Required | Description |
|---|---|---|---|
shopId | integer | yes | Shopee shop ID |
region | string | yes | Region code |
models | array | yes | Models to adjust (each: itemId, modelId, targetBuyerPrice) |
includeVat | boolean | no | Include VAT (default true) |
effectiveDate | string (date) | no | Override effective date |
Response — ShopeeSetMarginResult — adjustedItems (discount/voucher + resulting margin + simulated breakdown) and unadjustableItems (infeasible targets, with reason).
Lazada — financial breakdown
POST/api/lazada/financial-breakdown/partner/sku-breakdowns/batch-by-sku-ids
Returns per-SKU financial breakdowns for a hand-picked set of SKU IDs — for bulk-pricing tools analyzing profitability across specific variants. Each entry includes commission, payment fees, and any LazCoins deductions.
Request body
LazadaGetSkuBreakdownsBySkuIdsDto
| Field | Type | Required | Description |
|---|---|---|---|
sellerId | integer | yes | Lazada seller ID |
region | string | yes | Region code (e.g. TH) |
skuIds | array | yes | SKU IDs to fetch breakdowns for |
sellerType | string | no | Seller type (default REGULAR) |
hasVat | boolean | no | Include VAT (default true) |
lookbackDays | integer | no | Days back for return-rate signal (default 30) |
effectiveDate | string (date) | no | Effective date for rates |
Response — Array of LazadaSkuBreakdownFlatEntry — SKU id, seller SKU, original price, and a full breakdown (revenue, commission, payment, LazCoins, COGS, VAT, net margin). …and more — see the full schema in the OpenAPI spec.
POST/api/lazada/financial-breakdown/partner/product
Computes the breakdown for one product or SKU. With skuId null, returns the volume-weighted aggregate across all SKUs; with skuId set, the single-variant breakdown. Backs the product profit screen.
Request body
LazadaGetUnitFinancialBreakdownDto
| Field | Type | Required | Description |
|---|---|---|---|
sellerId | integer | yes | Lazada seller ID |
region | string | yes | Region code |
itemId | integer | yes | Lazada item/product ID |
skuId | integer | no | SKU ID for unit-level; null for product-level |
sellerType | string | no | Seller type (default REGULAR) |
hasVat | boolean | no | Include VAT (default true) |
lookbackDays | integer | no | Return-rate lookback (default 30) |
effectiveDate | string (date) | no | Effective date for rates |
Response — LazadaFinancialBreakdownWithMetadata — the line-by-line breakdown (original price, special-price discount, voucher, commission, payment fee, COGS, VAT, return cost, LazCoins, free-shipping commission), metadata (margin, revenue, COGS status), and per-SKU detail when product-level.
POST/api/lazada/financial-breakdown/partner/new-product
Previews the breakdown for a product before listing — supply price, category, and optional COGS without an existing record. Useful during the product-creation wizard.
Request body
LazadaGetNewProductFinancialBreakdownDto
| Field | Type | Required | Description |
|---|---|---|---|
region | string | yes | Region code |
listingPrice | number | yes | Listing price |
categoryId | integer | yes | Lazada category ID |
sellerType | string | no | Seller type (default REGULAR) |
hasVat | boolean | no | Include VAT (default true) |
manufacturingCogs | number | no | Unit manufacturing cost |
effectiveDate | string (date) | no | Effective date for rates |
Response — LazadaFinancialBreakdownWithMetadata — the full breakdown at the proposed price (commission resolved from category, payment fee, VAT, profit margin).
POST/api/lazada/financial-breakdown/partner/required-price
Solves for the listing price needed to achieve a target margin given COGS and any planned discounts, after all fees and VAT.
Request body
LazadaComputeRequiredPriceDto
| Field | Type | Required | Description |
|---|---|---|---|
region | string | yes | Region code |
categoryId | integer | yes | Lazada category ID |
cogs | number | yes | Unit manufacturing cost |
targetMargin | number | yes | Target margin (0–1) |
targetDiscount | number | no | Planned special-price discount (absolute) |
targetDiscountPercent | number | no | Planned discount (0–1) |
sellerType | string | no | Seller type (default REGULAR) |
hasVat | boolean | no | Include VAT (default true) |
effectiveDate | string (date) | no | Effective date for rates |
Response — LazadaRequiredPriceResult — the requiredListingPrice and a full breakdown at that price.
POST/api/lazada/financial-breakdown/partner/simulate
Applies overrides (price, discount, COGS, commission rate, return cost, free-shipping enrollment, LazCoins settings) to the baseline breakdown and recomputes margin and profit. Backs the what-if simulator.
Request body
LazadaProfitImpactSimulationDto — sellerId, region, itemId required; the rest are optional overrides (e.g. skuId, originalPrice, specialPriceDiscount, sellerVoucher, manufacturingCogs, commissionRate, returnCostPerSale, isInFreeShipping, effectiveDate).
Response — LazadaFinancialBreakdownWithMetadata — the recomputed breakdown at the simulated parameters.
POST/api/lazada/financial-breakdown/partner/item/{sellerId}/{region}/{itemId}
Aggregates the breakdown across all SKUs for a product, returning volume-weighted metrics.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
sellerId | integer | yes | Lazada seller ID |
region | string | yes | Region code |
itemId | integer | yes | Product ID |
Request body
LazadaItemFinancialBreakdownFetchRequest (optional)
| Field | Type | Required | Description |
|---|---|---|---|
sellerType | string | no | Seller type (default REGULAR) |
hasVat | boolean | no | Include VAT (default true) |
effectiveDate | string (date) | no | Effective date for rates |
Response — LazadaFinancialBreakdownWithMetadata — the product-level breakdown with volume-weighted fees, margin, and per-SKU detail.
POST/api/lazada/financial-breakdown/partner/products/{sellerId}/{region}
Per-product breakdowns for the whole shop, cursor-paginated; each shows volume-weighted metrics across its SKUs.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
sellerId | integer | yes | Lazada seller ID |
region | string | yes | Region code |
Request body
LazadaProductLevelFinancialBreakdownFetchRequest (optional)
| Field | Type | Required | Description |
|---|---|---|---|
sellerType | string | no | Seller type (default REGULAR) |
hasVat | boolean | no | Include VAT (default true) |
cursorRtProductId | integer | no | Pagination cursor |
pageSize | integer | no | Results per page (default 50) |
effectiveDate | string (date) | no | Effective date for rates |
Response — CursorPaginatedResult<RtLazadaProductCursor, LazadaProductFinancialBreakdownEntry> — product entries (id, name, aggregated breakdown) plus the pagination cursor.
POST/api/lazada/financial-breakdown/partner/sku-breakdowns/all/{sellerId}/{region}
Returns per-SKU breakdowns for every SKU in the shop — a flat list keyed by (itemId, skuId). Intended for offline bulk analysis (not paginated).
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
sellerId | integer | yes | Lazada seller ID |
region | string | yes | Region code |
Request body
LazadaAllSkuBreakdownsFetchRequest (optional) — sellerType, hasVat, effectiveDate.
Response — Array of LazadaSkuBreakdownFlatEntry — every shop SKU with its breakdown, original price, and metadata.
POST/api/lazada/financial-breakdown/partner/profit-adjusted-roas/{sellerId}/{region}/{itemId}
Returns profit-adjusted ROAS with raw ad attribution. Not yet active — pending the Lazada hidden-cost pipeline.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
sellerId | integer | yes | Lazada seller ID |
region | string | yes | Region code |
itemId | integer | yes | Product ID |
Request body
LazadaProductProfitAdjustedRoasFetchRequest (optional) — sellerType, hasVat, lookbackDays (default 180), effectiveDate.
Response — LazadaProductProfitAdjustedRoasSummary — RAW frame (ad attribution, profit per ad order, profit-adjusted ROAS, true GMV) and per-SKU details; cleaned/deflated frames null until the pipeline lands.
POST/api/lazada/financial-breakdown/partner/profit-adjusted-roas-dedup/{sellerId}/{region}/{itemId}
Cancellation-deduped profit-adjusted ROAS (raw/cleaned/deflated frames). Not yet active — pending the Lazada hidden-cost pipeline.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
sellerId | integer | yes | Lazada seller ID |
region | string | yes | Region code |
itemId | integer | yes | Product ID |
Request body
LazadaProductProfitAdjustedRoasFetchRequest (optional) — same fields as above.
Response — LazadaProductProfitAdjustedRoasSummary — RAW, CLEANED, and DEFLATED frames once available (invariant RAW ≥ CLEANED ≥ DEFLATED).
POST/api/lazada/financial-breakdown/partner/corrected-roas/{sellerId}/{region}
Per-item corrected ROAS with ad-cancellation dedup, excluding COGS. Not yet active — pending the Lazada cleaned-ads summary pipeline.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
sellerId | integer | yes | Lazada seller ID |
region | string | yes | Region code |
Request body
LazadaCorrectedRoasFetchRequest
| Field | Type | Required | Description |
|---|---|---|---|
itemIds | array | yes | Item IDs |
lookbackDays | integer | no | Lookback window (default 30) |
Response — Array of LazadaProductAdsCorrectedSummary — per-item ad metrics with dedup applied (empty pending pipeline).
POST/api/lazada/financial-breakdown/partner/products/{sellerId}/{region}/sorted-by-profit
All shop products sorted by true profit (descending), offset-paginated — for spotting top earners and loss-makers.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
sellerId | integer | yes | Lazada seller ID |
region | string | yes | Region code |
Request body
LazadaSortedProductBreakdownFetchRequest (optional)
| Field | Type | Required | Description |
|---|---|---|---|
sellerType | string | no | Seller type (default REGULAR) |
hasVat | boolean | no | Include VAT (default true) |
page | integer | no | 0-based page (default 0) |
pageSize | integer | no | Results per page (default 50) |
effectiveDate | string (date) | no | Effective date for rates |
Response — OffsetPaginatedResult<LazadaProductProfitSortedEntry> — products ranked by profit (id, name, true profit, breakdown) with page metadata.
POST/api/lazada/financial-breakdown/partner/products/{sellerId}/{region}/sorted-by-profit-adjusted-roas
Products ranked by profit-adjusted ROAS (descending). Not yet active — pending the Lazada ROAS pipeline.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
sellerId | integer | yes | Lazada seller ID |
region | string | yes | Region code |
Request body
LazadaSortedProductBreakdownFetchRequest (optional) — same fields as sorted-by-profit.
Response — OffsetPaginatedResult<LazadaProductProfitAdjustedRoasSummary> — products ranked by profit-adjusted ROAS (currently not populated).
POST/api/lazada/financial-breakdown/partner/preview-set-margin
Computes the seller-funded discount/voucher needed to hit a target margin for specified SKUs. A preview only.
Request body
LazadaSetMarginDto
| Field | Type | Required | Description |
|---|---|---|---|
sellerId | integer | yes | Lazada seller ID |
region | string | yes | Region code |
skus | array | yes | SKUs (each: itemId, optional skuId, optional cogs) |
targetMarginPercent | number | yes | Target margin (0–1) |
hasVat | boolean | no | Include VAT (default true) |
effectiveDate | string (date) | no | Effective date for rates |
Response — LazadaSetMarginResult — adjustedItems (required discount + simulated breakdown) and unadjustableItems (with typed reasons like unreachable_margin, sku_not_found).
POST/api/lazada/financial-breakdown/partner/preview-set-buyer-price
Computes the seller-funded discount so the buyer pays exactly a target price — the price-anchored inverse of preview-set-margin.
Request body
LazadaSetBuyerPriceDto
| Field | Type | Required | Description |
|---|---|---|---|
sellerId | integer | yes | Lazada seller ID |
region | string | yes | Region code |
skus | array | yes | SKUs (each: itemId, skuId, targetBuyerPrice, optional cogs) |
hasVat | boolean | no | Include VAT (default true) |
effectiveDate | string (date) | no | Effective date for rates |
Response — LazadaSetMarginResult — adjustable SKUs (discount + simulated breakdown) and unadjustable SKUs with reasons. COGS is optional and affects displayed profit only.
POST/api/lazada/financial-breakdown/partner/shop-overview/{sellerId}/{region}
A shop-wide forward-profit overview: total profit, average margin, cost breakdown, top/worst products, top products by margin, and category breakdown.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
sellerId | integer | yes | Lazada seller ID |
region | string | yes | Region code |
Request body
LazadaShopFinancialOverviewFetchRequest (optional)
| Field | Type | Required | Description |
|---|---|---|---|
from | string (date) | no | Window start date |
to | string (date) | no | Window end date |
lookbackDays | integer | no | Days back from today (default 30) |
topN | integer | no | Top/worst products to return (default 5) |
compareToPrevious | boolean | no | Attach prior-window KPI deltas (default true) |
includeVat | boolean | no | Surface forward VAT position (default false) |
Response — LazadaShopFinancialOverview — total profit, revenue, COGS coverage, cost-breakdown waterfall, top/worst products, category breakdown, margin distribution, prior-period comparison, and optional VAT position.
TikTok — financial breakdown
shopId is sent as an integer in these request bodies. (The shop list endpoint returns it as an opaque string — see List your TikTok shops.)POST/api/tiktok/finance/breakdown/product
Computes the breakdown for one TikTok product or SKU. With skuId null, returns the volume-weighted aggregate across all SKUs; with skuId set, the single-variant breakdown.
Request body
TikTokGetUnitFinancialBreakdownDto
| Field | Type | Required | Description |
|---|---|---|---|
shopId | integer | yes | TikTok shop ID |
productId | string | yes | Product ID |
skuId | string | no | SKU ID for unit-level; null for product-level |
hasVat | boolean | no | Include VAT (default false) |
adsCostPerSale | number | no | Per-unit ads cost (caller-supplied) |
sellerVoucher | number | no | Per-unit seller voucher |
lookbackDays | integer | no | Return-rate lookback (default 30) |
effectiveDate | string (date) | no | Effective date for rates |
Response — TikTokFinancialBreakdownWithMetadata — original price, seller discount, commission, platform fee (CGF), COGS, VAT, return cost, net margin, metadata, and per-SKU detail at product level.
POST/api/tiktok/finance/breakdown/product-level
Returns the volume-weighted aggregated breakdown for a product (always cross-SKU). Mirror of the Shopee/Lazada product-level surface.
Request body
TikTokGetUnitFinancialBreakdownDto — shopId, productId required; skuId is ignored (always cross-SKU). Same optional fields as the product endpoint.
Response — TikTokFinancialBreakdownWithMetadata — aggregated fees, margin, and per-SKU detail breakdown.
POST/api/tiktok/finance/breakdown/skus
Returns per-SKU breakdowns for a hand-picked set of SKU IDs — for bulk-pricing tools.
Request body
TikTokGetSkuBreakdownsBySkuIdsDto
| Field | Type | Required | Description |
|---|---|---|---|
shopId | integer | yes | TikTok shop ID |
skuIds | array | yes | SKU IDs to fetch |
hasVat | boolean | no | Include VAT (default false) |
effectiveDate | string (date) | no | Effective date for rates |
Response — Array of TikTokSkuBreakdownFlatEntry — product id, SKU id, original price, and a full breakdown (commission, CGF fee, COGS, VAT, net margin). …and more — see the full schema in the OpenAPI spec.
POST/api/tiktok/finance/breakdown/new-product
Previews the breakdown for a product before listing — supply price, category path, and optional COGS without an existing record.
Request body
TikTokGetNewProductFinancialBreakdownDto
| Field | Type | Required | Description |
|---|---|---|---|
shopId | integer | yes | TikTok shop ID |
listingPrice | number | yes | Listing price |
categoryL1 | string | yes | L1 category name |
categoryL2 | string | no | L2 category name |
categoryL3 | string | no | L3 category name |
isPreOrder | boolean | no | Pre-order flag (default false) |
isOwnFleetOnly | boolean | no | Own-fleet-only flag (default false) |
hasVat | boolean | no | Include VAT (default false) |
manufacturingCogs | number | no | Unit manufacturing cost |
adsCostPerSale | number | no | Per-unit ads cost |
effectiveDate | string (date) | no | Effective date for rates |
Response — TikTokFinancialBreakdownWithMetadata — the full breakdown at the proposed price (commission resolved from category, CGF fee, VAT, profit margin).
POST/api/tiktok/finance/breakdown/simulate
Applies overrides (price, discount, COGS, flags, ads cost, return cost) to the baseline breakdown and recomputes margin and profit.
Request body
TikTokProfitImpactSimulationDto — shopId, productId required; the rest are optional overrides (skuId, originalPrice, sellerDiscount, sellerVoucher, platformDiscount, manufacturingCogs, adsCostPerSale, returnCostPerSale, flags, effectiveDate).
Response — TikTokFinancialBreakdownWithMetadata — the recomputed breakdown at the simulated parameters.
POST/api/tiktok/finance/breakdown/required-price
Solves for the listing price needed to achieve a target margin given COGS, category, and any planned discounts.
Request body
TikTokComputeRequiredPriceDto
| Field | Type | Required | Description |
|---|---|---|---|
shopId | integer | yes | TikTok shop ID |
categoryL1 | string | yes | L1 category name |
categoryL2 | string | no | L2 category name |
categoryL3 | string | no | L3 category name |
cogs | number | yes | Unit manufacturing cost |
targetMargin | number | yes | Target margin (0–1) |
targetDiscount | number | no | Planned discount (absolute) |
targetDiscountPercent | number | no | Planned discount (0–1) |
hasVat | boolean | no | Include VAT (default false) |
adsCostPerSale | number | no | Per-unit ads cost |
returnRate | number | no | Return rate (e.g. 0.05 = 5%) |
effectiveDate | string (date) | no | Effective date for rates |
Response — TikTokRequiredPriceResult — the requiredListingPrice and a full breakdown at that price.
POST/api/tiktok/finance/breakdown/products
Returns breakdowns for a list of products; each shows volume-weighted metrics across its SKUs. Per-product failures are isolated (one bad productId doesn't abort the rest).
Request body
TikTokGetBatchProductLevelBreakdownDto
| Field | Type | Required | Description |
|---|---|---|---|
shopId | integer | yes | TikTok shop ID |
productIds | array | yes | Product IDs to fetch |
hasVat | boolean | no | Include VAT (default false) |
adsCostPerSale | number | no | Scalar ads-cost fallback |
adsCostByProductId | object | no | Per-product ads-cost override map |
lookbackDays | integer | no | Return-rate lookback (default 30) |
effectiveDate | string (date) | no | Effective date for rates |
Response — Array of TikTokProductFinancialBreakdownEntry (omitting failed lookups) — product id, title, aggregated breakdown.
POST/api/tiktok/finance/breakdown/preview-set-margin
Computes the seller-funded discount needed to hit a target margin for specified SKUs. A preview only. Note: computedSellerVoucher is always 0 (TikTok coupons aren't API-creatable).
Request body
TikTokSetMarginDto
| Field | Type | Required | Description |
|---|---|---|---|
shopId | integer | yes | TikTok shop ID |
skus | array | yes | SKUs (each: productId, skuId, cogs) |
targetMarginPercent | number | yes | Target margin (0–1) |
hasVat | boolean | no | Include VAT (default false) |
adsCostPerSale | number | no | Scalar ads-cost fallback |
adsCostByProductId | object | no | Per-product ads-cost override map |
effectiveDate | string (date) | no | Effective date for rates |
Response — TikTokSetMarginResult — adjustedItems (required discount + simulated breakdown) and unadjustableItems (with typed reasons).
POST/api/tiktok/finance/breakdown/preview-set-buyer-price
Computes the seller-funded discount so the buyer pays exactly a target price — the price-anchored inverse of preview-set-margin.
Request body
TikTokSetBuyerPriceDto
| Field | Type | Required | Description |
|---|---|---|---|
shopId | integer | yes | TikTok shop ID |
skus | array | yes | SKUs (each: productId, skuId, targetBuyerPrice, optional cogs) |
hasVat | boolean | no | Include VAT (default false) |
adsCostPerSale | number | no | Scalar ads-cost fallback |
effectiveDate | string (date) | no | Effective date for rates |
Response — TikTokSetMarginResult — adjustable SKUs (discount + simulated breakdown) and unadjustable SKUs with reasons.
POST/api/tiktok/finance/breakdown/shop-overview/{shopId}/{region}
A shop-wide profit overview computed from settled-statement data: total profit, average margin, cost breakdown, top/worst products, top products by margin, and category breakdown.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
shopId | integer | yes | TikTok shop ID |
region | string | yes | Region code |
Request body
TikTokShopFinancialOverviewFetchRequest (optional)
| Field | Type | Required | Description |
|---|---|---|---|
from | string (date) | no | Window start date |
to | string (date) | no | Window end date |
lookbackDays | integer | no | Days back from today (default 30) |
topN | integer | no | Top/worst products to return (default 5) |
compareToPrevious | boolean | no | Attach prior-window KPI deltas (default true) |
includeVat | boolean | no | Surface forward VAT position (default false) |
Response — TikTokShopFinancialOverview — total profit, revenue, COGS coverage, cost-breakdown waterfall, top/worst products, category breakdown, margin distribution, prior-period comparison, and optional VAT position.