Skip to main content
POST
Create a spending delegation and return a signed JWT token

Authorizations

Authorization
string
header
required

Your Nevermined API Key (starts with 'nvm:'). Get one at nevermined.app under Account → API keys.

Body

application/json
provider
enum<string>
required

Payment rail for this delegation. stripe, visa, and erc4337 select that rail directly. vgs is a portable, plan-agnostic card delegation whose settlement processor (Stripe or Braintree) is chosen when a payment is made, based on the plan being paid — so one enrolled card can pay across processors. vgs requires a portable providerPaymentMethodId (the CRD… cardId, which must carry an active network token); for vgs, planId is optional and only restricts the delegation to a single plan.

Available options:
stripe,
erc4337,
visa,
vgs
Example:

"stripe"

spendingLimitCents
number
required

Maximum spending limit in cents (smallest currency unit)

Example:

10000

durationSecs
number
required

Duration of the delegation in seconds

Example:

604800

currency
enum<string>
required

Currency code (lowercase). A card delegation charges in this currency and nothing converts it, so it can only pay plans priced in the same currency; a card delegation created with planId set in another currency than that plan is refused (BCK.DELEGATION.0011).

Available options:
usd,
eur,
usdc,
eurc
Example:

"usd"

agentId
string

Buyer-supplied agent identifier for attribution only; does not grant access or change credential restrictions.

label
string

Buyer-chosen agent name shown in delegations and payment history.

providerPaymentMethodId
string

Payment-method identifier from the provider. For stripe this is the saved card; for vgs this is the CRD… canonical cardId from the unified VGS-Collect enroll; for visa this is the card’s CRD… cardId (the card must list visa in its rails on GET /payment-methods) or the VGS agentic-token id returned by enrollment. A visa delegation created from the CRD… is stored under the card’s agentic token, so delegation reads return that token id as its providerPaymentMethodId, not the CRD… sent; the visa entry of GET /payment-methods whose id is that token carries the card’s cardId. Required for these providers; ignored for erc4337.

Example:

"pm_1Abc2Def3Ghi4Jkl"

consumerPrompt
string

Visa-only: human-readable approval prompt shown to the user during VGS Agentic Auth device binding. Required when provider=visa.

Example:

"Allow up to USD 50.00 over 5 transactions"

assuranceData
object

Visa-only: opaque assurance payload from the VGS Agentic Auth browser SDK after FIDO/OTP device binding. Required when provider=visa.

planId
string

Restrict this delegation to a single plan. Optional and plan-agnostic by default for every provider, including vgs and visa card delegations (whose merchant is resolved at payment time from the plan being paid).

Example:

"123456789"

maxTransactions
number

Maximum number of transactions allowed (null = unlimited)

Example:

50

apiKeyId
string

Optional API Key ID (skId) to restrict this delegation to

Example:

"sk-abc123"

allowedRecipients
string[]

erc4337 / Router only: restrict spend to these pay-to addresses — the Router rejects payments to any other recipient. Omit for no recipient restriction.

Example:
allowSessionPayments
boolean

erc4337 / Router only: whether this delegation may pay services that sell over an MPP session, which lock a refundable deposit from the wallet at the first call. Defaults to true. Set false to refuse them: a service that also offers a per-call charge over Tempo is paid that way regardless, and a call that has nothing else to pay is refused (409 BCK.ROUTER.0047). A delegation cannot be edited, so this is fixed at creation.

Example:

false

organizationWalletId
string

erc4337 / Router only: fund this delegation from an organization wallet instead of the caller's own wallet. The caller must be an admin of the wallet's organization, and spending is always capped by the member's group budget (the wallet must be shared with that group).

Example:

"orw-abc123"

Response

The created delegation

delegationId
string
required
Example:

"a1b2c3d4-e5f6-7890-abcd-ef1234567890"

delegationToken
string | null

Signed JWT for fiat-backed delegations (stripe/visa/vgs). Omitted for crypto (erc4337) flows where the signed delegation is held client-side.

Example:

"eyJhbGciOiJIUzI1NiIsInR..."