# Get settlements

URL: https://docs.hanzo.ai/docs/openapi/x402/get-x402-settlements-by-id

> Reads one x402 payment receipt by id.

`GET /v1/x402/settlements/{id}`

> [x402 →](https://docs.hanzo.ai/docs/openapi/x402) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                                 |
| ------------- | ----------------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/x402/settlements/{id}` |
| **Method**    | `GET`                                           |
| **Operation** | `get_x402_settlements_by_id`                    |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`          |

Reads one x402 payment receipt by id.

It is scoped to the caller's PAYER org — the ledger that was debited — so one
tenant can never read another's settlement, and an id that exists but belongs
to somebody else is a 404 exactly like one that does not exist. A caller with
no billable identity is refused outright.

## Request

1 field.

| Field | In   | Type   | Required | Description                                                                                                                                                                                                                                                 |
| ----- | ---- | ------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`  | path | string | yes      | ID is the settlement id from the URL — the deterministic keccak(from\|nonce) key an x402 receipt is issued under (the `id` field of a Receipt, and the `transaction` of the SettlementResponse on the PAYMENT-RESPONSE header a paid request answers with). |

## Response

| Status    | Body            | Meaning |
| --------- | --------------- | ------- |
| `200`     | x402.Receipt    | ok      |
| `default` | problem-details | refused |

`200` body — 13 fields.

| Field        | In   | Type            | Always | Description                                                                                                                                                                       |
| ------------ | ---- | --------------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `amount`     | body | string          | —      | Amount is what actually moved, as an exact 18-decimal-place USD string.                                                                                                           |
| `category`   | body | string          | —      | Category is what the payment was for — service, goods, transfer or royalty — as the price table said it: a tool call is a service, a job is what its parties agreed.              |
| `from`       | body | string          | —      | From is the payer's EVM address: the account that signed the EIP-3009 authorization, recovered from the signature rather than taken on trust.                                     |
| `id`         | body | string          | —      | ID is the settle-once key: "x402\_" + keccak(from\|nonce) in hex.                                                                                                                 |
| `network`    | body | string          | —      | Network is the CAIP-2 identifier the payment was settled under, e.g. "eip155:36963".                                                                                              |
| `nonce`      | body | string          | —      | Nonce is the client-chosen nonce from the authorization, hex — up to 32 bytes, left-padded to the contract's bytes32.                                                             |
| `payee`      | body | string          | —      | Payee is the recipient's EVM address — the `payTo` the challenge advertised and the authorization named.                                                                          |
| `payeeOrg`   | body | string          | —      | PayeeOrg is the tenant that owns the recipient wallet, resolved at settlement.                                                                                                    |
| `payer`      | body | string          | —      | Payer is the payer ORG — the tenant whose ledger was debited — and not an address.                                                                                                |
| `resource`   | body | string          | —      | Resource is what was paid for, in the same spelling the price table and the challenge used: the request path for a priced route, "tool:\<id>" for a priced tool.                  |
| `settledAt`  | body | integer (int64) | —      | SettledAt is when this settlement was CLAIMED, in unix seconds — the moment the authorization was accepted, which is also the moment the time window it carried stopped applying. |
| `settledVia` | body | string          | —      | SettledVia is which rail moved the money: "ledger", the live default, or "chain" when the authorization is broadcast.                                                             |
| `txHash`     | body | string          | —      | TxHash is the chain transaction hash, present only for a "chain" settlement.                                                                                                      |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo x402 settlements get <id>
```

**SDK**

**.ts**

```ts
import { Configuration, X402Api } from 'hanzoai';

const api = new X402Api(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getX402SettlementsById({ id: 'id' });
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import X402Api

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = X402Api(client).get_x402_settlements_by_id(id='id')
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.X402API.GetX402SettlementsById(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, x402_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = x402_api::get_x402_settlements_by_id(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.X402Api;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new X402Api(client).getX402SettlementsById();
```

**HTTP**

```bash
curl https://api.hanzo.ai/v1/x402/settlements/<id> \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

MCP reaches **x402** through the `x402` tool, which names its 2 operations with its own verbs — this one among them, under a name only MCP declares. `describe` explains any of them:

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_x402_settlements"
         }
       }
     }'
```

---

[x402 API](https://docs.hanzo.ai/docs/openapi/x402) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
