Register Plan
curl --request POST \
--url https://api.sandbox.nevermined.app/api/v1/protocol/plans \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Pro Plan",
"description": "500 requests per month",
"priceConfig": {
"priceType": "FIXED_PRICE",
"tokenAddress": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
"amounts": [
50000000
],
"receivers": [
"0xYourWalletAddress"
]
},
"creditsConfig": {
"creditsType": "FIXED",
"amount": 500,
"minAmount": 1
}
}
'import requests
url = "https://api.sandbox.nevermined.app/api/v1/protocol/plans"
payload = {
"name": "Pro Plan",
"description": "500 requests per month",
"priceConfig": {
"priceType": "FIXED_PRICE",
"tokenAddress": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
"amounts": [50000000],
"receivers": ["0xYourWalletAddress"]
},
"creditsConfig": {
"creditsType": "FIXED",
"amount": 500,
"minAmount": 1
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Pro Plan',
description: '500 requests per month',
priceConfig: {
priceType: 'FIXED_PRICE',
tokenAddress: '0x036CbD53842c5426634e7929541eC2318f3dCF7e',
amounts: [50000000],
receivers: ['0xYourWalletAddress']
},
creditsConfig: {creditsType: 'FIXED', amount: 500, minAmount: 1}
})
};
fetch('https://api.sandbox.nevermined.app/api/v1/protocol/plans', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.nevermined.app/api/v1/protocol/plans",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Pro Plan',
'description' => '500 requests per month',
'priceConfig' => [
'priceType' => 'FIXED_PRICE',
'tokenAddress' => '0x036CbD53842c5426634e7929541eC2318f3dCF7e',
'amounts' => [
50000000
],
'receivers' => [
'0xYourWalletAddress'
]
],
'creditsConfig' => [
'creditsType' => 'FIXED',
'amount' => 500,
'minAmount' => 1
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.nevermined.app/api/v1/protocol/plans"
payload := strings.NewReader("{\n \"name\": \"Pro Plan\",\n \"description\": \"500 requests per month\",\n \"priceConfig\": {\n \"priceType\": \"FIXED_PRICE\",\n \"tokenAddress\": \"0x036CbD53842c5426634e7929541eC2318f3dCF7e\",\n \"amounts\": [\n 50000000\n ],\n \"receivers\": [\n \"0xYourWalletAddress\"\n ]\n },\n \"creditsConfig\": {\n \"creditsType\": \"FIXED\",\n \"amount\": 500,\n \"minAmount\": 1\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.nevermined.app/api/v1/protocol/plans")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Pro Plan\",\n \"description\": \"500 requests per month\",\n \"priceConfig\": {\n \"priceType\": \"FIXED_PRICE\",\n \"tokenAddress\": \"0x036CbD53842c5426634e7929541eC2318f3dCF7e\",\n \"amounts\": [\n 50000000\n ],\n \"receivers\": [\n \"0xYourWalletAddress\"\n ]\n },\n \"creditsConfig\": {\n \"creditsType\": \"FIXED\",\n \"amount\": 500,\n \"minAmount\": 1\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.nevermined.app/api/v1/protocol/plans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Pro Plan\",\n \"description\": \"500 requests per month\",\n \"priceConfig\": {\n \"priceType\": \"FIXED_PRICE\",\n \"tokenAddress\": \"0x036CbD53842c5426634e7929541eC2318f3dCF7e\",\n \"amounts\": [\n 50000000\n ],\n \"receivers\": [\n \"0xYourWalletAddress\"\n ]\n },\n \"creditsConfig\": {\n \"creditsType\": \"FIXED\",\n \"amount\": 500,\n \"minAmount\": 1\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"planId": "<string>"
}Plans
Register Plan
Creates a new payment plan with pricing and credit configuration.
POST
/
protocol
/
plans
Register Plan
curl --request POST \
--url https://api.sandbox.nevermined.app/api/v1/protocol/plans \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Pro Plan",
"description": "500 requests per month",
"priceConfig": {
"priceType": "FIXED_PRICE",
"tokenAddress": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
"amounts": [
50000000
],
"receivers": [
"0xYourWalletAddress"
]
},
"creditsConfig": {
"creditsType": "FIXED",
"amount": 500,
"minAmount": 1
}
}
'import requests
url = "https://api.sandbox.nevermined.app/api/v1/protocol/plans"
payload = {
"name": "Pro Plan",
"description": "500 requests per month",
"priceConfig": {
"priceType": "FIXED_PRICE",
"tokenAddress": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
"amounts": [50000000],
"receivers": ["0xYourWalletAddress"]
},
"creditsConfig": {
"creditsType": "FIXED",
"amount": 500,
"minAmount": 1
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Pro Plan',
description: '500 requests per month',
priceConfig: {
priceType: 'FIXED_PRICE',
tokenAddress: '0x036CbD53842c5426634e7929541eC2318f3dCF7e',
amounts: [50000000],
receivers: ['0xYourWalletAddress']
},
creditsConfig: {creditsType: 'FIXED', amount: 500, minAmount: 1}
})
};
fetch('https://api.sandbox.nevermined.app/api/v1/protocol/plans', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.nevermined.app/api/v1/protocol/plans",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Pro Plan',
'description' => '500 requests per month',
'priceConfig' => [
'priceType' => 'FIXED_PRICE',
'tokenAddress' => '0x036CbD53842c5426634e7929541eC2318f3dCF7e',
'amounts' => [
50000000
],
'receivers' => [
'0xYourWalletAddress'
]
],
'creditsConfig' => [
'creditsType' => 'FIXED',
'amount' => 500,
'minAmount' => 1
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.nevermined.app/api/v1/protocol/plans"
payload := strings.NewReader("{\n \"name\": \"Pro Plan\",\n \"description\": \"500 requests per month\",\n \"priceConfig\": {\n \"priceType\": \"FIXED_PRICE\",\n \"tokenAddress\": \"0x036CbD53842c5426634e7929541eC2318f3dCF7e\",\n \"amounts\": [\n 50000000\n ],\n \"receivers\": [\n \"0xYourWalletAddress\"\n ]\n },\n \"creditsConfig\": {\n \"creditsType\": \"FIXED\",\n \"amount\": 500,\n \"minAmount\": 1\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.nevermined.app/api/v1/protocol/plans")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Pro Plan\",\n \"description\": \"500 requests per month\",\n \"priceConfig\": {\n \"priceType\": \"FIXED_PRICE\",\n \"tokenAddress\": \"0x036CbD53842c5426634e7929541eC2318f3dCF7e\",\n \"amounts\": [\n 50000000\n ],\n \"receivers\": [\n \"0xYourWalletAddress\"\n ]\n },\n \"creditsConfig\": {\n \"creditsType\": \"FIXED\",\n \"amount\": 500,\n \"minAmount\": 1\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.nevermined.app/api/v1/protocol/plans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Pro Plan\",\n \"description\": \"500 requests per month\",\n \"priceConfig\": {\n \"priceType\": \"FIXED_PRICE\",\n \"tokenAddress\": \"0x036CbD53842c5426634e7929541eC2318f3dCF7e\",\n \"amounts\": [\n 50000000\n ],\n \"receivers\": [\n \"0xYourWalletAddress\"\n ]\n },\n \"creditsConfig\": {\n \"creditsType\": \"FIXED\",\n \"amount\": 500,\n \"minAmount\": 1\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"planId": "<string>"
}Authorizations
Your Nevermined API Key (starts with 'nvm:'). Get one at nevermined.app under Settings > API Keys.
Body
application/json
Plan configuration
⌘I