Retrieve PlanTemplate - m3ter Documentation
Retrieve PlanTemplate
cURL
curl --request GET \
--url https://api.m3ter.com/organizations/{orgId}/plantemplates/{id} \
--header 'Authorization: Bearer <token>'
Python
import requests
url = "https://api.m3ter.com/organizations/{orgId}/plantemplates/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)
JavaScript (Fetch API)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.m3ter.com/organizations/{orgId}/plantemplates/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, [\
CURLOPT_URL => "https://api.m3ter.com/organizations/{orgId}/plantemplates/{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;
}
?>
Go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.m3ter.com/organizations/{orgId}/planttemplates/{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))
}
unirest (Java)
HttpResponse<String> response = Unirest.get("https://api.m3ter.com/organizations/{orgId}/plantemplates/{id}")
.header("Authorization", "Bearer <token>")
.asString();
Ruby
require 'uri'
require 'net/http'
url = URI("https://api.m3ter.com/organizations/{orgId}/plantemplates/{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
Response Codes
Response Schema
{
"id": "string",
"version": 1,
"customFields": {
"example1": 123,
"example2": "string"
},
"productId": "string",
"name": "string",
"currency": "USD",
"standingCharge": 0,
"standingChargeDescription": "string",
"standingChargeInterval": 1,
"standingChargeOffset": 364,
"billFrequencyInterval": 1,
"billFrequency": "DAILY",
"ordinal": 0,
"code": "string",
"minimumSpend": 0,
"minimumSpendDescription": "string",
"standingChargeBillInAdvance": true,
"minimumSpendBillInAdvance": false
}
Error Message Example
{
"message": "<string>"
}
Authorizations
- Authorization (string, required) - m3ter supports machine to machine authentication using the
clientCredentials OAuth2 flow.
Path Parameters
- orgId (string, required) - The unique identifier (UUID) of your Organization.
- id (string, required) - The unique identifier (UUID) of the PlanTemplate to retrieve.
Detailed Response Attributes
- id: The UUID of the entity.
- version: The version number of the PlanTemplate.
- customFields: User defined fields enabling you to attach custom data.
- productId: The unique identifier of the Product associated with this PlanTemplate.
- name: Descriptive name for the PlanTemplate.
- currency: ISO currency code.
- standingCharge: The fixed charge applied to customer bills.
- standingChargeDescription: Description displayed on the bill line item.
- standingChargeInterval: Frequency of the standing charge.
- standingChargeOffset: Offset for when the standing charge is first applied.
- billFrequencyInterval: Frequency of bills issued.
- billFrequency: Determines the frequency at which bills are generated.
- ordinal: The ranking of the PlanTemplate among your pricing plans.
- code: A unique, short code reference for the PlanTemplate.
- minimumSpend: The Product minimum spend amount per billing cycle.
- minimumSpendDescription: Minimum spend description displayed on the bill line item.
- standingChargeBillInAdvance: When the standing charge is billed.
- minimumSpendBillInAdvance: When the minimum spend is billed.