> ## Documentation Index
> Fetch the complete documentation index at: https://neverminedag-docs-2999-payg-settle-success-criterion.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Payments

> The three Nevermined payment types (Catalog, Embedded Web Flow, Merchant Plans), and the card enrollment and delegation model that lets agents pay with Visa, Stripe, or Braintree.

Nevermined has three payment types: three ways money reaches a merchant. Pick the type first, because it decides who the buyer is, what they pay with, and how much you integrate. The rest of this page covers the card mechanics that agent payments run on.

## Three payment types

<img src="https://mintcdn.com/neverminedag-docs-2999-payg-settle-success-criterion/z2twwudoZcUt4oBa/images/payments/three-ways-to-get-paid.png?fit=max&auto=format&n=z2twwudoZcUt4oBa&q=85&s=1845c4f3141e2cd1139c4a32e03956c7" alt="Three ways to get paid on Nevermined: the Catalog (agents pay per call in stablecoin), the Embedded Web Flow (people pay by card on your site), and Merchant Plans (agents buy credits/time/PAYG) — all settling to the merchant, minus a small Nevermined fee." width="4480" height="2000" data-path="images/payments/three-ways-to-get-paid.png" />

<CardGroup cols={3}>
  <Card title="Catalog" icon="store" href="/products/catalog/overview">
    AI agents discover your listed service and pay per call in stablecoin over x402 + mpp. You enroll nothing.
  </Card>

  <Card title="Embedded Web Flow" icon="cart-shopping" href="/integrate/patterns/orders">
    A person pays any cart total by card through a checkout embedded on your site. No plan, no buyer account, no delegation.
  </Card>

  <Card title="Merchant Plans" icon="layer-group" href="/solutions/agent-to-agent-monetization#merchant-plans">
    AI agents buy credits, time, or pay-as-you-go access to your service at a fixed price, paying by card or stablecoin.
  </Card>
</CardGroup>

|                       | Catalog                                          | Embedded Web Flow        | Merchant Plans          |
| --------------------- | ------------------------------------------------ | ------------------------ | ----------------------- |
| **Who pays**          | An AI agent or harness                           | A person, in a browser   | An AI agent or harness  |
| **Pay with**          | Stablecoin                                       | Card (fiat)              | Card or stablecoin      |
| **Pricing**           | Dynamic — quoted per request                     | Dynamic — any cart total | Fixed — set per plan    |
| **Merchant enrolls?** | No — Nevermined discovers and lists your service | Yes — you control an Org | Yes — you integrate NVM |

