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

# Get Settlement

> Read the settlement record grouping one or more fills

Returns a settlement and the trades it covers. A settlement groups the fills produced by a single match into one on-chain transfer, so several trades commonly share one record.

Only settlements belonging to your instance resolve. Both the public `settlementId` and the internal row ID are accepted.

## Path Parameters

<ParamField path="settlementId" type="string" required>Settlement ID.</ParamField>

## Response Fields

<ResponseField name="data" type="object">
  <Expandable>
    <ResponseField name="id" type="string">Internal row ID.</ResponseField>
    <ResponseField name="settlementId" type="string">Public settlement ID.</ResponseField>
    <ResponseField name="instanceId" type="string">Owning instance.</ResponseField>
    <ResponseField name="status" type="string">`PENDING`, `PROCESSING`, `CONFIRMED` or `FAILED`.</ResponseField>
    <ResponseField name="txHash" type="string">Settlement transaction, or `null`.</ResponseField>
    <ResponseField name="blockNumber" type="integer">Block the transaction landed in, or `null`.</ResponseField>
    <ResponseField name="gasUsed" type="string">Gas consumed, or `null`.</ResponseField>
    <ResponseField name="error" type="string">Why the settlement failed, or `null`.</ResponseField>
    <ResponseField name="settledAt" type="string">ISO 8601 timestamp of confirmation, or `null`.</ResponseField>
    <ResponseField name="createdAt" type="string">ISO 8601 timestamp.</ResponseField>
    <ResponseField name="updatedAt" type="string">ISO 8601 timestamp.</ResponseField>

    <ResponseField name="trades" type="array">
      The trades covered, each with its own `settlementStatus` and `settlementError`.
    </ResponseField>
  </Expandable>
</ResponseField>

<Note>
  The per-trade status is the one to act on. A settlement can be `FAILED` while individual trades read `CONFIRMED`, or the reverse, when a batch was partly retried.
</Note>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.trusset.org/orderbooks/commodities/api/settlements/clx_settle_92" \
    -H "X-API-Key: trusset_your_key_here"
  ```

  ```typescript TypeScript theme={null}
  const res = await fetch(
    `https://api.trusset.org/orderbooks/commodities/api/settlements/${settlementId}`,
    { headers: { 'X-API-Key': 'trusset_your_key_here' } }
  );
  const { data } = await res.json();
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": {
      "id": "clx_settle_92",
      "settlementId": "e17a2c04-8b5f-4d31-9760-2ca8d3f01b95",
      "instanceId": "inst_abc123",
      "status": "CONFIRMED",
      "txHash": "0x9f2c41d8b7e05a3164c2870fbd935e1a4c7802db6135ea9048f7c21b5d3ea41b",
      "blockNumber": 6412922,
      "gasUsed": "173044",
      "error": null,
      "settledAt": "2025-06-15T12:02:35.000Z",
      "createdAt": "2025-06-15T12:02:00.000Z",
      "updatedAt": "2025-06-15T12:02:35.000Z",
      "trades": [
        {
          "tradeId": "b40e7c12-3a86-4d95-8f01-6e2c9a5d7031",
          "price": "2410000000",
          "quantity": "2000000",
          "settlementStatus": "CONFIRMED",
          "settlementError": null
        }
      ]
    }
  }
  ```
</ResponseExample>

## Error Codes

| Code                   | HTTP  | Cause                                               |
| ---------------------- | ----- | --------------------------------------------------- |
| `SETTLEMENT_NOT_FOUND` | `404` | No settlement with that ID on your instance         |
| `SERVICE_NOT_ENABLED`  | `403` | The Trading service is not enabled on this instance |
