curl --request POST \
--url https://api.halth.com/v1/plans/templates/links/{secret}/transactions \
--header 'Content-Type: application/json' \
--data '
{
"client": {
"mobileNumber": "+61412345678",
"dateOfBirth": "1990-01-01",
"firstName": "<string>",
"lastName": "<string>",
"email": "jsmith@example.com"
},
"confirmationTokenId": "<string>",
"customerId": "<string>"
}
'import requests
url = "https://api.halth.com/v1/plans/templates/links/{secret}/transactions"
payload = {
"client": {
"mobileNumber": "+61412345678",
"dateOfBirth": "1990-01-01",
"firstName": "<string>",
"lastName": "<string>",
"email": "jsmith@example.com"
},
"confirmationTokenId": "<string>",
"customerId": "<string>"
}
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({
client: {
mobileNumber: '+61412345678',
dateOfBirth: '1990-01-01',
firstName: '<string>',
lastName: '<string>',
email: 'jsmith@example.com'
},
confirmationTokenId: '<string>',
customerId: '<string>'
})
};
fetch('https://api.halth.com/v1/plans/templates/links/{secret}/transactions', 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/plans/templates/links/{secret}/transactions",
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([
'client' => [
'mobileNumber' => '+61412345678',
'dateOfBirth' => '1990-01-01',
'firstName' => '<string>',
'lastName' => '<string>',
'email' => 'jsmith@example.com'
],
'confirmationTokenId' => '<string>',
'customerId' => '<string>'
]),
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/plans/templates/links/{secret}/transactions"
payload := strings.NewReader("{\n \"client\": {\n \"mobileNumber\": \"+61412345678\",\n \"dateOfBirth\": \"1990-01-01\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"email\": \"jsmith@example.com\"\n },\n \"confirmationTokenId\": \"<string>\",\n \"customerId\": \"<string>\"\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/plans/templates/links/{secret}/transactions")
.header("Content-Type", "application/json")
.body("{\n \"client\": {\n \"mobileNumber\": \"+61412345678\",\n \"dateOfBirth\": \"1990-01-01\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"email\": \"jsmith@example.com\"\n },\n \"confirmationTokenId\": \"<string>\",\n \"customerId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.halth.com/v1/plans/templates/links/{secret}/transactions")
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 \"client\": {\n \"mobileNumber\": \"+61412345678\",\n \"dateOfBirth\": \"1990-01-01\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"email\": \"jsmith@example.com\"\n },\n \"confirmationTokenId\": \"<string>\",\n \"customerId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"billingType": "one_off",
"id": "<string>",
"createdAt": "<string>",
"clientId": "<string>",
"plan": {
"planTemplateId": "<string>",
"name": "<string>",
"discountRate": 123,
"discountAmount": 123,
"items": [
{
"id": "<string>",
"createdAt": "<string>",
"clientPlanId": "<string>",
"planTemplateItemId": "<string>",
"appointmentTypeId": "<string>",
"providerId": "<string>",
"billableItemId": "<string>",
"basePrice": 123,
"price": 123,
"taxRate": 123,
"currency": "<string>",
"name": "<string>"
}
]
},
"client": {
"id": "<string>",
"deleted": true,
"createdAt": "2023-11-07T05:31:56Z",
"memberId": "memb_38JiySr0Z0ePjHpqvosimyLQuUC",
"firstName": "<string>",
"lastName": "<string>",
"dateOfBirth": "<string>",
"mobileNumber": "<string>",
"email": "<string>",
"pmsPatientId": "<string>",
"pmsCreatedAt": "2023-11-07T05:31:56Z",
"profileImageUrl": "<string>"
},
"organisation": {
"id": "org_31XEcUshz1ymodA14HALnyP48g1",
"name": "Acme Healthcare",
"slug": "acme-healthcare",
"createdAt": "2023-01-15T10:30:00Z",
"bookingsEnabled": true,
"brandImageUrl": "https://example.com/brand-image.png",
"wordmarkImageUrl": "https://example.com/wordmark-image.png",
"websiteUrl": "https://example.com"
},
"business": {
"id": "<string>",
"name": "<string>",
"settings": {
"autoReconciliationEnabled": true,
"autoInviteClientsEnabled": true
},
"createdAt": "2023-11-07T05:31:56Z",
"taxIdentifier": "<string>",
"countryCode": "<string>",
"merchantId": "<string>",
"capabilities": [
{}
],
"events": {},
"websiteUrl": "<string>",
"brandImageUrl": "<string>",
"address": {
"line1": "<string>",
"line2": "<string>",
"suburb": "<string>",
"city": "<string>",
"state": "<string>",
"postcode": "<string>",
"country": "<string>",
"countryCode": "<string>"
}
},
"bookingCredits": [
{
"id": "<string>",
"clientPlanId": "<string>",
"clientPlanItemId": "<string>",
"appointmentTypeId": "<string>",
"price": 123,
"currency": "<string>",
"paidAt": "2023-11-07T05:31:56Z",
"bookedAt": "2023-11-07T05:31:56Z",
"redeemedAt": "2023-11-07T05:31:56Z",
"isPaid": true,
"isBooked": true
}
],
"charges": [
{
"id": "<string>",
"clientPlanId": "<string>",
"cycleNumber": 123,
"amount": 123,
"currency": "<string>",
"businessTransactionId": "<string>"
}
],
"subscription": {
"cyclesCompleted": 123,
"startsAt": "<string>",
"billingIntervalCount": 123,
"billingCycleCount": 123,
"endsAt": "<string>",
"nextBillingAt": "2023-11-07T05:31:56Z"
}
}Purchase a shared plan
Purchase the plan behind a shareable link. Resolves or creates the client from the buyer’s mobile number and date of birth, then creates and charges their plan. The plan is only usable once payment is confirmed.
curl --request POST \
--url https://api.halth.com/v1/plans/templates/links/{secret}/transactions \
--header 'Content-Type: application/json' \
--data '
{
"client": {
"mobileNumber": "+61412345678",
"dateOfBirth": "1990-01-01",
"firstName": "<string>",
"lastName": "<string>",
"email": "jsmith@example.com"
},
"confirmationTokenId": "<string>",
"customerId": "<string>"
}
'import requests
url = "https://api.halth.com/v1/plans/templates/links/{secret}/transactions"
payload = {
"client": {
"mobileNumber": "+61412345678",
"dateOfBirth": "1990-01-01",
"firstName": "<string>",
"lastName": "<string>",
"email": "jsmith@example.com"
},
"confirmationTokenId": "<string>",
"customerId": "<string>"
}
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({
client: {
mobileNumber: '+61412345678',
dateOfBirth: '1990-01-01',
firstName: '<string>',
lastName: '<string>',
email: 'jsmith@example.com'
},
confirmationTokenId: '<string>',
customerId: '<string>'
})
};
fetch('https://api.halth.com/v1/plans/templates/links/{secret}/transactions', 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/plans/templates/links/{secret}/transactions",
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([
'client' => [
'mobileNumber' => '+61412345678',
'dateOfBirth' => '1990-01-01',
'firstName' => '<string>',
'lastName' => '<string>',
'email' => 'jsmith@example.com'
],
'confirmationTokenId' => '<string>',
'customerId' => '<string>'
]),
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/plans/templates/links/{secret}/transactions"
payload := strings.NewReader("{\n \"client\": {\n \"mobileNumber\": \"+61412345678\",\n \"dateOfBirth\": \"1990-01-01\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"email\": \"jsmith@example.com\"\n },\n \"confirmationTokenId\": \"<string>\",\n \"customerId\": \"<string>\"\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/plans/templates/links/{secret}/transactions")
.header("Content-Type", "application/json")
.body("{\n \"client\": {\n \"mobileNumber\": \"+61412345678\",\n \"dateOfBirth\": \"1990-01-01\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"email\": \"jsmith@example.com\"\n },\n \"confirmationTokenId\": \"<string>\",\n \"customerId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.halth.com/v1/plans/templates/links/{secret}/transactions")
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 \"client\": {\n \"mobileNumber\": \"+61412345678\",\n \"dateOfBirth\": \"1990-01-01\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"email\": \"jsmith@example.com\"\n },\n \"confirmationTokenId\": \"<string>\",\n \"customerId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"billingType": "one_off",
"id": "<string>",
"createdAt": "<string>",
"clientId": "<string>",
"plan": {
"planTemplateId": "<string>",
"name": "<string>",
"discountRate": 123,
"discountAmount": 123,
"items": [
{
"id": "<string>",
"createdAt": "<string>",
"clientPlanId": "<string>",
"planTemplateItemId": "<string>",
"appointmentTypeId": "<string>",
"providerId": "<string>",
"billableItemId": "<string>",
"basePrice": 123,
"price": 123,
"taxRate": 123,
"currency": "<string>",
"name": "<string>"
}
]
},
"client": {
"id": "<string>",
"deleted": true,
"createdAt": "2023-11-07T05:31:56Z",
"memberId": "memb_38JiySr0Z0ePjHpqvosimyLQuUC",
"firstName": "<string>",
"lastName": "<string>",
"dateOfBirth": "<string>",
"mobileNumber": "<string>",
"email": "<string>",
"pmsPatientId": "<string>",
"pmsCreatedAt": "2023-11-07T05:31:56Z",
"profileImageUrl": "<string>"
},
"organisation": {
"id": "org_31XEcUshz1ymodA14HALnyP48g1",
"name": "Acme Healthcare",
"slug": "acme-healthcare",
"createdAt": "2023-01-15T10:30:00Z",
"bookingsEnabled": true,
"brandImageUrl": "https://example.com/brand-image.png",
"wordmarkImageUrl": "https://example.com/wordmark-image.png",
"websiteUrl": "https://example.com"
},
"business": {
"id": "<string>",
"name": "<string>",
"settings": {
"autoReconciliationEnabled": true,
"autoInviteClientsEnabled": true
},
"createdAt": "2023-11-07T05:31:56Z",
"taxIdentifier": "<string>",
"countryCode": "<string>",
"merchantId": "<string>",
"capabilities": [
{}
],
"events": {},
"websiteUrl": "<string>",
"brandImageUrl": "<string>",
"address": {
"line1": "<string>",
"line2": "<string>",
"suburb": "<string>",
"city": "<string>",
"state": "<string>",
"postcode": "<string>",
"country": "<string>",
"countryCode": "<string>"
}
},
"bookingCredits": [
{
"id": "<string>",
"clientPlanId": "<string>",
"clientPlanItemId": "<string>",
"appointmentTypeId": "<string>",
"price": 123,
"currency": "<string>",
"paidAt": "2023-11-07T05:31:56Z",
"bookedAt": "2023-11-07T05:31:56Z",
"redeemedAt": "2023-11-07T05:31:56Z",
"isPaid": true,
"isBooked": true
}
],
"charges": [
{
"id": "<string>",
"clientPlanId": "<string>",
"cycleNumber": 123,
"amount": 123,
"currency": "<string>",
"businessTransactionId": "<string>"
}
],
"subscription": {
"cyclesCompleted": 123,
"startsAt": "<string>",
"billingIntervalCount": 123,
"billingCycleCount": 123,
"endsAt": "<string>",
"nextBillingAt": "2023-11-07T05:31:56Z"
}
}Path Parameters
Body
The buyer identity.
Show child attributes
Show child attributes
A Stripe confirmation token for the buyer card, resolved into a saved payment method before charging.
Optional Stripe customer id the payment method belongs to. Defaults to the client wallet customer.
Response
Whether the plan is billed as a one-off or on a recurring basis. Recurring when the plan has a subscription.
one_off, recurring "one_off"
created, active, inactive, paused, cancelled, past_due, completed Show child attributes
Show child attributes
Expandable field
Show child attributes
Show child attributes
Expandable field
Show child attributes
Show child attributes
Expandable field
Show child attributes
Show child attributes
Expandable field
Show child attributes
Show child attributes
Expandable field
Show child attributes
Show child attributes
Show child attributes
Show child attributes
