curl --request GET \
--url https://api.lava.so/v1/plans/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.lava.so/v1/plans/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.lava.so/v1/plans/{id}', 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.lava.so/v1/plans/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.lava.so/v1/plans/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.lava.so/v1/plans/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lava.so/v1/plans/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"plan_id": "<string>",
"merchant_id": "<string>",
"name": "<string>",
"period_amount": "<string>",
"included_credit": "<string>",
"billing_interval": "day",
"rollover_type": "full",
"bundle_rollover_type": "full",
"default_auto_top_up_bundle_id": "<string>",
"linked_meters": [
{
"meter_id": "<string>",
"name": "<string>"
}
],
"credit_bundles": [
{
"credit_bundle_id": "<string>",
"name": "<string>",
"cost": "<string>",
"credit_amount": "<string>"
}
],
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"message": "Invalid authentication credentials",
"code": "forward_token_json_invalid",
"status": 400,
"issues": [
{
"path": [
"model"
],
"message": "Missing required field: model"
},
{
"path": [
"messages",
"0",
"content"
],
"message": "Invalid message content format"
}
]
}
}{
"error": {
"message": "Invalid authentication credentials",
"code": "forward_token_json_invalid",
"status": 400,
"issues": [
{
"path": [
"model"
],
"message": "Missing required field: model"
},
{
"path": [
"messages",
"0",
"content"
],
"message": "Invalid message content format"
}
]
}
}Get plan
Get a specific plan by ID, including linked meters and credit bundles
curl --request GET \
--url https://api.lava.so/v1/plans/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.lava.so/v1/plans/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.lava.so/v1/plans/{id}', 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.lava.so/v1/plans/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.lava.so/v1/plans/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.lava.so/v1/plans/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lava.so/v1/plans/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"plan_id": "<string>",
"merchant_id": "<string>",
"name": "<string>",
"period_amount": "<string>",
"included_credit": "<string>",
"billing_interval": "day",
"rollover_type": "full",
"bundle_rollover_type": "full",
"default_auto_top_up_bundle_id": "<string>",
"linked_meters": [
{
"meter_id": "<string>",
"name": "<string>"
}
],
"credit_bundles": [
{
"credit_bundle_id": "<string>",
"name": "<string>",
"cost": "<string>",
"credit_amount": "<string>"
}
],
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"message": "Invalid authentication credentials",
"code": "forward_token_json_invalid",
"status": 400,
"issues": [
{
"path": [
"model"
],
"message": "Missing required field: model"
},
{
"path": [
"messages",
"0",
"content"
],
"message": "Invalid message content format"
}
]
}
}{
"error": {
"message": "Invalid authentication credentials",
"code": "forward_token_json_invalid",
"status": 400,
"issues": [
{
"path": [
"model"
],
"message": "Missing required field: model"
},
{
"path": [
"messages",
"0",
"content"
],
"message": "Invalid message content format"
}
]
}
}Authorizations
Bearer token authentication used for standard API calls. Format: 'Bearer YOUR_API_KEY'
Path Parameters
Plan ID
Response
Plan details
Unique identifier for the plan
Merchant ID that owns this plan
Name of the plan
Period amount in USD (high precision decimal as string)
Included credit per billing cycle in USD (high precision decimal as string)
How often the subscription is billed
day, week, month, year Cycle rollover: whether unused included credit rolls to next cycle
full, none Bundle rollover: whether unused bundle credit rolls to next cycle
full, none ID of the credit bundle that will be auto-purchased when a subscription cycle runs out of credit. Null if auto top-up is disabled.
Meters linked to this plan
Show child attributes
Show child attributes
Credit bundles available for this plan
Show child attributes
Show child attributes
When the plan was created