# Read an invoice as structured JSON (for agents)

> GET /v0/checkout/{invoiceId}/invoice.json. What an agent needs to decide and pay: the merchant, the amount, what the merchant settles in, the expiry and status, and the x402 URL with a summary of what it accepts. Public by invoice ID, like the hosted page; never returns the settlement address or the


`GET /v0/checkout/{invoiceId}/invoice.json`

What an agent needs to decide and pay: the merchant, the amount, what the merchant settles in, the expiry and status, and the x402 URL with a summary of what it accepts. Public by invoice ID, like the hosted page; never returns the settlement address or the net.

## Authentication

The invoice's client secret, in the `x-client-secret` header. It reaches this one invoice's public endpoints and nothing else, and expires with the invoice.

## Parameters

| Parameter | In | Required | Notes |
|---|---|---|---|
| `invoiceId` | path | yes |  |

## Responses

| Status | Means |
|---|---|
| `200` | The invoice |


## Request



```bash title="curl"
curl https://api.intents.fi/v0/checkout/inv_3QkR7mVt9zLpXdB2hJn6Yw/invoice.json \
  -H 'x-client-secret: $CLIENT_SECRET'
```

```ts title="TypeScript"
const response = await fetch("https://api.intents.fi/v0/checkout/inv_3QkR7mVt9zLpXdB2hJn6Yw/invoice.json", {
  method: "GET",
  headers: {
    "x-client-secret": clientSecret,
  },
});

if (!response.ok) {
  const { error } = await response.json();
  throw new Error(`${error.code}: ${error.message}`);
}
const data = await response.json();
```

```python title="Python"
import httpx

response = httpx.get(
    "https://api.intents.fi/v0/checkout/inv_3QkR7mVt9zLpXdB2hJn6Yw/invoice.json",
    headers={"x-client-secret": client_secret},
)
response.raise_for_status()
data = response.json()
```



## Errors

```json
{ "error": { "code": "INVOICE_EXPIRED", "message": "This invoice has expired" } }
```

Switch on `code`, not on the message: every code has a page under [Error codes](/docs/errors/). Base URL `https://api.intents.fi`; the whole reference is on [one page](/docs/api).

---

Source: https://intents.fi/docs/api/get-checkout-invoiceid-invoice-json · The whole corpus: https://intents.fi/docs/llms-full.txt
