> ## Documentation Index
> Fetch the complete documentation index at: https://crossmint-devin-1787949784-wallet-docs-two-concept-model.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel Card Access

> Cancel an order intent or delete a saved card

Cancel an order intent to stop minting credentials from that allowance. Delete a saved card when the user no longer wants it stored in Crossmint.

## Prerequisites

* **Crossmint API key** — a client-side key with `order-intents.revoke` or `payment-methods.delete`, depending on the operation. In staging, all scopes are included by default.
* **User JWT** — use the JWT for the user who owns the resource.

## Cancel an Order Intent

Send a `DELETE` request with the `orderIntentId`:

```typescript theme={null}
const CROSSMINT_CLIENT_API_KEY = "YOUR_CROSSMINT_CLIENT_API_KEY";
const jwt = "YOUR_USER_JWT";
const orderIntentId = "a1b2c3d4-e5f6-4890-abcd-ef1234567890";

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

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

A successful cancellation returns `204 No Content`. Subsequent reads return `status: "cancelled"`, and no additional credentials can be minted from its rails. Create a new order intent when you need a replacement allowance.

## Delete a Saved Card

Send a `DELETE` request with the `paymentMethodId`:

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

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

if (!response.ok) {
    throw new Error(`Payment method deletion failed (${response.status})`);
}
```

Deleting the saved card prevents new order intents from being created against it. Existing order intents remain independent resources, so cancel them explicitly when access must end immediately.

## Next Steps

<CardGroup cols={2}>
  <Card title="Create an Agent Card" icon="credit-card" href="/agents/payment-methods/cards/create-agent-card">
    Create a replacement order intent
  </Card>

  <Card title="Order Intent API" icon="code" href="/api-reference/agentic-commerce/order-intents/get-order-intent">
    Inspect order-intent status and balances
  </Card>
</CardGroup>
