Skip to main content
GET
/
accounts
/
api
/
products
/
{productId}
/
{variantId}
/
cost
Get the resolved cost for a variant
curl --request GET \
  --url https://api.upstackdata.com/accounts/api/products/{productId}/{variantId}/cost \
  --header 'x-api-key: <api-key>' \
  --header 'x-pixel-id: <api-key>'
{
  "productCost": {
    "effectiveCost": 123,
    "handlingFee": 123,
    "currency": "<string>",
    "activeCogLine": {
      "id": "<string>",
      "cost": 123,
      "effectiveStartDate": "<string>",
      "effectiveEndDate": "<string>",
      "description": "<string>"
    }
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.upstackdata.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-api-key
string
header
required

Your Upstack API key. Starts with upstack_.

x-pixel-id
string
header
required

The pixel id the request targets.

Path Parameters

productId
string
required
variantId
string
required

Response

The resolved cost breakdown.

productCost
object
required

The resolved cost breakdown for a single variant at the current moment. effectiveCost is what the COGS recalculation flow uses; source tells you whether it came from a per-variant COG line, the global override, or the default fallback.