> ## 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.

# Register a Card

> Register a saved card and discover the order-intent rails it supports

Register a saved card once before creating order intents against it. Registration provisions every supported rail, such as Visa Intelligent Commerce or Mastercard Agent Pay. It does not grant spending permission and does not prompt the user for verification.

## Prerequisites

* **Saved card** — follow [Save a Card](/agents/payment-methods/cards/save-card) and keep its `paymentMethodId`.
* **Crossmint API key** — a client-side key with the `payment-methods.create`, `payment-methods.read`, and `payment-methods.update` scopes. The `update` scope lets the user re-enter the card security code (CVC) later, when a card credential needs it. In staging, all scopes are included by default.
* **User JWT** — use the JWT for the user who owns the saved card.

## Register the Card

Send an idempotent `PUT` request with the consumer information used by card-network rails:

```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}/order-intent-registration`,
    {
        method: "PUT",
        headers: {
            "Content-Type": "application/json",
            "X-API-KEY": CROSSMINT_CLIENT_API_KEY,
            Authorization: `Bearer ${jwt}`,
        },
        body: JSON.stringify({
            email: "buyer@example.com",
            countryCode: "US",
            languageCode: "en-US",
        }),
    }
);

if (!response.ok) {
    throw new Error(`Card registration failed (${response.status})`);
}

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

The response reports one or more supported rails independently:

```json theme={null}
{
    "paymentMethodId": "pm_123",
    "rails": [
        {
            "rail": "agentic-token",
            "provider": "vic",
            "status": "enabled"
        }
    ]
}
```

Read the complete `rails` array instead of branching on the card brand or assuming there is only one result. Visa cards can report `provider: "vic"`, and Mastercard cards can report `provider: "agentpay"`.

| Status | Meaning |
| - | - |
| `enabled` | The rail can back a new order intent |
| `pending` | Rail provisioning has not finished |
| `error` | Provisioning failed; read `error.code` |

More than one rail can be available. Registration provisions those rails, but it does not choose between them or require every rail to succeed. Use `GET /api/unstable/payment-methods/{paymentMethodId}/order-intent-registration` to read the registration again.

A card with no `enabled` rail, including one whose `rails` array is empty, can still back an order intent. In that case the order intent's `rails` array includes an `encrypted-card` rail that returns the saved card encrypted to your public key; in production, encrypted card access must be enabled for your project. See [Encrypted Card Fallback](/agents/payment-methods/cards/create-agent-card#encrypted-card-fallback).

Registration is separate from allowance verification: no email code, passkey, or spending approval occurs in this step. You choose which rail to use after creating an order intent.

## Test the Rails

In staging, the saved card number selects a deterministic registration and verification scenario, such as a rejected rail or a failed verification. See [Test Agent Cards](/agents/payment-methods/cards/test-agent-cards) for the test cards.

## Next Steps

<CardGroup cols={2}>
  <Card title="Create an Agent Card" icon="credit-card" href="/agents/payment-methods/cards/create-agent-card">
    Create an order intent backed by one of the card's rails
  </Card>

  <Card title="Cards Quickstart" icon="rocket" href="/agents/cards-quickstart">
    Run the complete flow in the reference app
  </Card>
</CardGroup>
