Delegation
Create a spending delegation and return a signed JWT token
Creates a spending delegation for the authenticated user against a previously enrolled payment method. For fiat-backed delegations (stripe/braintree/visa) the response includes a signed JWT (delegationToken); for crypto (erc4337) flows the token is held client-side and omitted. Requires a Nevermined API key.
post/delegation/create
Request
- Base URL: https://api.sandbox.nevermined.app/api/v1
- URL: https://api.sandbox.nevermined.app/api/v1/delegation/create
- Auth: HTTP bearer
Request body
Example request
{
"provider": "stripe",
"providerPaymentMethodId": "pm_1Abc2Def3Ghi4Jkl",
"consumerPrompt": "Allow up to USD 50.00 over 5 transactions",
"spendingLimitCents": 10000,
"durationSecs": 604800,
"currency": "usd",
"planId": "123456789",
"maxTransactions": 50,
"apiKeyId": "sk-abc123",
"allowedRecipients": [
"0x209693Bc6afc0C5328bA36FaF03C514EF312287C"
],
"organizationWalletId": "orw-abc123"
}Response
The created delegation
Example response
{
"delegationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"delegationToken": "eyJhbGciOiJIUzI1NiIsInR..."
}Changes
No recorded changes to this operation across all 1 revision of this API.