@nevermined-io/payments
    Preparing search index...

    Interface DelegationConfig

    Configuration for delegation-based payments (both crypto and card schemes).

    The supported flow is create-first: create a delegation with DelegationAPI.createDelegation, then request the access token with delegationConfig: { delegationId }.

    The inline create-on-the-fly fields (providerPaymentMethodId, spendingLimitCents, durationSecs, currency, merchantAccountId, maxTransactions, cardId) are individually deprecated. Calling X402TokenAPI.getX402AccessToken with a delegationConfig that lacks delegationId but carries one of those fields emits a runtime deprecation warning; create the delegation first and pass only delegationId (optionally apiKeyId) here. The interface itself is NOT deprecated — the { delegationId } reuse path is the supported way to configure a token request.

    interface DelegationConfig {
        apiKeyId?: string;
        cardId?: string;
        currency?: DelegationCurrency;
        delegationId?: string;
        durationSecs?: number;
        maxTransactions?: number;
        merchantAccountId?: string;
        planId?: string;
        providerPaymentMethodId?: string;
        spendingLimitCents?: number;
    }
    Index

    Properties

    apiKeyId?: string

    NVM API Key ID to scope the delegation to. Active (non-deprecated).

    cardId?: string

    PaymentMethod entity UUID — references an enrolled card.

    Inline create-on-the-fly. Create the delegation first and pass delegationId.

    Currency code (e.g., 'usd' for card providers, 'usdc' for erc4337).

    Inline create-on-the-fly. Create the delegation first and pass delegationId.

    delegationId?: string

    Existing delegation UUID to reuse instead of creating a new one. The supported (non-deprecated) path.

    durationSecs?: number

    Duration of the delegation in seconds. Required only for new delegations.

    Inline create-on-the-fly. Create the delegation first and pass delegationId.

    maxTransactions?: number

    Maximum number of transactions allowed.

    Inline create-on-the-fly. Create the delegation first and pass delegationId.

    merchantAccountId?: string

    Merchant account ID (Stripe Connect acct_xxx or Braintree merchantId).

    Inline create-on-the-fly. Create the delegation first and pass delegationId.

    planId?: string

    Plan ID to scope a newly-created delegation to. Optional and additive: delegations are plan-agnostic by default; supplying planId opts into a plan-bound delegation. (Visa delegations are always plan-specific and require it server-side.)

    Inline create-on-the-fly. Create the delegation first and pass delegationId.

    providerPaymentMethodId?: string

    Stripe payment method ID (e.g., 'pm_...'). Required only for new delegations.

    Inline create-on-the-fly. Create the delegation first and pass delegationId.

    spendingLimitCents?: number

    Maximum spending limit in cents. Required only for new delegations.

    Inline create-on-the-fly. Create the delegation first and pass delegationId.