curl -X POST https://api.paybridgenp.com/v1/billing/plans \
-H "Authorization: Bearer sk_test_your_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Pro Monthly",
"amount": 99900,
"intervalUnit": "month",
"trialDays": 14
}'import requests
url = "https://api.paybridgenp.com/v1/billing/plans"
payload = {
"name": "Pro Monthly",
"amount": 99900,
"intervalUnit": "month",
"description": "<string>",
"currency": "NPR",
"intervalCount": 1,
"gracePeriodDays": 0,
"billingScheme": "per_unit",
"aggregationMethod": "sum",
"trialDays": 14,
"reminderDaysBeforeDue": 3,
"overdueReminderIntervalDays": 123,
"overdueAction": "mark_past_due",
"metadata": {}
}
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 Monthly',
amount: 99900,
intervalUnit: 'month',
description: '<string>',
currency: 'NPR',
intervalCount: 1,
gracePeriodDays: 0,
billingScheme: 'per_unit',
aggregationMethod: 'sum',
trialDays: 14,
reminderDaysBeforeDue: 3,
overdueReminderIntervalDays: 123,
overdueAction: 'mark_past_due',
metadata: {}
})
};
fetch('https://api.paybridgenp.com/v1/billing/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.paybridgenp.com/v1/billing/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 Monthly',
'amount' => 99900,
'intervalUnit' => 'month',
'description' => '<string>',
'currency' => 'NPR',
'intervalCount' => 1,
'gracePeriodDays' => 0,
'billingScheme' => 'per_unit',
'aggregationMethod' => 'sum',
'trialDays' => 14,
'reminderDaysBeforeDue' => 3,
'overdueReminderIntervalDays' => 123,
'overdueAction' => 'mark_past_due',
'metadata' => [
]
]),
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.paybridgenp.com/v1/billing/plans"
payload := strings.NewReader("{\n \"name\": \"Pro Monthly\",\n \"amount\": 99900,\n \"intervalUnit\": \"month\",\n \"description\": \"<string>\",\n \"currency\": \"NPR\",\n \"intervalCount\": 1,\n \"gracePeriodDays\": 0,\n \"billingScheme\": \"per_unit\",\n \"aggregationMethod\": \"sum\",\n \"trialDays\": 14,\n \"reminderDaysBeforeDue\": 3,\n \"overdueReminderIntervalDays\": 123,\n \"overdueAction\": \"mark_past_due\",\n \"metadata\": {}\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.paybridgenp.com/v1/billing/plans")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Pro Monthly\",\n \"amount\": 99900,\n \"intervalUnit\": \"month\",\n \"description\": \"<string>\",\n \"currency\": \"NPR\",\n \"intervalCount\": 1,\n \"gracePeriodDays\": 0,\n \"billingScheme\": \"per_unit\",\n \"aggregationMethod\": \"sum\",\n \"trialDays\": 14,\n \"reminderDaysBeforeDue\": 3,\n \"overdueReminderIntervalDays\": 123,\n \"overdueAction\": \"mark_past_due\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paybridgenp.com/v1/billing/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 Monthly\",\n \"amount\": 99900,\n \"intervalUnit\": \"month\",\n \"description\": \"<string>\",\n \"currency\": \"NPR\",\n \"intervalCount\": 1,\n \"gracePeriodDays\": 0,\n \"billingScheme\": \"per_unit\",\n \"aggregationMethod\": \"sum\",\n \"trialDays\": 14,\n \"reminderDaysBeforeDue\": 3,\n \"overdueReminderIntervalDays\": 123,\n \"overdueAction\": \"mark_past_due\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "bpl_01j9x2k3m4n5p6q7r8s9t0u1v2",
"object": "plan",
"name": "Pro Monthly",
"description": "<string>",
"amount": 99900,
"currency": "NPR",
"interval_unit": "day",
"interval_count": 1,
"grace_period_days": 3,
"trial_days": 14,
"default_provider": "esewa",
"active": true,
"billing_scheme": "per_unit",
"aggregation_method": "sum",
"dunning_settings": {
"reminder_days_before_due": 123,
"overdue_reminder_interval_days": 123,
"overdue_action": "keep_active"
},
"metadata": {},
"livemode": true
}{
"error": {
"message": "<string>",
"type": "authentication_error",
"code": "<string>",
"request_id": "req_2Je91NlWKuXkdXUJOK9gaHNW",
"suspension": {
"suspended_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
},
"pause": {
"paused_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
}
}
}{
"error": {
"message": "<string>",
"type": "authentication_error",
"code": "<string>",
"request_id": "req_2Je91NlWKuXkdXUJOK9gaHNW",
"suspension": {
"suspended_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
},
"pause": {
"paused_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
}
}
}Create a billing plan
Creates a recurring billing plan. Subscriptions are tied to a plan and inherit its amount, interval, and dunning settings.
Amount and interval are immutable after creation. To change them, create a new plan and migrate subscribers using the Change Plan endpoint.
curl -X POST https://api.paybridgenp.com/v1/billing/plans \
-H "Authorization: Bearer sk_test_your_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Pro Monthly",
"amount": 99900,
"intervalUnit": "month",
"trialDays": 14
}'import requests
url = "https://api.paybridgenp.com/v1/billing/plans"
payload = {
"name": "Pro Monthly",
"amount": 99900,
"intervalUnit": "month",
"description": "<string>",
"currency": "NPR",
"intervalCount": 1,
"gracePeriodDays": 0,
"billingScheme": "per_unit",
"aggregationMethod": "sum",
"trialDays": 14,
"reminderDaysBeforeDue": 3,
"overdueReminderIntervalDays": 123,
"overdueAction": "mark_past_due",
"metadata": {}
}
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 Monthly',
amount: 99900,
intervalUnit: 'month',
description: '<string>',
currency: 'NPR',
intervalCount: 1,
gracePeriodDays: 0,
billingScheme: 'per_unit',
aggregationMethod: 'sum',
trialDays: 14,
reminderDaysBeforeDue: 3,
overdueReminderIntervalDays: 123,
overdueAction: 'mark_past_due',
metadata: {}
})
};
fetch('https://api.paybridgenp.com/v1/billing/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.paybridgenp.com/v1/billing/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 Monthly',
'amount' => 99900,
'intervalUnit' => 'month',
'description' => '<string>',
'currency' => 'NPR',
'intervalCount' => 1,
'gracePeriodDays' => 0,
'billingScheme' => 'per_unit',
'aggregationMethod' => 'sum',
'trialDays' => 14,
'reminderDaysBeforeDue' => 3,
'overdueReminderIntervalDays' => 123,
'overdueAction' => 'mark_past_due',
'metadata' => [
]
]),
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.paybridgenp.com/v1/billing/plans"
payload := strings.NewReader("{\n \"name\": \"Pro Monthly\",\n \"amount\": 99900,\n \"intervalUnit\": \"month\",\n \"description\": \"<string>\",\n \"currency\": \"NPR\",\n \"intervalCount\": 1,\n \"gracePeriodDays\": 0,\n \"billingScheme\": \"per_unit\",\n \"aggregationMethod\": \"sum\",\n \"trialDays\": 14,\n \"reminderDaysBeforeDue\": 3,\n \"overdueReminderIntervalDays\": 123,\n \"overdueAction\": \"mark_past_due\",\n \"metadata\": {}\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.paybridgenp.com/v1/billing/plans")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Pro Monthly\",\n \"amount\": 99900,\n \"intervalUnit\": \"month\",\n \"description\": \"<string>\",\n \"currency\": \"NPR\",\n \"intervalCount\": 1,\n \"gracePeriodDays\": 0,\n \"billingScheme\": \"per_unit\",\n \"aggregationMethod\": \"sum\",\n \"trialDays\": 14,\n \"reminderDaysBeforeDue\": 3,\n \"overdueReminderIntervalDays\": 123,\n \"overdueAction\": \"mark_past_due\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paybridgenp.com/v1/billing/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 Monthly\",\n \"amount\": 99900,\n \"intervalUnit\": \"month\",\n \"description\": \"<string>\",\n \"currency\": \"NPR\",\n \"intervalCount\": 1,\n \"gracePeriodDays\": 0,\n \"billingScheme\": \"per_unit\",\n \"aggregationMethod\": \"sum\",\n \"trialDays\": 14,\n \"reminderDaysBeforeDue\": 3,\n \"overdueReminderIntervalDays\": 123,\n \"overdueAction\": \"mark_past_due\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "bpl_01j9x2k3m4n5p6q7r8s9t0u1v2",
"object": "plan",
"name": "Pro Monthly",
"description": "<string>",
"amount": 99900,
"currency": "NPR",
"interval_unit": "day",
"interval_count": 1,
"grace_period_days": 3,
"trial_days": 14,
"default_provider": "esewa",
"active": true,
"billing_scheme": "per_unit",
"aggregation_method": "sum",
"dunning_settings": {
"reminder_days_before_due": 123,
"overdue_reminder_interval_days": 123,
"overdue_action": "keep_active"
},
"metadata": {},
"livemode": true
}{
"error": {
"message": "<string>",
"type": "authentication_error",
"code": "<string>",
"request_id": "req_2Je91NlWKuXkdXUJOK9gaHNW",
"suspension": {
"suspended_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
},
"pause": {
"paused_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
}
}
}{
"error": {
"message": "<string>",
"type": "authentication_error",
"code": "<string>",
"request_id": "req_2Je91NlWKuXkdXUJOK9gaHNW",
"suspension": {
"suspended_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
},
"pause": {
"paused_at": "2023-11-07T05:31:56Z",
"reason": "<string>"
}
}
}Authorizations
Your PayBridgeNP API key. Obtain one from the dashboard under Settings → API Keys. Prefix: sk_test_ for testing, sk_live_ for production.
Body
"Pro Monthly"
Recurring charge in paisa.
99900
day, week, month, quarter, year "month"
How many intervalUnits per billing cycle. 2 + month = every 2 months.
Days after due date before triggering overdue action.
metered bills on reported usage (see POST /v1/billing/subscriptions/{id}/usage). Set at creation; immutable afterwards.
per_unit, metered How usage records aggregate per period on metered plans.
sum, max, last_ever Free trial period in days (0–365).
14
esewa, khalti, fonepay Send payment reminder this many days before invoice due date (0–30).
3
Repeat overdue reminders every N days (0–30).
Action to take when a subscription goes overdue.
keep_active, mark_past_due, pause, cancel Response
Plan created.
"bpl_01j9x2k3m4n5p6q7r8s9t0u1v2"
plan "Pro Monthly"
Recurring amount in paisa.
99900
"NPR"
day, week, month, quarter, year 1
3
14
esewa, khalti, fonepay metered plans bill on reported usage.
per_unit, metered Usage aggregation for metered plans.
sum, max, last_ever, null Show child attributes
Show child attributes
true when created with a live key, false for sandbox.
Was this page helpful?