Create plan template
curl --request POST \
--url https://api.halth.com/v1/organisations/{organisationId}/plans/templates \
--header 'Content-Type: application/json' \
--data '
{
"currency": "aud",
"billingType": "recurring",
"name": "<string>",
"description": "This is a plan template for a plan",
"discountRate": 0.1,
"discountAmount": 10000,
"items": [
{
"basePrice": 10000,
"price": 120000,
"appointmentTypeId": "<string>",
"billableItemId": "<string>",
"providerId": "<string>",
"sortOrder": 1
}
]
}
'import requests
url = "https://api.halth.com/v1/organisations/{organisationId}/plans/templates"
payload = {
"currency": "aud",
"billingType": "recurring",
"name": "<string>",
"description": "This is a plan template for a plan",
"discountRate": 0.1,
"discountAmount": 10000,
"items": [
{
"basePrice": 10000,
"price": 120000,
"appointmentTypeId": "<string>",
"billableItemId": "<string>",
"providerId": "<string>",
"sortOrder": 1
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
currency: 'aud',
billingType: 'recurring',
name: '<string>',
description: 'This is a plan template for a plan',
discountRate: 0.1,
discountAmount: 10000,
items: [
{
basePrice: 10000,
price: 120000,
appointmentTypeId: '<string>',
billableItemId: '<string>',
providerId: '<string>',
sortOrder: 1
}
]
})
};
fetch('https://api.halth.com/v1/organisations/{organisationId}/plans/templates', 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.halth.com/v1/organisations/{organisationId}/plans/templates",
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([
'currency' => 'aud',
'billingType' => 'recurring',
'name' => '<string>',
'description' => 'This is a plan template for a plan',
'discountRate' => 0.1,
'discountAmount' => 10000,
'items' => [
[
'basePrice' => 10000,
'price' => 120000,
'appointmentTypeId' => '<string>',
'billableItemId' => '<string>',
'providerId' => '<string>',
'sortOrder' => 1
]
]
]),
CURLOPT_HTTPHEADER => [
"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.halth.com/v1/organisations/{organisationId}/plans/templates"
payload := strings.NewReader("{\n \"currency\": \"aud\",\n \"billingType\": \"recurring\",\n \"name\": \"<string>\",\n \"description\": \"This is a plan template for a plan\",\n \"discountRate\": 0.1,\n \"discountAmount\": 10000,\n \"items\": [\n {\n \"basePrice\": 10000,\n \"price\": 120000,\n \"appointmentTypeId\": \"<string>\",\n \"billableItemId\": \"<string>\",\n \"providerId\": \"<string>\",\n \"sortOrder\": 1\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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.halth.com/v1/organisations/{organisationId}/plans/templates")
.header("Content-Type", "application/json")
.body("{\n \"currency\": \"aud\",\n \"billingType\": \"recurring\",\n \"name\": \"<string>\",\n \"description\": \"This is a plan template for a plan\",\n \"discountRate\": 0.1,\n \"discountAmount\": 10000,\n \"items\": [\n {\n \"basePrice\": 10000,\n \"price\": 120000,\n \"appointmentTypeId\": \"<string>\",\n \"billableItemId\": \"<string>\",\n \"providerId\": \"<string>\",\n \"sortOrder\": 1\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.halth.com/v1/organisations/{organisationId}/plans/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"currency\": \"aud\",\n \"billingType\": \"recurring\",\n \"name\": \"<string>\",\n \"description\": \"This is a plan template for a plan\",\n \"discountRate\": 0.1,\n \"discountAmount\": 10000,\n \"items\": [\n {\n \"basePrice\": 10000,\n \"price\": 120000,\n \"appointmentTypeId\": \"<string>\",\n \"billableItemId\": \"<string>\",\n \"providerId\": \"<string>\",\n \"sortOrder\": 1\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"discountRate": 0.1,
"discountAmount": 10000,
"billingType": "recurring",
"popularityRank": 123,
"id": "<string>",
"createdAt": "<string>",
"name": "<string>",
"price": 123,
"currency": "<string>",
"deleted": true,
"items": [
{
"id": "<string>",
"createdAt": "<string>",
"planTemplateId": "<string>",
"sortOrder": 123,
"appointmentTypeId": "<string>",
"providerId": "<string>",
"billableItemId": "<string>",
"basePrice": 123,
"price": 123
}
],
"description": "<string>"
}Plan Template
Create plan template
Create a plan template for an organisation
POST
/
v1
/
organisations
/
{organisationId}
/
plans
/
templates
Create plan template
curl --request POST \
--url https://api.halth.com/v1/organisations/{organisationId}/plans/templates \
--header 'Content-Type: application/json' \
--data '
{
"currency": "aud",
"billingType": "recurring",
"name": "<string>",
"description": "This is a plan template for a plan",
"discountRate": 0.1,
"discountAmount": 10000,
"items": [
{
"basePrice": 10000,
"price": 120000,
"appointmentTypeId": "<string>",
"billableItemId": "<string>",
"providerId": "<string>",
"sortOrder": 1
}
]
}
'import requests
url = "https://api.halth.com/v1/organisations/{organisationId}/plans/templates"
payload = {
"currency": "aud",
"billingType": "recurring",
"name": "<string>",
"description": "This is a plan template for a plan",
"discountRate": 0.1,
"discountAmount": 10000,
"items": [
{
"basePrice": 10000,
"price": 120000,
"appointmentTypeId": "<string>",
"billableItemId": "<string>",
"providerId": "<string>",
"sortOrder": 1
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
currency: 'aud',
billingType: 'recurring',
name: '<string>',
description: 'This is a plan template for a plan',
discountRate: 0.1,
discountAmount: 10000,
items: [
{
basePrice: 10000,
price: 120000,
appointmentTypeId: '<string>',
billableItemId: '<string>',
providerId: '<string>',
sortOrder: 1
}
]
})
};
fetch('https://api.halth.com/v1/organisations/{organisationId}/plans/templates', 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.halth.com/v1/organisations/{organisationId}/plans/templates",
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([
'currency' => 'aud',
'billingType' => 'recurring',
'name' => '<string>',
'description' => 'This is a plan template for a plan',
'discountRate' => 0.1,
'discountAmount' => 10000,
'items' => [
[
'basePrice' => 10000,
'price' => 120000,
'appointmentTypeId' => '<string>',
'billableItemId' => '<string>',
'providerId' => '<string>',
'sortOrder' => 1
]
]
]),
CURLOPT_HTTPHEADER => [
"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.halth.com/v1/organisations/{organisationId}/plans/templates"
payload := strings.NewReader("{\n \"currency\": \"aud\",\n \"billingType\": \"recurring\",\n \"name\": \"<string>\",\n \"description\": \"This is a plan template for a plan\",\n \"discountRate\": 0.1,\n \"discountAmount\": 10000,\n \"items\": [\n {\n \"basePrice\": 10000,\n \"price\": 120000,\n \"appointmentTypeId\": \"<string>\",\n \"billableItemId\": \"<string>\",\n \"providerId\": \"<string>\",\n \"sortOrder\": 1\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
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.halth.com/v1/organisations/{organisationId}/plans/templates")
.header("Content-Type", "application/json")
.body("{\n \"currency\": \"aud\",\n \"billingType\": \"recurring\",\n \"name\": \"<string>\",\n \"description\": \"This is a plan template for a plan\",\n \"discountRate\": 0.1,\n \"discountAmount\": 10000,\n \"items\": [\n {\n \"basePrice\": 10000,\n \"price\": 120000,\n \"appointmentTypeId\": \"<string>\",\n \"billableItemId\": \"<string>\",\n \"providerId\": \"<string>\",\n \"sortOrder\": 1\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.halth.com/v1/organisations/{organisationId}/plans/templates")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"currency\": \"aud\",\n \"billingType\": \"recurring\",\n \"name\": \"<string>\",\n \"description\": \"This is a plan template for a plan\",\n \"discountRate\": 0.1,\n \"discountAmount\": 10000,\n \"items\": [\n {\n \"basePrice\": 10000,\n \"price\": 120000,\n \"appointmentTypeId\": \"<string>\",\n \"billableItemId\": \"<string>\",\n \"providerId\": \"<string>\",\n \"sortOrder\": 1\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"discountRate": 0.1,
"discountAmount": 10000,
"billingType": "recurring",
"popularityRank": 123,
"id": "<string>",
"createdAt": "<string>",
"name": "<string>",
"price": 123,
"currency": "<string>",
"deleted": true,
"items": [
{
"id": "<string>",
"createdAt": "<string>",
"planTemplateId": "<string>",
"sortOrder": 123,
"appointmentTypeId": "<string>",
"providerId": "<string>",
"billableItemId": "<string>",
"basePrice": 123,
"price": 123
}
],
"description": "<string>"
}Path Parameters
Body
application/json
The currency of the plan template
Required string length:
3Example:
"aud"
Whether the plan is intended to be billed as a one-off or on a recurring basis.
Available options:
one_off, recurring Example:
"recurring"
Maximum string length:
500The description of the plan template
Maximum string length:
500Example:
"This is a plan template for a plan"
The discount rate applied to the plan, as a fraction between 0 and 1.
Required range:
0 <= x <= 1Example:
0.1
The discount amount applied to the plan, in cents.
Required range:
0 <= x <= 5000000Example:
10000
Show child attributes
Show child attributes
Response
201 - application/json
The discount rate applied to the plan, as a fraction between 0 and 1.
Example:
0.1
The discount amount applied to the plan, in cents.
Example:
10000
Whether the plan is intended to be billed as a one-off or on a recurring basis.
Available options:
one_off, recurring Example:
"recurring"
Based on the number of subscriptions created from this plan template. Used for ranking plans by popularity.
Show child attributes
Show child attributes
⌘I
