AI agents are becoming increasingly sophisticated at understanding tasks and making decisions, but they face barriers when trying to execute real-world commerce transactions. Traditional payment systems require human interaction, CAPTCHAs, and complex authentication flows that agents cannot navigate.

Crossmint’s Agentic Commerce solution provides the infrastructure for AI agents to participate in the real economy, all through simple API calls.

Start Testing Today

To get started, you will need:

  1. A Crossmint project created in Crossmint Console’s staging environment
  2. A server-side API key obtained from the Overview page
  3. Save the API key for later

1. Create a Wallet

First, create a dedicated wallet that will hold funds for your agent to perform transactions. This wallet is created via the Crossmint’s Create Wallets API.

curl --request POST \
    --url https://staging.crossmint.com/api/2022-06-09/wallets \
    --header 'Content-Type: application/json' \
    --header 'X-API-KEY: <x-api-key>' \
    --data '{
        "type": "evm-smart-wallet",
        "config": {
            "adminSigner": {
                "type": "evm-fireblocks-custodial"
            }
        }
    }'

Funds are stored with enterprise-grade security while maintaining programmatic access.

If you already have a wallet for your agent with funds in it, you can jump to step 3.

2. Fund the Agent

Users can now fund the agent through Crossmint’s Embedded Checkout. Simply enter a credit or debit card and the intended amount.

<CrossmintEmbeddedCheckout
    recipient={{
        // Agent's wallet address created above
        walletAddress: "0x...",
    }}
    lineItems={[
        {
            tokenLocator:
                "ethereum-sepolia:0xe9fFA6956BFfC367B26dD3c256CF0C978603Eaec:0xe9fFA6956BFfC367B26dD3c256CF0C978603Eaec",
            executionParameters: {
                mode: "exact-in",
                // The amount the user wants to fund the wallet with
                amount: "1",
                maxSlippageBps: "0",
            },
        },
    ]}
    payment={{
        // The user's email
        receiptEmail: "j.doe@gmail.com",
        crypto: {
            enabled: false,
        },
        fiat: {
            enabled: true,
        },
        defaultMethod: "fiat",
    }}
/>

The 0xe9fFA6956BFfC367B26dD3c256CF0C978603Eaec token address represents the credits your agent will hold in its wallet and can use to purchase items from supported marketplaces.

3. Purchase Items

With available funds in its wallet, the agent can now call Crossmint’s Create Orders API to purchase items from Amazon, Shopify, and other supported marketplaces.

// API Route: POST https://staging.crossmint.com/api/2022-06-09/orders

const orderData = {
    recipient: {
        email: "j.doe@gmail.com",
        physicalAddress: {
            name: "John Doe",
            line1: "ABC Street",
            city: "New York",
            state: "NY",
            postalCode: "10007",
            country: "US",
        },
    },
    payment: {
        method: "ethereum-sepolia",
        currency: "credit",
        // Agent's wallet address created above
        payerAddress: "0x...",
    },
    lineItems: [{ productLocator: "amazon:https://www.amazon.com/Celsius-Sparkling-Berry-Fluid-Ounce/dp/B001PN0HOU" }],
};

The agent can purchase items from multiple marketplaces by specifying different productLocator values:

  • Amazon: amazon:<Amazon product URL>
  • Shopify: shopify:<Shopify product URL>:<variantId>

While a single order can include multiple products as part of the lineItems array, note that all items in an order must be from the same platform (either all Amazon or all Shopify).

4. Submit Transaction

The agent completes payment by passing the serializedTransaction from the previous step’s response to Crossmint’s Create Transaction API

POST /api/2022-06-09/wallets/${agentWallet}/transactions

{
  "params": {
    "calls": [{
      // Obtained from the previous step response
      "transaction": "0x...."
    }],
    "chain": "ethereum-sepolia"
  }
}

This completes the purchase flow, with the agent successfully buying items on behalf of the user using the funds provided to it.

Visa Partnership and Tokenized Cards

Crossmint has partnered with Visa to enable agentic commerce

While the above flow demonstrates a complete end-to-end agentic commerce flow, Crossmint is developing enhanced payment capabilities through an official partnership with Visa.

Tokenized Card Collection

We’re creating a new SDK that will collect Visa tokens directly from an app’s UI. This client-side SDK will provide a “tokenized card ID” - a PCI-compliant way to identify payment methods for users without handling sensitive card data.

Extended Payment Methods

Crossmint’s Create Order API will be extended to accept tokenized card IDs as payment methods, allowing agents to use a user’s card directly with the merchant, just in time.

// Example request body (this is still a WIP)
payment: {
  method: "tokenized-card",
  tokenizedCardId: "tok_1234567890abcdef",
  currency: "usd"
}

If you are interested in integrating our new SDK and the tokenized card solution, contact us.