The full comparison (rails, plans, buyer accounts, who integrates what) is on [Monetize Your AI](/solutions/agent-to-agent-monetization#three-ways-to-get-paid).

## Card payments for agents

Everything below is the mechanism behind **card-paid agent payments**, which is how a Merchant Plan gets paid by card. Enroll a Visa, Stripe, or Braintree card. Create a delegation that caps how much can be spent. Your agents charge it directly via x402 — no checkout pages, no human in the loop.

<Note>
  **Three payment types and three card networks are different things.** Catalog, Embedded Web Flow, and Merchant Plans are *what you sell and who buys*. Visa, Stripe, and Braintree are *card networks*: the providers an enrolled card and its delegation settle through. Delegations apply to Merchant Plans paid by card. The Embedded Web Flow settles through the same PSPs, but the buyer confirms each charge in the browser, so there is no enrollment and no delegation. Catalog payments are stablecoin and never touch a card.
</Note>

Manage everything at [nevermined.app](https://nevermined.app).

<CardGroup cols={3}>
  <Card title="Card Enrollment" icon="credit-card" href="/products/payments/card-enrollment">
    Enroll Visa, Stripe, or Braintree cards
  </Card>

  <Card title="Delegations" icon="shield-check" href="/products/payments/mandates">
    Set spending limits and expiration
  </Card>

  <Card title="Delegation Selection" icon="route" href="/products/payments/mandate-selection">
    Auto-resolve which card to charge
  </Card>
</CardGroup>

## How It Works

<Steps>
  <Step title="Enroll a card">
    Add a Visa, Stripe, or Braintree card at [nevermined.app](https://nevermined.app). Card data is tokenized in the browser by the provider's PCI-compliant capture (VGS Collect for Visa and Stripe, Braintree Drop-in for Braintree). Nevermined never stores raw card numbers.
  </Step>

  <Step title="Create a delegation">
    Set the spending limit, duration, and (optionally) max transactions. Visa delegations also require a per-delegation passkey approval that binds the limits to your device. Optionally link the delegation to a specific API key for automatic routing.
  </Step>

  <Step title="Agents charge it">
    Agents call the Nevermined API with their API key. Nevermined resolves the right delegation and generates an x402 token. The resource server verifies, executes, and settles.
  </Step>
</Steps>

## Payment Flow

```
Agent (no token)
  |
  |-> Resource Server returns 402 + payment-required header
  |
  |-> Agent calls Nevermined: POST /api/v1/x402/permissions
  |     |-> Resolves delegation -> generates x402 token (scheme: nvm:card-delegation)
  |
  |-> Agent retries with payment-signature header
  |
  |-> Resource Server:
        |-> POST /verify -> validates token, delegation, usage
        |-> Executes workload
        |-> POST /settle -> charges card, returns payment-response
```

## One delegation model, three card networks

All three providers share the same `nvm:card-delegation` x402 scheme and the same `POST /api/v1/delegation/create` endpoint. The `network` field on the delegation (`stripe`, `braintree`, or `visa`) is set by the card you choose and routes settlement to the right PSP.

<CardGroup cols={3}>
  <Card title="Visa" icon="cc-visa">
    PAN tokenized by VGS Credential Management Platform (CMP) into a Visa Agentic Token. Each delegation requires a one-time WebAuthn/passkey device-binding ceremony enforced by Visa VTS. Settlement runs through Stripe Connect against the seller's connected account.
  </Card>

  <Card title="Stripe" icon="stripe">
    Card captured via VGS Collect and confirmed against a Stripe SetupIntent. No passkey. Settlement runs through Stripe PaymentIntents directly.
  </Card>

  <Card title="Braintree" icon="paypal">
    Card captured via Braintree Drop-in, exchanged for a vaulted `paymentMethodToken`. Settlement runs through `transaction.sale` against the seller's per-currency OAuth-connected Braintree merchant account.
  </Card>
</CardGroup>

<Note>
  The Visa Agentic Tokens flow replaces the earlier VTS/VIC + mandate endpoints. There is no longer a separate "mandate" object — a Visa delegation is just a `nvm:card-delegation` record with `provider: 'visa'`.
</Note>

## Key Concepts

| Concept                | Description                                                                                                                                                                            |
| ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Delegation**         | A scoped spending authorization on an enrolled card. Defines the spending limit, max transactions, and expiration. Same concept across Visa, Stripe, and Braintree.                    |
| **Visa Agentic Token** | The CMP-issued identifier (`vat_…`) that replaces the real PAN. Stored as the delegation's `providerPaymentMethodId` for Visa cards.                                                   |
| **Device binding**     | A per-delegation WebAuthn/passkey ceremony required by Visa VTS. Produces a single-use `assuranceData` blob bound to the spending limit, duration, and merchant context. Browser-only. |
| **Spending Ceiling**   | Per-card cumulative limit across all active delegations (default \$10.00).                                                                                                             |
| **API Key Linking**    | Link a delegation to a specific API key so agents automatically use the right one.                                                                                                     |
| **x402 Token**         | Payment token used in the `payment-signature` HTTP header (`nvm:card-delegation` scheme).                                                                                              |

## SDK consumption

The TypeScript and Python SDKs treat all three networks identically. Pass the `delegationId` to `DelegationConfig` and the SDK auto-resolves the scheme + network from the plan and the delegation record:

<Tabs>
  <Tab title="TypeScript">
    ```typescript theme={null}
    import { Payments } from '@nevermined-io/payments'

    const payments = Payments.getInstance({
      nvmApiKey: process.env.NVM_API_KEY,
      environment: 'sandbox',
    })

    // Works the same for Stripe, Braintree, and Visa delegations.
    const token = await payments.x402.getX402AccessToken(
      'plan_abc123',
      undefined, // agentId — pass when the plan has multiple agents
      {
        delegationConfig: {
          delegationId: 'deleg-8f14e45f-ce34-4797-b88e-968374b0d4b6',
        },
      },
    )
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    import os
    from payments_py import Payments
    from payments_py.x402 import DelegationConfig, X402TokenOptions

    payments = Payments(
        api_key=os.environ.get("NVM_API_KEY"),
        environment="sandbox",
    )

    # Works the same for Stripe, Braintree, and Visa delegations.
    token = payments.x402.get_x402_access_token(
        plan_id="plan_abc123",
        token_options=X402TokenOptions(
            delegation_config=DelegationConfig(
                delegation_id="deleg-8f14e45f-ce34-4797-b88e-968374b0d4b6",
            ),
        ),
    )
    ```
  </Tab>
</Tabs>

<Warning>
  For Visa, `delegationId` reuse is the **only** SDK path. `createDelegation` with `provider='visa'` cannot run from a non-browser context — the backend rejects it without `consumerPrompt` + `assuranceData`, both of which require the WebAuthn ceremony embedded by Visa VTS in the webapp. The SDK rejection surfaces as `PaymentsError.code = 'BCK.VISA.0014'`.
</Warning>

## Environments

* **Sandbox** — Testing and development. Visa runs against VGS sandbox + VTS test PANs; Stripe in test mode; Braintree on sandbox merchants.
* **Live** — Production. Real payments through Visa, Stripe, and Braintree.

<Note>
  You need an [NVM API Key](/agents-guide/get-api-key). Set it as `NVM_API_KEY`.
</Note>

## What's Next?

<CardGroup cols={2}>
  <Card title="Enroll a Card" icon="plus" href="/products/payments/card-enrollment">
    Set up your first payment card
  </Card>

  <Card title="Create a Delegation" icon="shield-check" href="/products/payments/mandates">
    Define spending limits, usage caps, and expiration
  </Card>

  <Card title="Compare the three payment types" icon="table" href="/solutions/agent-to-agent-monetization#three-ways-to-get-paid">
    Catalog, Embedded Web Flow, and Merchant Plans side by side
  </Card>

  <Card title="Orders: Goods & Services Checkout" icon="cart-shopping" href="/integrate/patterns/orders">
    The Embedded Web Flow contract, and its current availability
  </Card>
</CardGroup>
