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

# Transaction

> The Transaction type links orders to sustainability metrics for Scope 3 reporting.

## Transaction type

```graphql theme={null}
type Transaction {
  id: ID!
  orderId: ID!
  order: Order!
  customerId: ID!
  totalCarbonFootprint: Float!
  offsetStatus: OffsetStatus!
  scope: EmissionScope!
  reportingPeriod: String!
  auditTrail: [AuditEntry!]!
  createdAt: DateTime!
}

type AuditEntry {
  timestamp: DateTime!
  action: String!
  actor: String!
  inputHash: String
  resultHash: String
  methodology: String
}

enum EmissionScope {
  SCOPE_1
  SCOPE_2
  SCOPE_3
}
```

## Fields

| Field                  | Type            | Description                                 |
| ---------------------- | --------------- | ------------------------------------------- |
| `id`                   | ID!             | Unique transaction identifier               |
| `orderId`              | ID!             | Linked order                                |
| `customerId`           | ID!             | Customer who initiated the transaction      |
| `totalCarbonFootprint` | Float!          | Total carbon footprint in kg CO2e           |
| `offsetStatus`         | OffsetStatus!   | Offset status                               |
| `scope`                | EmissionScope!  | Emission scope classification               |
| `reportingPeriod`      | String!         | Period for CSRD reporting (e.g., "2025-Q3") |
| `auditTrail`           | \[AuditEntry!]! | Immutable log of all actions                |

## Example query

```graphql theme={null}
query {
  transactions(
    filter: {
      scope: SCOPE_3
      reportingPeriod: "2025-Q3"
    }
    first: 50
  ) {
    totalCount
    edges {
      node {
        id
        orderId
        totalCarbonFootprint
        offsetStatus
        scope
        auditTrail {
          timestamp
          action
          methodology
        }
      }
    }
  }
}
```
