Buy extra credits on an active subscription
curl --request POST \
--url https://neo.api.projectdiscovery.io/api/v1/billing/subscription/topup \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"credits": 123,
"payment_method_id": "<string>"
}
'import requests
url = "https://neo.api.projectdiscovery.io/api/v1/billing/subscription/topup"
payload = {
"credits": 123,
"payment_method_id": "<string>"
}
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: 123, payment_method_id: '<string>'})
};
fetch('https://neo.api.projectdiscovery.io/api/v1/billing/subscription/topup', 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/topup",
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' => 123,
'payment_method_id' => '<string>'
]),
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/topup"
payload := strings.NewReader("{\n \"credits\": 123,\n \"payment_method_id\": \"<string>\"\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/topup")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"credits\": 123,\n \"payment_method_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://neo.api.projectdiscovery.io/api/v1/billing/subscription/topup")
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\": 123,\n \"payment_method_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"amount_cents": 123,
"amount_display": "<string>",
"credits": 123,
"has_payment_method": true,
"invoice_id": "<string>",
"invoice_url": "<string>",
"monthly_max": 123,
"monthly_remaining": 123,
"new_topup_balance": 123,
"payment_methods": [
{
"brand": "<string>",
"email": "<string>",
"exp_month": 123,
"exp_year": 123,
"id": "<string>",
"is_default": true,
"last4": "<string>",
"type": "<string>"
}
],
"unit_price": 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
Buy extra credits on an active subscription
Buys additional credits for an active subscription as a one-off invoice tied to the subscription. Charges the saved card immediately and feeds the top-up bucket. Distinct from /billing/purchase (standalone purchases).
POST
/
api
/
v1
/
billing
/
subscription
/
topup
Buy extra credits on an active subscription
curl --request POST \
--url https://neo.api.projectdiscovery.io/api/v1/billing/subscription/topup \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"credits": 123,
"payment_method_id": "<string>"
}
'import requests
url = "https://neo.api.projectdiscovery.io/api/v1/billing/subscription/topup"
payload = {
"credits": 123,
"payment_method_id": "<string>"
}
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: 123, payment_method_id: '<string>'})
};
fetch('https://neo.api.projectdiscovery.io/api/v1/billing/subscription/topup', 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/topup",
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' => 123,
'payment_method_id' => '<string>'
]),
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/topup"
payload := strings.NewReader("{\n \"credits\": 123,\n \"payment_method_id\": \"<string>\"\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/topup")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"credits\": 123,\n \"payment_method_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://neo.api.projectdiscovery.io/api/v1/billing/subscription/topup")
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\": 123,\n \"payment_method_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"amount_cents": 123,
"amount_display": "<string>",
"credits": 123,
"has_payment_method": true,
"invoice_id": "<string>",
"invoice_url": "<string>",
"monthly_max": 123,
"monthly_remaining": 123,
"new_topup_balance": 123,
"payment_methods": [
{
"brand": "<string>",
"email": "<string>",
"exp_month": 123,
"exp_year": 123,
"id": "<string>",
"is_default": true,
"last4": "<string>",
"type": "<string>"
}
],
"unit_price": 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
Response
Top-up estimate or charged
Available options:
estimate, charged Maximum top-up credits purchasable per billing month for this buyer.
Remaining top-up credits purchasable in the current billing month.
Show child attributes
Show child attributes
⌘I

