Create Plan - m3ter Documentation
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Create Plan
cURL
curl --request POST \
--url https://api.m3ter.com/organizations/{orgId}/plans \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"planTemplateId": "<string>",
"name": "<string>",
"code": "<string>",
"version": 123,
"customFields": {},
"standingCharge": 1,
"standingChargeDescription": "<string>",
"ordinal": 1,
"bespoke": true,
"minimumSpend": 1,
"minimumSpendDescription": "<string>",
"standingChargeBillInAdvance": true,
"minimumSpendBillInAdvance": true,
"minimumSpendAccountingProductId": "<string>",
"standingChargeAccountingProductId": "<string>",
"accountId": "<string>"
}
'
Python
import requests
url = "https://api.m3ter.com/organizations/{orgId}/plans"
payload = {
"planTemplateId": "<string>",
"name": "<string>",
"code": "<string>",
"version": 123,
"customFields": {},
"standingCharge": 1,
"standingChargeDescription": "<string>",
"ordinal": 1,
"bespoke": True,
"minimumSpend": 1,
"minimumSpendDescription": "<string>",
"standingChargeBillInAdvance": True,
"minimumSpendBillInAdvance": True,
"minimumSpendAccountingProductId": "<string>",
"standingChargeAccountingProductId": "<string>",
"accountId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)
JavaScript
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
planTemplateId: '<string>',
name: '<string>',
code: '<string>',
version: 123,
customFields: {},
standingCharge: 1,
standingChargeDescription: '<string>',
ordinal: 1,
bespoke: true,
minimumSpend: 1,
minimumSpendDescription: '<string>',
standingChargeBillInAdvance: true,
minimumSpendBillInAdvance: true,
minimumSpendAccountingProductId: '<string>',
standingChargeAccountingProductId: '<string>',
accountId: '<string>'
})
};
fetch('https://api.m3ter.com/organizations/{orgId}/plans', 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}/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([
'planTemplateId' => '<string>',
'name' => '<string>',
'code' => '<string>',
'version' => 123,
'customFields' => [],
'standingCharge' => 1,
'standingChargeDescription' => '<string>',
'ordinal' => 1,
'bespoke' => true,
'minimumSpend' => 1,
'minimumSpendDescription' => '<string>',
'standingChargeBillInAdvance' => true,
'minimumSpendBillInAdvance' => true,
'minimumSpendAccountingProductId' => '<string>',
'standingChargeAccountingProductId' => '<string>',
'accountId' => '<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;
}
?>
Response
{
"id": "<string>",
"version": 123,
"customFields": {},
"planTemplateId": "<string>",
"productId": "<string>",
"name": "<string>",
"code": "<string>",
"standingCharge": 123,
"standingChargeDescription": "<string>",
"ordinal": 123,
"bespoke": true,
"minimumSpend": 123,
"minimumSpendDescription": "<string>",
"standingChargeBillInAdvance": true,
"minimumSpendBillInAdvance": true,
"minimumSpendAccountingProductId": "<string>",
"standingChargeAccountingProductId": "<string>",
"accountId": "<string>",
"dtCreated": "2023-11-07T05:31:56Z",
"dtLastModified": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"lastModifiedBy": "<string>"
}
Authorizations
Authorization:
- string
- header
- required
- m3ter supports machine to machine authentication using the
clientCredentialsOAuth2 flow.
Path Parameters
orgId
- string
- required
- UUID of the organization. The Organization represents your company as a direct customer of the m3ter service.