Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.nevermined.app/llms.txt

Use this file to discover all available pages before exploring further.

What Are Delegations?

A delegation is a scoped spending authorization tied to an enrolled payment card. It defines the boundaries of what an agent can charge: the maximum amount over the delegation’s lifetime, how many transactions are allowed, and when the authorization expires. Think of it as a controlled allowance: you’re giving an agent permission to spend within strict limits, rather than handing over your card.
The Visa Agentic Tokens rollout retired the previous separate “Visa mandate” object. Visa is now one of three networks (stripe, braintree, visa) on the unified nvm:card-delegation scheme, with a single create endpoint and a single record shape. Visa delegations differ only in that they require a per-delegation device-binding ceremony at create time.

Delegation Properties

All three networks share the same core fields:
FieldDescription
providerstripe, braintree, visa, or erc4337
providerPaymentMethodIdPSP-side token: Stripe pm_…, Braintree paymentMethodToken, or Visa Agentic Token vat_…
spendingLimitCentsMaximum total amount the delegation can charge over its lifetime, in cents
durationSecsHow long the delegation is valid for, in seconds from creation
maxTransactionsOptional cap on the number of charges. Omit the field to allow unlimited transactions.
currencyISO 4217 lowercase (usd, eur, …)
planIdOptional plan binding. Required for Visa (Trusted Agent Protocol).
merchantAccountIdPSP-side merchant routing. Stripe Connected Account ID, Braintree per-currency merchantAccountId, or seller’s Stripe Connect account for Visa settlement.
apiKeyIdOptional NVM API key link for automatic selection
consumerPromptVisa-only: human-readable approval text shown during device binding
assuranceDataVisa-only: opaque blob produced by the WebAuthn ceremony

Creating a Delegation

Via the Nevermined Pay Dashboard

After enrolling a card, create a delegation from the Nevermined Pay dashboard:
  1. Navigate to your enrolled card
  2. Click Create Delegation
  3. Set the spending limit (in dollars / euros)
  4. Set the duration (e.g. 7 days)
  5. Optionally set a max-transactions cap
  6. Optionally link an NVM API key
  7. Confirm to create

Via the API

All providers use the same endpoint and DTO. The Visa branch adds two required fields (consumerPrompt, assuranceData) and requires a planId.
POST /api/v1/delegation/create
Authorization: Bearer <NVM_API_KEY>
Content-Type: application/json
{
  "provider": "stripe",
  "providerPaymentMethodId": "pm_1Abc2Def3Ghi4Jkl",
  "spendingLimitCents": 10000,
  "durationSecs": 604800,
  "maxTransactions": 100,
  "currency": "usd",
  "apiKeyId": "sk-abc123"
}
Response includes a delegationId and delegationToken (the signed JWT) for the new authorization.

Spending Controls

All delegations enforce multiple layers of spending control:

Lifetime Spending Limit

spendingLimitCents caps the cumulative amount charged over the delegation’s lifetime, not per-transaction. Once amountSpentCents >= spendingLimitCents, the delegation transitions to Exhausted.

Usage Limits

maxTransactions caps the total number of charges. Once reached, the delegation is Exhausted regardless of remaining budget.

Time-Based Expiration

After createdAt + durationSecs, the delegation transitions to Expired regardless of remaining budget or usage.

Card Spending Ceiling

Each card has a cumulative spending ceiling (default $10.00). The sum of spendingLimitCents across all active delegations on a card can’t exceed this ceiling. Example:
Card CeilingDelegation ADelegation BRemaining
$10.00$5.00$3.00$2.00
If you try to create a third delegation for 3.00,itwillberejectedbecauseonly3.00, it will be rejected because only 2.00 of ceiling remains.

Updating a Delegation

Delegations are not updated in place. To change the limit, duration, or any other parameter, revoke the existing one and create a new one. For Visa, this requires a fresh device-binding ceremony.
# 1. Revoke existing delegation
DELETE /api/v1/delegation/{delegationId}

# 2. Create new delegation with updated params
POST /api/v1/delegation/create
Revoking and recreating a delegation means any unspent budget from the old delegation does not carry over.

Cancelling a Delegation

DELETE /api/v1/delegation/{delegationId}
Authorization: Bearer <NVM_API_KEY>
No additional authentication is required beyond your API credentials. Revocation is immediate: in-flight verify/settle calls against the delegation fail with DELEGATION_INACTIVE.

Status Lifecycle

Active -> Exhausted (spending limit or transaction count reached)
  |
  |-> Expired (past createdAt + durationSecs)
  |
  |-> Revoked (manually removed via DELETE)
Only Active delegations can be used for payments. NVM Pay checks status, usage, and expiration on every verify and settle request. Each delegation tracks amountSpentCents, remainingBudgetCents, and transactionCount.

API Key Linking

You can optionally link a delegation to a specific NVM API key. This tells NVM Pay “when this API key is used, charge this delegation.” This is especially useful when you have multiple active delegations and want deterministic routing. Instead of the agent guessing which one to use, the API key determines it automatically. All three networks support API key linking through the same apiKeyId field. See Delegation Selection for the full resolution algorithm.

Transaction History

Every settled charge is recorded as a transaction:
FieldDescription
amountTransaction amount
currencyCurrency code
statuscompleted or failed
providerTransactionIdPSP charge identifier (Stripe pi_…, Braintree transaction id, Stripe Connect pi_… for Visa settlement)
failureReasonError details (if failed)
createdAtWhen the transaction occurred
GET /api/v1/delegation/{delegationId}/transactions?offset=0

Network Comparison

VisaStripeBraintree
Create endpointPOST /api/v1/delegation/create (provider: 'visa')POST /api/v1/delegation/create (provider: 'stripe')POST /api/v1/delegation/create (provider: 'braintree')
Per-delegation authWebAuthn/passkey device binding (browser-only)API credentials onlyAPI credentials only
Required extrasconsumerPrompt, assuranceData, planIdmerchantAccountId matching currency
CancelDELETE /api/v1/delegation/{id}DELETE /api/v1/delegation/{id}DELETE /api/v1/delegation/{id}
SettlementStripe Connect against seller’s connected accountStripe PaymentIntentsBraintree transaction.sale against vaulted token

What’s Next?

If you have multiple delegations, learn how NVM Pay decides which one to use for a given payment request.

Delegation Selection

How NVM Pay resolves which delegation to charge