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

# Status and monitoring

> Track intent status through to settlement: GetIntent, GetIntentReceipt, WaitIntentReceipt, SearchIntents, and GetIntentHistory.

Use these endpoints to track the state of an intent after execution and to query historical payment data.

For authentication and base URL, see the [API overview](/cross-chain/api-reference/overview).

***

## GetIntent

Retrieve the current status and full details of an intent.

**Endpoint**: `POST /GetIntent`

### Request parameters

| Field | Type | Required | Description |
| - | - | - | - |
| `intentId` | string | Yes | The intent ID to look up |

### Response fields

| Field | Description |
| - | - |
| `intent` | The full intent object including current `status` |
| `intent.status` | One of `QUOTED`, `COMMITTED`, `EXECUTING`, `SUCCEEDED`, or `FAILED` |

### Example

```typescript theme={null}
const { intent } = await trails.getIntent({ intentId });

console.log("Status:", intent.status);
```

***

## GetIntentReceipt

Get the transaction hashes and settlement status for a completed intent. Use this to confirm that funds arrived at the destination.

**Endpoint**: `POST /GetIntentReceipt`

### Request parameters

| Field | Type | Required | Description |
| - | - | - | - |
| `intentId` | string | Yes | The intent ID to retrieve the receipt for |

### Response fields

| Field | Description |
| - | - |
| `status` | `SUCCEEDED` or `FAILED` |
| `transactionHash` | Transaction hash on the destination network |
| `originTransactionHash` | Transaction hash on the source network |

### Example

```typescript theme={null}
const receipt = await trails.getIntentReceipt({ intentId });

if (receipt.status === "SUCCEEDED") {
  console.log("Settled on destination:", receipt.transactionHash);
  console.log("Source transaction:", receipt.originTransactionHash);
}
```

***

## WaitIntentReceipt

Long-poll until an intent reaches a terminal state (`SUCCEEDED` or `FAILED`). The API holds the connection open and responds as soon as the intent settles.

**Endpoint**: `POST /WaitIntentReceipt`

### Request parameters

| Field | Type | Required | Description |
| - | - | - | - |
| `intentId` | string | Yes | The intent ID to wait on |

### Response fields

| Field | Description |
| - | - |
| `intentReceipt` | The receipt object, same structure as `GetIntentReceipt` |
| `done` | `true` when a terminal state has been reached |

Use `WaitIntentReceipt` when you want to block until settlement, for example in a server-side payout flow where the next step depends on confirmed settlement. Use `GetIntentReceipt` polling when you need to check status periodically without holding a connection open.

### Example

```typescript theme={null}
const { intentReceipt, done } = await trails.waitIntentReceipt({ intentId });

if (done && intentReceipt.status === "SUCCEEDED") {
  // Funds have settled; continue with your post-settlement logic
  console.log("Settlement confirmed:", intentReceipt.transactionHash);
}
```

***

## SearchIntents

Find intents by owner address or transaction hash. Useful for looking up an intent when you have the source transaction hash but not the intent ID.

**Endpoint**: `POST /SearchIntents`

### Request parameters

| Field | Type | Required | Description |
| - | - | - | - |
| `ownerAddress` | string | No | Filter by the customer's wallet address |
| `transactionHash` | string | No | Filter by a source or destination transaction hash |
| `page` | number | No | Page number for pagination; starts at 1 |
| `pageSize` | number | No | Number of results per page |

At least one of `ownerAddress` or `transactionHash` is required.

### Response fields

| Field | Description |
| - | - |
| `intents` | Array of intent objects matching the query |

### Example

```typescript theme={null}
const { intents } = await trails.searchIntents({
  ownerAddress: "0xCUSTOMER_ADDRESS",
  page: 1,
  pageSize: 20,
});

intents.forEach((intent) => {
  console.log(intent.intentId, intent.status);
});
```

***

## GetIntentHistory

Retrieve paginated intent history with receipts for a given address. Returns settled and in-progress intents together with their receipt data where available.

**Endpoint**: `POST /GetIntentHistory`

### Request parameters

| Field | Type | Required | Description |
| - | - | - | - |
| `ownerAddress` | string | Yes | The customer's wallet address |
| `page` | number | No | Page number; starts at 1 |
| `pageSize` | number | No | Number of results per page |

### Example

```typescript theme={null}
const history = await trails.getIntentHistory({
  ownerAddress: "0xCUSTOMER_ADDRESS",
  page: 1,
  pageSize: 50,
});

history.intents.forEach((entry) => {
  console.log(entry.intent.intentId, entry.intent.status, entry.receipt?.transactionHash);
});
```
