curl --request POST \
--url https://{clinic}.{region}.practicehub.io/v3/api/line_items \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"invoice_id": 2,
"description": "<string>",
"quantity": 1073741824,
"price": "45.00",
"billable_item_id": 2,
"provider_id": 123,
"metadata": {}
}
'import requests
url = "https://{clinic}.{region}.practicehub.io/v3/api/line_items"
payload = {
"invoice_id": 2,
"description": "<string>",
"quantity": 1073741824,
"price": "45.00",
"billable_item_id": 2,
"provider_id": 123,
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
invoice_id: 2,
description: '<string>',
quantity: 1073741824,
price: '45.00',
billable_item_id: 2,
provider_id: 123,
metadata: {}
})
};
fetch('https://{clinic}.{region}.practicehub.io/v3/api/line_items', 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://{clinic}.{region}.practicehub.io/v3/api/line_items",
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([
'invoice_id' => 2,
'description' => '<string>',
'quantity' => 1073741824,
'price' => '45.00',
'billable_item_id' => 2,
'provider_id' => 123,
'metadata' => [
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{clinic}.{region}.practicehub.io/v3/api/line_items"
payload := strings.NewReader("{\n \"invoice_id\": 2,\n \"description\": \"<string>\",\n \"quantity\": 1073741824,\n \"price\": \"45.00\",\n \"billable_item_id\": 2,\n \"provider_id\": 123,\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://{clinic}.{region}.practicehub.io/v3/api/line_items")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"invoice_id\": 2,\n \"description\": \"<string>\",\n \"quantity\": 1073741824,\n \"price\": \"45.00\",\n \"billable_item_id\": 2,\n \"provider_id\": 123,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{clinic}.{region}.practicehub.io/v3/api/line_items")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"invoice_id\": 2,\n \"description\": \"<string>\",\n \"quantity\": 1073741824,\n \"price\": \"45.00\",\n \"billable_item_id\": 2,\n \"provider_id\": 123,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 501,
"invoice_id": 98,
"billable_item_id": 17,
"provider_id": 12,
"provider_type": "chiropractor",
"description": "Initial consultation",
"quantity": 1,
"currency": "GBP",
"price": "65.00",
"tax_amount": "0.00",
"subtotal": "65.00",
"total": "65.00",
"updated_at": "2026-09-01T14:30:00Z",
"created_at": "2026-09-01T09:15:00Z"
}
}{
"message": "<string>",
"code": "<string>",
"errors": {}
}{
"message": "<string>",
"code": "<string>",
"errors": {}
}{
"message": "<string>",
"code": "<string>",
"errors": {}
}{
"message": "<string>",
"code": "<string>",
"errors": {}
}Create line_items
curl --request POST \
--url https://{clinic}.{region}.practicehub.io/v3/api/line_items \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"invoice_id": 2,
"description": "<string>",
"quantity": 1073741824,
"price": "45.00",
"billable_item_id": 2,
"provider_id": 123,
"metadata": {}
}
'import requests
url = "https://{clinic}.{region}.practicehub.io/v3/api/line_items"
payload = {
"invoice_id": 2,
"description": "<string>",
"quantity": 1073741824,
"price": "45.00",
"billable_item_id": 2,
"provider_id": 123,
"metadata": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
invoice_id: 2,
description: '<string>',
quantity: 1073741824,
price: '45.00',
billable_item_id: 2,
provider_id: 123,
metadata: {}
})
};
fetch('https://{clinic}.{region}.practicehub.io/v3/api/line_items', 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://{clinic}.{region}.practicehub.io/v3/api/line_items",
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([
'invoice_id' => 2,
'description' => '<string>',
'quantity' => 1073741824,
'price' => '45.00',
'billable_item_id' => 2,
'provider_id' => 123,
'metadata' => [
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{clinic}.{region}.practicehub.io/v3/api/line_items"
payload := strings.NewReader("{\n \"invoice_id\": 2,\n \"description\": \"<string>\",\n \"quantity\": 1073741824,\n \"price\": \"45.00\",\n \"billable_item_id\": 2,\n \"provider_id\": 123,\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://{clinic}.{region}.practicehub.io/v3/api/line_items")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"invoice_id\": 2,\n \"description\": \"<string>\",\n \"quantity\": 1073741824,\n \"price\": \"45.00\",\n \"billable_item_id\": 2,\n \"provider_id\": 123,\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{clinic}.{region}.practicehub.io/v3/api/line_items")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"invoice_id\": 2,\n \"description\": \"<string>\",\n \"quantity\": 1073741824,\n \"price\": \"45.00\",\n \"billable_item_id\": 2,\n \"provider_id\": 123,\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": 501,
"invoice_id": 98,
"billable_item_id": 17,
"provider_id": 12,
"provider_type": "chiropractor",
"description": "Initial consultation",
"quantity": 1,
"currency": "GBP",
"price": "65.00",
"tax_amount": "0.00",
"subtotal": "65.00",
"total": "65.00",
"updated_at": "2026-09-01T14:30:00Z",
"created_at": "2026-09-01T09:15:00Z"
}
}{
"message": "<string>",
"code": "<string>",
"errors": {}
}{
"message": "<string>",
"code": "<string>",
"errors": {}
}{
"message": "<string>",
"code": "<string>",
"errors": {}
}{
"message": "<string>",
"code": "<string>",
"errors": {}
}Authorizations
API key from Developers → API Keys, sent as Authorization: Bearer .
Headers
Any unique string (≤255 chars). A retry with the same key within 24 hours replays the original response (Idempotent-Replayed: true) instead of creating a second record.
255Body
- Add one line
- Add several lines
The invoice the line belongs to. Every invoice keeps at least one line — the last line can't be removed; void the invoice instead.
x >= 1What the line bills for, up to 255 characters.
255Units billed — a whole number, at least 1.
1 <= x <= 2147483647Unit price, 2 dp, within ±99,999,999.99 — negative for a discount or credit line, exactly as on the invoice screen.
^-?\d+(\.\d{1,2})?$"45.00"
The account service or product this line bills — required on every new line. On update, omit it to keep the existing link; a line can never be stripped of its link.
x >= 1The practitioner credited with the line. Defaults to the invoice's practitioner_id when omitted; null is a deliberate no-provider.
Integrator-owned key/value metadata (max 50 keys). Values are strings (≤500 chars), numbers or booleans and read back with the type they were written with. On write, a null value removes the key. Filter with metadata[key]=op:value; number operands compare numerically.
Show child attributes
Show child attributes
Response
The resource
Show child attributes
Show child attributes
{
"id": 501,
"invoice_id": 98,
"billable_item_id": 17,
"provider_id": 12,
"provider_type": "chiropractor",
"description": "Initial consultation",
"quantity": 1,
"currency": "GBP",
"price": "65.00",
"tax_amount": "0.00",
"subtotal": "65.00",
"total": "65.00",
"updated_at": "2026-09-01T14:30:00Z",
"created_at": "2026-09-01T09:15:00Z"
}
Was this page helpful?