Get profit and loss broken down by market and contract
Returns a workspace's profit and loss split by selling marketplace and by contract. The market split is realized only; the contract split pairs each contract's realized profit with the buy cost of the items it still holds.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://loading/contracts.v1.Contracts/GetPnLBreakdown" \ -H "Content-Type: application/json" \ -d '{ "startTime": "2026-01-01T00:00:00Z", "endTime": "2026-06-30T23:59:59Z" }'{
"byMarket": [
{
"marketplace": "csfloat",
"sellRevenueCents": "1320000",
"realizedPnlCents": "205000",
"itemsSold": "198"
},
{
"marketplace": "unknown",
"sellRevenueCents": "160000",
"realizedPnlCents": "25000",
"itemsSold": "19"
}
],
"byContract": [
{
"contractId": "EBESExQVFhcYGRobHB0eHw==",
"realizedPnlCents": "150000",
"unrealizedCostCents": "220000",
"itemsSold": "120",
"itemsInInventory": "40"
},
{
"contractId": "ICEiIyQlJicoKSorLC0uLw==",
"realizedPnlCents": "80000",
"unrealizedCostCents": "200000",
"itemsSold": "97",
"itemsInInventory": "55"
}
]
}{
"code": "invalid_argument",
"message": "The request was malformed, such as a missing required field or an unparseable cursor."
}{
"code": "unauthenticated",
"message": "The request lacks a valid API key in the Authorization header."
}{
"code": "permission_denied",
"message": "The API key is not allowed to perform this action on this workspace."
}{
"code": "resource_exhausted",
"message": "The request was rate limited. Slow down and retry later."
}{
"code": "internal",
"message": "An internal server error occurred."
}ListWorkspaceIntentRollup
Returns the workspace's own rolled-up buying or selling intents, one row per item and float window with the workspace's best price and the number of its contracts contributing. Only the caller's own rows are returned.
GetPnLPeriods
Returns a workspace's profit and loss bucketed into day, week, or month periods across a time range, for plotting trends. Optionally scoped to a single contract.