Overview
The "Nevermined Payments" node integrates with the Nevermined platform to manage AI-related payments, subscriptions, and access control. Specifically, the Redeem Credits operation allows users to redeem a specified number of credits from a given plan. This is useful in scenarios where an application or service tracks usage via credit plans and needs to deduct credits as users consume resources or services.
Practical examples include:
- Deducting API call credits when a user makes a request.
- Redeeming subscription credits for accessing premium AI features.
- Validating and recording credit redemptions with optional proof data such as transaction hashes or verification codes.
Properties
| Name | Meaning |
|---|---|
| Plan ID | The unique identifier of the credits plan from which credits will be redeemed. |
| Amount | The number of credits to redeem. Must be a positive whole number and not exceed available credits. |
| Proof | Optional JSON object containing proof or verification data for the redemption (e.g., transaction hash, verification code, timestamp). |
Output
The output JSON contains detailed information about the redemption attempt:
redemptionId: Unique ID for this redemption event.status:"completed"if successful,"failed"otherwise.timestamp: When the redemption was processed.planId: The plan from which credits were redeemed.redemption: Details including requested amount, redeemed amount, previous and new balance, and whether proof was provided and verified.transaction: Simulated blockchain transaction details such as transaction hash, block number, confirmations, network, gas used, and status.- On success (
status === "completed"):success: Message confirming redemption, remaining credits, daily and monthly redemption counts.analytics: Aggregated stats like total credits redeemed, average redemption size, frequency, and last redemption date.
- On failure (
status === "failed"):error: Error code and message explaining why redemption failed (e.g., insufficient credits or invalid plan), available credits, and suggested actions.
- If proof data was provided:
proofValidation: Contains the provided proof, validation method (blockchain or verification code), validation status, and timestamp.
environment: Indicates the environment ("production" or "test").message: Human-readable summary of the result.
The node does not output binary data.
Dependencies
- Requires an API key credential for authenticating with the Nevermined Payments API.
- Uses environment configuration to determine API base URLs (production or test).
- No other external dependencies are required within n8n.
Troubleshooting
No API Key provided!
Ensure that the API key credential is configured correctly in n8n before running the node.Plan ID is required
The Plan ID must be provided and valid; otherwise, the redemption cannot proceed.Amount must be greater than 0 and a whole number
The amount to redeem must be a positive integer. Fractional or zero values will cause errors.Invalid JSON in Proof field
If proof data is provided, it must be valid JSON. Malformed JSON will cause the node to throw an error.Insufficient credits
If the requested amount exceeds the available credits, the redemption will fail with an error suggesting purchasing more credits or reducing the amount.Invalid plan ID
If the plan ID does not start with the expected prefix or is otherwise invalid, the redemption will fail with instructions to verify the plan ID.General failures
Errors during redemption typically indicate issues with plan ID validity or insufficient credits. Double-check input parameters and API credentials.
Links and References
- Nevermined Documentation - Official docs for understanding the platform and its payment/subscription models.