curl --silent --show-error --fail-with-body --request POST \
--url 'https://api.stateset.com/api/v1/reports/transaction-cogs' \
--header "Authorization: Bearer $STATESET_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"from": "2026-08-01",
"to": "2026-08-31",
"lines": [
{
"sku": "MUG-001",
"quantity": "2",
"revenue": "25.00",
"cost": "10.00",
"transaction_date": "2026-08-15"
}
]
}'
{
"from": "string",
"gross_margin": "string",
"gross_margin_pct": "string",
"rows": [
{
"cogs": "string",
"gross_margin": "string",
"quantity": "2",
"revenue": "49.00",
"sku": "SKU-TENT-2P-GRN"
}
],
"to": "string",
"total_cogs": "string",
"total_revenue": "49.00"
}
Calculate transaction cost of goods
Calculate transaction cost of goods
POST
/
api
/
v1
/
reports
/
transaction-cogs
curl --silent --show-error --fail-with-body --request POST \
--url 'https://api.stateset.com/api/v1/reports/transaction-cogs' \
--header "Authorization: Bearer $STATESET_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"from": "2026-08-01",
"to": "2026-08-31",
"lines": [
{
"sku": "MUG-001",
"quantity": "2",
"revenue": "25.00",
"cost": "10.00",
"transaction_date": "2026-08-15"
}
]
}'
{
"from": "string",
"gross_margin": "string",
"gross_margin_pct": "string",
"rows": [
{
"cogs": "string",
"gross_margin": "string",
"quantity": "2",
"revenue": "49.00",
"sku": "SKU-TENT-2P-GRN"
}
],
"to": "string",
"total_cogs": "string",
"total_revenue": "49.00"
}
Confirm your deployment before running this request. This page describes an API contract;
a published reference does not establish hosted availability. Check the dated
host report and obtain your deployment URL and credentials.
Replace the example host if your provisioned service uses a different URL.
Request body
TransactionCogsRequest
string
required
CogsLineRequest[]
required
string
required
Response
TransactionCogsResponse
string
required
string
required
string
required
CogsRowResponse[]
required
string
required
string
required
string
required
Status codes
| Code | Meaning |
|---|---|
200 | — |
400 | — |
Using this contract
Read the source OpenAPI document for declared schemas and alternatives. This page also includes documented corrections from the spec overlays. Example IDs and values are illustrative; replace them with records from your workspace.curl --silent --show-error --fail-with-body --request POST \
--url 'https://api.stateset.com/api/v1/reports/transaction-cogs' \
--header "Authorization: Bearer $STATESET_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"from": "2026-08-01",
"to": "2026-08-31",
"lines": [
{
"sku": "MUG-001",
"quantity": "2",
"revenue": "25.00",
"cost": "10.00",
"transaction_date": "2026-08-15"
}
]
}'
{
"from": "string",
"gross_margin": "string",
"gross_margin_pct": "string",
"rows": [
{
"cogs": "string",
"gross_margin": "string",
"quantity": "2",
"revenue": "49.00",
"sku": "SKU-TENT-2P-GRN"
}
],
"to": "string",
"total_cogs": "string",
"total_revenue": "49.00"
}
Last modified on September 21, 2026