Skip to main content
Mint a credential for a specific amount and merchant from an order intent. Choose one rail from the order-intent response and use that same rail for verification and credential minting. The request and response shape depend on the rail:

Prerequisites

  • Verified order intent — follow Create an Agent Card and wait for a rail with status: "active".
  • Crossmint API key — a client-side key with order-intents.read and order-intents.credentials scopes. In staging, all scopes are included by default.
  • User JWT — use the JWT for the user who owns the order intent.

Mint a Card-Network Credential

Find the agentic-token rail you want to use and confirm that it is active and supports card credentials. Other rails can remain pending. Send the selected rail’s rail and provider values back in the request. This example continues from the merchant-scoped order intent created in the previous guide, so the credential request does not repeat the merchant:

Open Order Intents

If orderIntent.merchant is absent, include a merchant in every credential request:
The response returns the selected rail and the credential value. An inactive status on another rail does not affect this request:
Treat the credential as a secret. Use it immediately, never log it, and do not persist it for later reuse. Minting deducts the requested amount from the order intent even if the credential is never used. For the complete schema, see the Create Order Intent Credential API Reference.

Mint an Encrypted Card

When the order intent’s rails array contains an encrypted-card entry, the response cannot contain a network-issued one-time card. Instead, the user’s saved card is encrypted inside the PCI-compliant vault to a public key that you control, and Crossmint returns the ciphertext. Only the holder of the matching private key can read the card.

Generate a Key Pair

Generate an RSA key pair of at least 2048 bits for the RSA-OAEP-256 algorithm. Keep the private key wherever the agent will decrypt the card; only the public key is sent to Crossmint.

Request the Encrypted Card

Send the public key as a JWK with only the kty, n, and e members. The encrypted-card rail has no provider, and the request takes no amount or merchant:
The response contains the encrypted card as a compact JWE string:

Decrypt the Card

The JWE uses RSA-OAEP-256 for key encryption and A256GCM for content encryption. Decrypt it with your private key using a JOSE library. The plaintext is a JSON object with the same fields as a card-network credential:
The decrypted value is the user’s real card, not a one-time number. Treat it with the same care as raw cardholder data: decrypt it only where the payment is made, never log or persist it, and discard the private key when the purchase completes. Crossmint does not deduct from the order intent balance for encrypted-card credentials, and the card network does not enforce the allowance, so your agent must keep purchases within the order intent’s amount and merchant.

Encrypted Card Errors

A malformed request, such as a publicKey whose kty is not RSA or whose encoded n is shorter than 342 base64url characters, fails schema validation before the vault is called and returns a 400 without an order-intent error code. Other unusable RSA keys can reach the vault and return ORDER_INTENT_INVALID_PUBLIC_KEY.

List Order Intents

List every order intent owned by the authenticated user:
Each item includes its live balance and rails. Use GET /api/unstable/order-intents/{orderIntentId} when you only need to refresh one order intent.

Common Gotchas

Use the same currency as the order intent and keep the requested value at or below amount.available.
Do not retry a credential request blindly. Each successful mint is a new credential and consumes the requested amount.
Complete allowance verification for the rail you selected and fetch the order intent again before minting. You do not need to verify unrelated rails.
If the order intent was created without merchant, include one in every credential request. If the merchant was set at creation, omit it when minting. This applies only to agentic-token rails; the encrypted-card request takes no merchant.
Do not send provider, amount, or merchant with rail: "encrypted-card". Send only credential.format and credential.publicKey. Requests with unknown fields are rejected.

Next Steps

Cancel Card Access

Cancel an order intent or delete a saved card

Cards Quickstart

Run the complete flow in the reference app