Skip to main content
An order intent gives an agent a limited amount to spend before a fixed expiration. The agent can pay several times with one order intent, until it spends the amount or the order intent expires. Each payment gets a new credential. One order intent can have several rails, and each rail has its own status, credential formats, and verification.

Prerequisites

  • Registered card — register a saved card. A card with an enabled rail unlocks card-network credentials; a card without one can still use the encrypted card fallback described below.
  • Encrypted card access (only for your own checkout) — with Agent Checkouts, you do not need it. To get the encrypted card in your own checkout in production, contact us for access. Staging projects have it.
  • Crossmint API key — a client-side key with order-intents.create and order-intents.read scopes. In staging, all scopes are included by default.
  • User JWT — use the JWT for the user who owns the saved card.

Create the Order Intent

Create an order intent with the saved card, spending limit, description, expiration, and merchant. Include the merchant now when you already know where the agent will spend:
The response separates the order intent’s lifecycle from the status of each rail:
Setting merchant when creating the order intent is preferred when you know it. The merchant is fixed for the lifetime of that order intent, and credential requests inherit the restriction. If the agent will choose a merchant later, omit merchant. This creates an open order intent, and every credential request must supply the merchant instead. The top-level status is active while the allowance exists. A specific rail can still require verification. Treat rails as a set of independent ways to spend the same allowance:
  1. Choose the rail that provides the credential you need.
  2. If that rail is pending_verification, verify it.
  3. Once it is active, mint with the same rail and provider values.
You do not need every rail to be active. Other rails can remain pending_verification or error without blocking the selected rail. For example, when an allowance contains both VIC and SPT, minting a VIC credential only requires the VIC rail to be verified; you do not need to complete an SPT step. The card network rails are Visa Intelligent Commerce and Mastercard Agent Pay. The same selection rule applies to every rail.

Encrypted Card Fallback

Every active order intent has an encrypted-card rail in rails, beside its card network rails. The rail is listed even when a card network rail is active, so its presence does not mean that the card network rails failed. A card network rail in error stays in the array, with its error. Select the entry whose rail is encrypted-card; do not assume its position or a one-element array:
The encrypted-card rail has no provider, and it never needs verification. Skip the OrderIntentVerification step for it. When the card has no enabled rail at creation, rails has only the encrypted-card entry. This happens when the card networks refused the card, when its rails are still pending, or when its rails array is empty. See Register a Card. Such an order intent keeps only the encrypted-card rail: it does not get a card network rail when the card’s rail becomes enabled later. To use that rail, create a new order intent.
  • With Agent Checkouts, the encrypted card works with no setup. The card stays inside the Crossmint vault. See Use With Agent Checkouts.
  • With your own checkout, your app gets the user’s real card, encrypted to your RSA public key. In production, this needs encrypted card access for your project (contact us). Without it, the rail is still in rails, but a request to mint it fails with project:addon.required. See Get a Card Number.
When the order intent also has an active card network rail, prefer it: the card network enforces the limit, and the real card number is never exposed. See Card Rails and PCI Compliance.

Verify the Selected Rail

When the rail you want to use has status: "pending_verification", render OrderIntentVerification in your client application. Do not start verification merely because an unrelated rail is pending.
After verification completes, fetch the order intent again and wait for the selected rail to report status: "active". You do not need to wait for the other rails. Card registration never prompts for verification. Verification belongs to an individual order-intent rail. The first Visa verification on a device can create a passkey; later order intents authenticate with the existing passkey when the device remains bound. The component also handles the Mastercard-hosted flow.

Verify in a Mobile App

A WebView does not keep Mastercard passkeys, so the buyer creates a new one on every purchase. If your app shows the component in a WebView, pass openRedirect and open the Mastercard page in ASWebAuthenticationSession or Chrome Custom Tabs. The promise resolves when the buyer closes the browser, and rejects when the browser cannot open:
page.tsx
VerifyScreen.tsx
The /verify page renders VerifyInApp with the order intent you created above. Keep preferEphemeralSession set to false, and let the buyer close the browser: closing it from onVerificationComplete can skip the passkey step. CrossmintAgentCardAuthorization takes the same prop. Test passkey reuse in production: the staging Mastercard page is a mock without a passkey prompt. For the complete request and response schemas, see the Create Order Intent API Reference.

Use With Agent Checkouts

When a checkout asks for payment, create the order intent for the amount and merchant of the payment request, and send its ID. See Pay for a Checkout. Agent Checkouts can use the encrypted-card rail without encrypted card access. The access protects the card number from your systems. Inside an agent checkout, the card never leaves the Crossmint vault: the checkout enters it at the merchant, and your app handles only the orderIntentId. Your own reads of the order intent list the rail, and the checkout uses it while the saved card’s CVC is available. If the checkout answers rail_unavailable, ask for the CVC again.

Common Gotchas

Read rails[].status before minting. The top-level status describes the order intent’s lifetime, not whether every rail is ready.
Register the card once, then verify only the order-intent rail you plan to use when it returns pending_verification. Do not repeat card registration to authorize a new allowance.
Card networks enforce amount and merchant only for agentic-token rails. When your agent spends with an encrypted card, keep the purchase within the order intent’s limits yourself and cancel the order intent when it is no longer needed.
Set expiresAt to a future ISO 8601 timestamp that matches the permission you present to the user.
Include merchant when creating the order intent if you already know it. Otherwise, omit it and supply a merchant with every credential request.

Next Steps

Pay for a Checkout

Pay with the order intent in an agent checkout

Get a Card Number

Get a credential for your own checkout

Create an Order Intent

Review the complete create request schema