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

# List Order Intents

> List a user's order intents, read the amount that each one has left, and reuse one for a new payment

One order intent can pay several times, until the agent spends the amount or the order intent expires. List the user's order intents to show the limits that they approved, or to find one that covers a new payment, so that you do not ask the user to approve again.

## Prerequisites

* **Approved order intent** — follow [Approve an Order Intent](/agents/payment-methods/cards/create-agent-card).
* **Crossmint API key** — a client-side key with the `order-intents.read` scope. In staging, all scopes are included by default.
* **User JWT** — use the JWT for the user who owns the order intents.

## List the User's Order Intents

Send a `GET` request. The response is an array with every order intent of the authenticated user:

```typescript theme={null}
const CROSSMINT_CLIENT_API_KEY = "YOUR_CROSSMINT_CLIENT_API_KEY";
const jwt = "YOUR_USER_JWT";

const response = await fetch("https://staging.crossmint.com/api/unstable/order-intents", {
    headers: {
        "X-API-KEY": CROSSMINT_CLIENT_API_KEY,
        Authorization: `Bearer ${jwt}`,
    },
});

if (!response.ok) {
    throw new Error(`Order intent listing failed (${response.status})`);
}

const orderIntents = await response.json();
```

Each order intent has a `status` (`active`, `cancelled`, or `expired`), its `rails`, and its live `amount`:

```json theme={null}
"amount": {
    "total": "150.00",
    "spent": "42.10",
    "reserved": "0.00",
    "available": "107.90",
    "currency": "USD"
}
```

`available` is the amount that the agent can still spend. Each credential takes its amount from it.

## Reuse an Order Intent

An order intent covers a new payment when all of these are true:

* `status` is `active`, and `expiresAt` is in the future.
* The currency is the currency of the payment.
* `amount.available` is at least the payment amount.
* The order intent has no `merchant`, or the same merchant as the payment.

```typescript theme={null}
// Uses orderIntents from the list step.
const payment = { value: "42.50", currency: "USD", merchantUrl: "https://acme.example.com" };

const reusable = orderIntents.find(
    (orderIntent) =>
        orderIntent.status === "active" &&
        new Date(orderIntent.expiresAt) > new Date() &&
        orderIntent.amount.currency === payment.currency &&
        Number(orderIntent.amount.available) >= Number(payment.value) &&
        (orderIntent.merchant == null || orderIntent.merchant.url === payment.merchantUrl)
);
```

Before you use it, check that one of its rails can pay. See [Pay for a Checkout](/agents/checkouts/payments#pay-with-an-order-intent) with Agent Checkouts, or [Get a Card Number](/agents/payment-methods/cards/retrieve-agent-card) with your own checkout. When no order intent covers the payment, [create a new one](/agents/payment-methods/cards/create-agent-card).

## Refresh One Order Intent

To read one order intent again, for example after a payment, send `GET /api/unstable/order-intents/{orderIntentId}`. It returns the same fields as an item of the list. See [Get Order Intent](/api-reference/agentic-commerce/order-intents/get-order-intent).

## Next Steps

<CardGroup cols={3}>
  <Card title="Pay for a Checkout" icon="credit-card" href="/agents/checkouts/payments">
    Pay with the order intent in an agent checkout
  </Card>

  <Card title="Cancel Card Access" icon="ban" href="/agents/payment-methods/cards/remove-cards">
    Cancel an order intent that the user no longer wants
  </Card>

  <Card title="List Order Intents" icon="brackets-curly" href="/api-reference/agentic-commerce/order-intents/list-order-intents">
    Review the complete response schema
  </Card>
</CardGroup>
