Preview a subscription change
curl --request POST \
--url https://neo.api.projectdiscovery.io/api/v1/billing/subscription/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"credits_per_user": 123,
"demote_member_emails": [
"<string>"
],
"seats": 123
}
'import requests
url = "https://neo.api.projectdiscovery.io/api/v1/billing/subscription/preview"
payload = {
"credits_per_user": 123,
"demote_member_emails": ["<string>"],
"seats": 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({credits_per_user: 123, demote_member_emails: ['<string>'], seats: 123})
};
fetch('https://neo.api.projectdiscovery.io/api/v1/billing/subscription/preview', 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://neo.api.projectdiscovery.io/api/v1/billing/subscription/preview",
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([
'credits_per_user' => 123,
'demote_member_emails' => [
'<string>'
],
'seats' => 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://neo.api.projectdiscovery.io/api/v1/billing/subscription/preview"
payload := strings.NewReader("{\n \"credits_per_user\": 123,\n \"demote_member_emails\": [\n \"<string>\"\n ],\n \"seats\": 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://neo.api.projectdiscovery.io/api/v1/billing/subscription/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"credits_per_user\": 123,\n \"demote_member_emails\": [\n \"<string>\"\n ],\n \"seats\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://neo.api.projectdiscovery.io/api/v1/billing/subscription/preview")
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 \"credits_per_user\": 123,\n \"demote_member_emails\": [\n \"<string>\"\n ],\n \"seats\": 123\n}"
response = http.request(request)
puts response.read_body{
"amount_due_cents": 123,
"amount_due_display": "<string>",
"effective_at": "2023-11-07T05:31:56Z",
"immediate": true,
"line_items": [
{
"amount_cents": 123,
"amount_display": "<string>",
"description": "<string>"
}
],
"prorated_credits": 123
}{
"error": "Bad request",
"code": "user_spending_cap_reached",
"error_id": "<string>",
"kind": "forbidden request",
"message": "<string>"
}{
"error": "Bad request",
"code": "user_spending_cap_reached",
"error_id": "<string>",
"kind": "forbidden request",
"message": "<string>"
}{
"error": "Bad request",
"code": "user_spending_cap_reached",
"error_id": "<string>",
"kind": "forbidden request",
"message": "<string>"
}Billing
Preview a subscription change
Dry-run cost breakdown for a seat/tier/interval change via Stripe proration preview.
POST
/
api
/
v1
/
billing
/
subscription
/
preview
Preview a subscription change
curl --request POST \
--url https://neo.api.projectdiscovery.io/api/v1/billing/subscription/preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"credits_per_user": 123,
"demote_member_emails": [
"<string>"
],
"seats": 123
}
'import requests
url = "https://neo.api.projectdiscovery.io/api/v1/billing/subscription/preview"
payload = {
"credits_per_user": 123,
"demote_member_emails": ["<string>"],
"seats": 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({credits_per_user: 123, demote_member_emails: ['<string>'], seats: 123})
};
fetch('https://neo.api.projectdiscovery.io/api/v1/billing/subscription/preview', 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://neo.api.projectdiscovery.io/api/v1/billing/subscription/preview",
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([
'credits_per_user' => 123,
'demote_member_emails' => [
'<string>'
],
'seats' => 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://neo.api.projectdiscovery.io/api/v1/billing/subscription/preview"
payload := strings.NewReader("{\n \"credits_per_user\": 123,\n \"demote_member_emails\": [\n \"<string>\"\n ],\n \"seats\": 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://neo.api.projectdiscovery.io/api/v1/billing/subscription/preview")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"credits_per_user\": 123,\n \"demote_member_emails\": [\n \"<string>\"\n ],\n \"seats\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://neo.api.projectdiscovery.io/api/v1/billing/subscription/preview")
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 \"credits_per_user\": 123,\n \"demote_member_emails\": [\n \"<string>\"\n ],\n \"seats\": 123\n}"
response = http.request(request)
puts response.read_body{
"amount_due_cents": 123,
"amount_due_display": "<string>",
"effective_at": "2023-11-07T05:31:56Z",
"immediate": true,
"line_items": [
{
"amount_cents": 123,
"amount_display": "<string>",
"description": "<string>"
}
],
"prorated_credits": 123
}{
"error": "Bad request",
"code": "user_spending_cap_reached",
"error_id": "<string>",
"kind": "forbidden request",
"message": "<string>"
}{
"error": "Bad request",
"code": "user_spending_cap_reached",
"error_id": "<string>",
"kind": "forbidden request",
"message": "<string>"
}{
"error": "Bad request",
"code": "user_spending_cap_reached",
"error_id": "<string>",
"kind": "forbidden request",
"message": "<string>"
}Authorizations
BearerAuthApiKeyAuth
JWT authentication token
Body
application/json
Required when reducing seats below the current premium-member count: the member emails to demote to non-premium (no credits) at the next renewal. Must be enough to bring the premium count down to the new seat count.
Available options:
month, year ⌘I

