> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Transaction cogs

> Transaction cogs

### Request body

`TransactionCogsRequest`

<ParamField body="from" type="string" required />

<ParamField body="lines" type="CogsLineRequest[]" required />

<ParamField body="to" type="string" required />

### Responses

<ResponseField name="200" type="TransactionCogsResponse" />

<ResponseField name="400" type="ErrorBody" />

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.stateset.com/api/v1/reports/transaction-cogs' \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "from": "string",
    "lines": [
      {
        "cost": "string",
        "product_id": null,
        "quantity": "string",
        "revenue": "string",
        "sku": "string",
        "transaction_date": "string"
      }
    ],
    "to": "string"
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "from": "string",
    "gross_margin": "string",
    "gross_margin_pct": "string",
    "rows": [
      {
        "cogs": "string",
        "gross_margin": "string",
        "quantity": "string",
        "revenue": "string",
        "sku": "string"
      }
    ],
    "to": "string",
    "total_cogs": "string",
    "total_revenue": "string"
  }
  ```
</ResponseExample>
