Create a per-currency budget for a group
curl --request POST \
--url https://api.sandbox.nevermined.app/api/v1/organizations/{orgId}/groups/{groupId}/budgets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"spendingLimitCents": "150000",
"currency": "usd",
"interval": "month",
"alertThresholdPct": 80,
"maxTransactions": 123
}
'import requests
url = "https://api.sandbox.nevermined.app/api/v1/organizations/{orgId}/groups/{groupId}/budgets"
payload = {
"spendingLimitCents": "150000",
"currency": "usd",
"interval": "month",
"alertThresholdPct": 80,
"maxTransactions": 123
}
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({
spendingLimitCents: '150000',
currency: 'usd',
interval: 'month',
alertThresholdPct: 80,
maxTransactions: 123
})
};
fetch('https://api.sandbox.nevermined.app/api/v1/organizations/{orgId}/groups/{groupId}/budgets', 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/organizations/{orgId}/groups/{groupId}/budgets",
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([
'spendingLimitCents' => '150000',
'currency' => 'usd',
'interval' => 'month',
'alertThresholdPct' => 80,
'maxTransactions' => 123
]),
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/organizations/{orgId}/groups/{groupId}/budgets"
payload := strings.NewReader("{\n \"spendingLimitCents\": \"150000\",\n \"currency\": \"usd\",\n \"interval\": \"month\",\n \"alertThresholdPct\": 80,\n \"maxTransactions\": 123\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/organizations/{orgId}/groups/{groupId}/budgets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"spendingLimitCents\": \"150000\",\n \"currency\": \"usd\",\n \"interval\": \"month\",\n \"alertThresholdPct\": 80,\n \"maxTransactions\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.nevermined.app/api/v1/organizations/{orgId}/groups/{groupId}/budgets")
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 \"spendingLimitCents\": \"150000\",\n \"currency\": \"usd\",\n \"interval\": \"month\",\n \"alertThresholdPct\": 80,\n \"maxTransactions\": 123\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"budget": {
"budgetId": "bdg-3fa8…afa6",
"spendingLimitCents": "150000",
"amountSpentCents": "2000",
"remainingBudgetCents": "148000",
"currency": "usd",
"interval": "month",
"periodStart": "2023-11-07T05:31:56Z",
"periodEnd": "2023-11-07T05:31:56Z",
"alertThresholdPct": 80,
"status": "Active"
}
}Groups & Budgets
Create a per-currency budget for a group
POST
/
organizations
/
{orgId}
/
groups
/
{groupId}
/
budgets
Create a per-currency budget for a group
curl --request POST \
--url https://api.sandbox.nevermined.app/api/v1/organizations/{orgId}/groups/{groupId}/budgets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"spendingLimitCents": "150000",
"currency": "usd",
"interval": "month",
"alertThresholdPct": 80,
"maxTransactions": 123
}
'import requests
url = "https://api.sandbox.nevermined.app/api/v1/organizations/{orgId}/groups/{groupId}/budgets"
payload = {
"spendingLimitCents": "150000",
"currency": "usd",
"interval": "month",
"alertThresholdPct": 80,
"maxTransactions": 123
}
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({
spendingLimitCents: '150000',
currency: 'usd',
interval: 'month',
alertThresholdPct: 80,
maxTransactions: 123
})
};
fetch('https://api.sandbox.nevermined.app/api/v1/organizations/{orgId}/groups/{groupId}/budgets', 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/organizations/{orgId}/groups/{groupId}/budgets",
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([
'spendingLimitCents' => '150000',
'currency' => 'usd',
'interval' => 'month',
'alertThresholdPct' => 80,
'maxTransactions' => 123
]),
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/organizations/{orgId}/groups/{groupId}/budgets"
payload := strings.NewReader("{\n \"spendingLimitCents\": \"150000\",\n \"currency\": \"usd\",\n \"interval\": \"month\",\n \"alertThresholdPct\": 80,\n \"maxTransactions\": 123\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/organizations/{orgId}/groups/{groupId}/budgets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"spendingLimitCents\": \"150000\",\n \"currency\": \"usd\",\n \"interval\": \"month\",\n \"alertThresholdPct\": 80,\n \"maxTransactions\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.nevermined.app/api/v1/organizations/{orgId}/groups/{groupId}/budgets")
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 \"spendingLimitCents\": \"150000\",\n \"currency\": \"usd\",\n \"interval\": \"month\",\n \"alertThresholdPct\": 80,\n \"maxTransactions\": 123\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"budget": {
"budgetId": "bdg-3fa8…afa6",
"spendingLimitCents": "150000",
"amountSpentCents": "2000",
"remainingBudgetCents": "148000",
"currency": "usd",
"interval": "month",
"periodStart": "2023-11-07T05:31:56Z",
"periodEnd": "2023-11-07T05:31:56Z",
"alertThresholdPct": 80,
"status": "Active"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Spend ceiling for the period, in minor units (cents of currency).
Example:
"150000"
Currency of this budget (one budget per currency per group). Defaults to usd. Enforcement matches the charge currency exactly — a usd budget does NOT cap usdc spend.
Available options:
usd, eur, usdc, eurc Example:
"usd"
Available options:
month, year, one_shot Example:
"month"
Alert when spend crosses this % of the limit
Example:
80
Optional cap on the number of charges per period
Was this page helpful?
⌘I