curl --request POST \
--url https://api.eka.care/appointments/v1/ipd/admission \
--header 'Content-Type: application/json' \
--header 'auth: <auth>' \
--data '
{
"ipid": "IPD-2026-000481",
"pid": "pid-321",
"patient": {
"id": "pat-77",
"uuid": "9c2d1b6f-0a8e-5d23-8b1a-2c3d4e5f6a7b",
"poid": "poid-555",
"formData": [],
"profile": {
"personal": {
"gender": "M",
"name": "Suresh Kumar"
}
}
},
"attendee": {
"id": "att-01",
"name": "Ramesh Kumar",
"phone": {
"c": "+91",
"n": "9876543210"
},
"relation": {
"id": "rel-son",
"label": "Son"
}
},
"insurance": {
"number": "POL-8891",
"type": "Cashless",
"payment_type": "Insurance",
"insurance_provider": "Star Health",
"pre_approved": true,
"pre_approved_amount": 50000
},
"refer": {
"id": "ref-01",
"name": "Dr. Anita Rao"
},
"doc": {
"id": "doctor-oid-456",
"name": "Dr. Vivek Sharma"
},
"docid": "doctor-oid-456",
"category": {
"id": "cat-icu",
"name": "ICU"
},
"department": {
"id": "dept-med",
"name": "General Medicine"
},
"facility": {
"id": "fac-01",
"name": "Eka General Hospital"
},
"facilityid": "fac-01",
"bed": "ICU-04",
"duration": {
"value": 3,
"unit": "days"
},
"rateplan": {
"id": "rp-standard",
"name": "Standard ICU",
"inclusions": []
},
"stage": "AD",
"status": "BED_ASSIGNED",
"admission_date": "2026-06-28T09:30:00.000Z",
"date": "2026-06-28"
}
'import requests
url = "https://api.eka.care/appointments/v1/ipd/admission"
payload = {
"ipid": "IPD-2026-000481",
"pid": "pid-321",
"patient": {
"id": "pat-77",
"uuid": "9c2d1b6f-0a8e-5d23-8b1a-2c3d4e5f6a7b",
"poid": "poid-555",
"formData": [],
"profile": { "personal": {
"gender": "M",
"name": "Suresh Kumar"
} }
},
"attendee": {
"id": "att-01",
"name": "Ramesh Kumar",
"phone": {
"c": "+91",
"n": "9876543210"
},
"relation": {
"id": "rel-son",
"label": "Son"
}
},
"insurance": {
"number": "POL-8891",
"type": "Cashless",
"payment_type": "Insurance",
"insurance_provider": "Star Health",
"pre_approved": True,
"pre_approved_amount": 50000
},
"refer": {
"id": "ref-01",
"name": "Dr. Anita Rao"
},
"doc": {
"id": "doctor-oid-456",
"name": "Dr. Vivek Sharma"
},
"docid": "doctor-oid-456",
"category": {
"id": "cat-icu",
"name": "ICU"
},
"department": {
"id": "dept-med",
"name": "General Medicine"
},
"facility": {
"id": "fac-01",
"name": "Eka General Hospital"
},
"facilityid": "fac-01",
"bed": "ICU-04",
"duration": {
"value": 3,
"unit": "days"
},
"rateplan": {
"id": "rp-standard",
"name": "Standard ICU",
"inclusions": []
},
"stage": "AD",
"status": "BED_ASSIGNED",
"admission_date": "2026-06-28T09:30:00.000Z",
"date": "2026-06-28"
}
headers = {
"auth": "<auth>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {auth: '<auth>', 'Content-Type': 'application/json'},
body: JSON.stringify({
ipid: 'IPD-2026-000481',
pid: 'pid-321',
patient: {
id: 'pat-77',
uuid: '9c2d1b6f-0a8e-5d23-8b1a-2c3d4e5f6a7b',
poid: 'poid-555',
formData: [],
profile: {personal: {gender: 'M', name: 'Suresh Kumar'}}
},
attendee: {
id: 'att-01',
name: 'Ramesh Kumar',
phone: {c: '+91', n: '9876543210'},
relation: {id: 'rel-son', label: 'Son'}
},
insurance: {
number: 'POL-8891',
type: 'Cashless',
payment_type: 'Insurance',
insurance_provider: 'Star Health',
pre_approved: true,
pre_approved_amount: 50000
},
refer: {id: 'ref-01', name: 'Dr. Anita Rao'},
doc: {id: 'doctor-oid-456', name: 'Dr. Vivek Sharma'},
docid: 'doctor-oid-456',
category: {id: 'cat-icu', name: 'ICU'},
department: {id: 'dept-med', name: 'General Medicine'},
facility: {id: 'fac-01', name: 'Eka General Hospital'},
facilityid: 'fac-01',
bed: 'ICU-04',
duration: {value: 3, unit: 'days'},
rateplan: {id: 'rp-standard', name: 'Standard ICU', inclusions: []},
stage: 'AD',
status: 'BED_ASSIGNED',
admission_date: '2026-06-28T09:30:00.000Z',
date: '2026-06-28'
})
};
fetch('https://api.eka.care/appointments/v1/ipd/admission', 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.eka.care/appointments/v1/ipd/admission",
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([
'ipid' => 'IPD-2026-000481',
'pid' => 'pid-321',
'patient' => [
'id' => 'pat-77',
'uuid' => '9c2d1b6f-0a8e-5d23-8b1a-2c3d4e5f6a7b',
'poid' => 'poid-555',
'formData' => [
],
'profile' => [
'personal' => [
'gender' => 'M',
'name' => 'Suresh Kumar'
]
]
],
'attendee' => [
'id' => 'att-01',
'name' => 'Ramesh Kumar',
'phone' => [
'c' => '+91',
'n' => '9876543210'
],
'relation' => [
'id' => 'rel-son',
'label' => 'Son'
]
],
'insurance' => [
'number' => 'POL-8891',
'type' => 'Cashless',
'payment_type' => 'Insurance',
'insurance_provider' => 'Star Health',
'pre_approved' => true,
'pre_approved_amount' => 50000
],
'refer' => [
'id' => 'ref-01',
'name' => 'Dr. Anita Rao'
],
'doc' => [
'id' => 'doctor-oid-456',
'name' => 'Dr. Vivek Sharma'
],
'docid' => 'doctor-oid-456',
'category' => [
'id' => 'cat-icu',
'name' => 'ICU'
],
'department' => [
'id' => 'dept-med',
'name' => 'General Medicine'
],
'facility' => [
'id' => 'fac-01',
'name' => 'Eka General Hospital'
],
'facilityid' => 'fac-01',
'bed' => 'ICU-04',
'duration' => [
'value' => 3,
'unit' => 'days'
],
'rateplan' => [
'id' => 'rp-standard',
'name' => 'Standard ICU',
'inclusions' => [
]
],
'stage' => 'AD',
'status' => 'BED_ASSIGNED',
'admission_date' => '2026-06-28T09:30:00.000Z',
'date' => '2026-06-28'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"auth: <auth>"
],
]);
$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.eka.care/appointments/v1/ipd/admission"
payload := strings.NewReader("{\n \"ipid\": \"IPD-2026-000481\",\n \"pid\": \"pid-321\",\n \"patient\": {\n \"id\": \"pat-77\",\n \"uuid\": \"9c2d1b6f-0a8e-5d23-8b1a-2c3d4e5f6a7b\",\n \"poid\": \"poid-555\",\n \"formData\": [],\n \"profile\": {\n \"personal\": {\n \"gender\": \"M\",\n \"name\": \"Suresh Kumar\"\n }\n }\n },\n \"attendee\": {\n \"id\": \"att-01\",\n \"name\": \"Ramesh Kumar\",\n \"phone\": {\n \"c\": \"+91\",\n \"n\": \"9876543210\"\n },\n \"relation\": {\n \"id\": \"rel-son\",\n \"label\": \"Son\"\n }\n },\n \"insurance\": {\n \"number\": \"POL-8891\",\n \"type\": \"Cashless\",\n \"payment_type\": \"Insurance\",\n \"insurance_provider\": \"Star Health\",\n \"pre_approved\": true,\n \"pre_approved_amount\": 50000\n },\n \"refer\": {\n \"id\": \"ref-01\",\n \"name\": \"Dr. Anita Rao\"\n },\n \"doc\": {\n \"id\": \"doctor-oid-456\",\n \"name\": \"Dr. Vivek Sharma\"\n },\n \"docid\": \"doctor-oid-456\",\n \"category\": {\n \"id\": \"cat-icu\",\n \"name\": \"ICU\"\n },\n \"department\": {\n \"id\": \"dept-med\",\n \"name\": \"General Medicine\"\n },\n \"facility\": {\n \"id\": \"fac-01\",\n \"name\": \"Eka General Hospital\"\n },\n \"facilityid\": \"fac-01\",\n \"bed\": \"ICU-04\",\n \"duration\": {\n \"value\": 3,\n \"unit\": \"days\"\n },\n \"rateplan\": {\n \"id\": \"rp-standard\",\n \"name\": \"Standard ICU\",\n \"inclusions\": []\n },\n \"stage\": \"AD\",\n \"status\": \"BED_ASSIGNED\",\n \"admission_date\": \"2026-06-28T09:30:00.000Z\",\n \"date\": \"2026-06-28\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("auth", "<auth>")
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.eka.care/appointments/v1/ipd/admission")
.header("auth", "<auth>")
.header("Content-Type", "application/json")
.body("{\n \"ipid\": \"IPD-2026-000481\",\n \"pid\": \"pid-321\",\n \"patient\": {\n \"id\": \"pat-77\",\n \"uuid\": \"9c2d1b6f-0a8e-5d23-8b1a-2c3d4e5f6a7b\",\n \"poid\": \"poid-555\",\n \"formData\": [],\n \"profile\": {\n \"personal\": {\n \"gender\": \"M\",\n \"name\": \"Suresh Kumar\"\n }\n }\n },\n \"attendee\": {\n \"id\": \"att-01\",\n \"name\": \"Ramesh Kumar\",\n \"phone\": {\n \"c\": \"+91\",\n \"n\": \"9876543210\"\n },\n \"relation\": {\n \"id\": \"rel-son\",\n \"label\": \"Son\"\n }\n },\n \"insurance\": {\n \"number\": \"POL-8891\",\n \"type\": \"Cashless\",\n \"payment_type\": \"Insurance\",\n \"insurance_provider\": \"Star Health\",\n \"pre_approved\": true,\n \"pre_approved_amount\": 50000\n },\n \"refer\": {\n \"id\": \"ref-01\",\n \"name\": \"Dr. Anita Rao\"\n },\n \"doc\": {\n \"id\": \"doctor-oid-456\",\n \"name\": \"Dr. Vivek Sharma\"\n },\n \"docid\": \"doctor-oid-456\",\n \"category\": {\n \"id\": \"cat-icu\",\n \"name\": \"ICU\"\n },\n \"department\": {\n \"id\": \"dept-med\",\n \"name\": \"General Medicine\"\n },\n \"facility\": {\n \"id\": \"fac-01\",\n \"name\": \"Eka General Hospital\"\n },\n \"facilityid\": \"fac-01\",\n \"bed\": \"ICU-04\",\n \"duration\": {\n \"value\": 3,\n \"unit\": \"days\"\n },\n \"rateplan\": {\n \"id\": \"rp-standard\",\n \"name\": \"Standard ICU\",\n \"inclusions\": []\n },\n \"stage\": \"AD\",\n \"status\": \"BED_ASSIGNED\",\n \"admission_date\": \"2026-06-28T09:30:00.000Z\",\n \"date\": \"2026-06-28\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eka.care/appointments/v1/ipd/admission")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["auth"] = '<auth>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ipid\": \"IPD-2026-000481\",\n \"pid\": \"pid-321\",\n \"patient\": {\n \"id\": \"pat-77\",\n \"uuid\": \"9c2d1b6f-0a8e-5d23-8b1a-2c3d4e5f6a7b\",\n \"poid\": \"poid-555\",\n \"formData\": [],\n \"profile\": {\n \"personal\": {\n \"gender\": \"M\",\n \"name\": \"Suresh Kumar\"\n }\n }\n },\n \"attendee\": {\n \"id\": \"att-01\",\n \"name\": \"Ramesh Kumar\",\n \"phone\": {\n \"c\": \"+91\",\n \"n\": \"9876543210\"\n },\n \"relation\": {\n \"id\": \"rel-son\",\n \"label\": \"Son\"\n }\n },\n \"insurance\": {\n \"number\": \"POL-8891\",\n \"type\": \"Cashless\",\n \"payment_type\": \"Insurance\",\n \"insurance_provider\": \"Star Health\",\n \"pre_approved\": true,\n \"pre_approved_amount\": 50000\n },\n \"refer\": {\n \"id\": \"ref-01\",\n \"name\": \"Dr. Anita Rao\"\n },\n \"doc\": {\n \"id\": \"doctor-oid-456\",\n \"name\": \"Dr. Vivek Sharma\"\n },\n \"docid\": \"doctor-oid-456\",\n \"category\": {\n \"id\": \"cat-icu\",\n \"name\": \"ICU\"\n },\n \"department\": {\n \"id\": \"dept-med\",\n \"name\": \"General Medicine\"\n },\n \"facility\": {\n \"id\": \"fac-01\",\n \"name\": \"Eka General Hospital\"\n },\n \"facilityid\": \"fac-01\",\n \"bed\": \"ICU-04\",\n \"duration\": {\n \"value\": 3,\n \"unit\": \"days\"\n },\n \"rateplan\": {\n \"id\": \"rp-standard\",\n \"name\": \"Standard ICU\",\n \"inclusions\": []\n },\n \"stage\": \"AD\",\n \"status\": \"BED_ASSIGNED\",\n \"admission_date\": \"2026-06-28T09:30:00.000Z\",\n \"date\": \"2026-06-28\"\n}"
response = http.request(request)
puts response.read_body{
"id": "adm-3f9c2b18-7e44-4a51",
"bid": "123456",
"admission_date": "2026-06-28T09:30:00.000Z",
"ipid": "IPD-2026-000481",
"attendee": {
"id": "att-01",
"name": "Ramesh Kumar",
"phone": {
"c": "+91",
"n": "9876543210"
},
"relation": {
"id": "rel-son",
"label": "Son"
}
},
"patient": {
"id": "pat-77",
"uuid": "9c2d1b6f-0a8e-5d23-8b1a-2c3d4e5f6a7b",
"poid": "poid-555",
"formData": [],
"profile": {
"personal": {
"gender": "M",
"name": "Suresh Kumar"
}
}
},
"insurance": {
"number": "POL-8891",
"type": "Cashless",
"payment_type": "Insurance",
"insurance_provider": "Star Health",
"pre_approved": true,
"pre_approved_amount": 50000
},
"refer": {
"id": "ref-01",
"name": "Dr. Anita Rao"
},
"doc": {
"id": "doctor-oid-456",
"name": "Dr. Vivek Sharma"
},
"stage": "AD",
"status": "BED_ASSIGNED",
"duration": {
"value": 3,
"unit": "days"
},
"bed": "ICU-04",
"rateplan": {
"id": "rp-standard",
"name": "Standard ICU",
"inclusions": []
},
"docid": "doctor-oid-456",
"category": {
"id": "cat-icu",
"name": "ICU"
},
"date": "2026-06-28",
"department": {
"id": "dept-med",
"name": "General Medicine"
},
"pid": "pid-321",
"created_at": "2026-06-28T09:30:00.000Z",
"updated_at": "2026-06-28T09:30:00.000Z",
"facility": {
"id": "fac-01",
"name": "Eka General Hospital"
},
"facilityid": "fac-01",
"totalbilled": 0,
"totalpaid": 0,
"actor_oid": "operator-oid-789"
}{
"message": "body/ipid must NOT have fewer than 1 characters"
}{
"message": "unauthenticated"
}Create IPD Admission
Overview
This API creates a single IPD (In-Patient Department) admission, scoped to the caller’s business (b-id). An admission document captures the full in-patient episode — the patient, their attendee, insurance, bed and rateplan, the responsible doctor/department/facility, and the admission’s lifecycle state.
The admission id is server-generated and the acting oid (from the auth header) is recorded as actor_oid; neither is accepted in the request body. The billing totals (totalbilled/totalpaid), timestamps (created_at/updated_at) and archived flag are also owned by the server and must not be supplied.
The admission’s lifecycle is tracked with two fields: a coarse stage (IN → Recommended Admission, AD → active Admission, DC → Discharged) and a granular status within that stage. When omitted, stage defaults to the active inpatient stage (AD) and status defaults to BED_ASSIGNED.
The admission_date and date fields are optional ISO-8601 date-time strings and default to the server now when omitted. All timestamp fields are returned as ISO-8601 date-time strings.
Not every detail is mandatory: insurance, procedures, notes, medico_legal_case and custom_attributes are all optional.
curl --request POST \
--url https://api.eka.care/appointments/v1/ipd/admission \
--header 'Content-Type: application/json' \
--header 'auth: <auth>' \
--data '
{
"ipid": "IPD-2026-000481",
"pid": "pid-321",
"patient": {
"id": "pat-77",
"uuid": "9c2d1b6f-0a8e-5d23-8b1a-2c3d4e5f6a7b",
"poid": "poid-555",
"formData": [],
"profile": {
"personal": {
"gender": "M",
"name": "Suresh Kumar"
}
}
},
"attendee": {
"id": "att-01",
"name": "Ramesh Kumar",
"phone": {
"c": "+91",
"n": "9876543210"
},
"relation": {
"id": "rel-son",
"label": "Son"
}
},
"insurance": {
"number": "POL-8891",
"type": "Cashless",
"payment_type": "Insurance",
"insurance_provider": "Star Health",
"pre_approved": true,
"pre_approved_amount": 50000
},
"refer": {
"id": "ref-01",
"name": "Dr. Anita Rao"
},
"doc": {
"id": "doctor-oid-456",
"name": "Dr. Vivek Sharma"
},
"docid": "doctor-oid-456",
"category": {
"id": "cat-icu",
"name": "ICU"
},
"department": {
"id": "dept-med",
"name": "General Medicine"
},
"facility": {
"id": "fac-01",
"name": "Eka General Hospital"
},
"facilityid": "fac-01",
"bed": "ICU-04",
"duration": {
"value": 3,
"unit": "days"
},
"rateplan": {
"id": "rp-standard",
"name": "Standard ICU",
"inclusions": []
},
"stage": "AD",
"status": "BED_ASSIGNED",
"admission_date": "2026-06-28T09:30:00.000Z",
"date": "2026-06-28"
}
'import requests
url = "https://api.eka.care/appointments/v1/ipd/admission"
payload = {
"ipid": "IPD-2026-000481",
"pid": "pid-321",
"patient": {
"id": "pat-77",
"uuid": "9c2d1b6f-0a8e-5d23-8b1a-2c3d4e5f6a7b",
"poid": "poid-555",
"formData": [],
"profile": { "personal": {
"gender": "M",
"name": "Suresh Kumar"
} }
},
"attendee": {
"id": "att-01",
"name": "Ramesh Kumar",
"phone": {
"c": "+91",
"n": "9876543210"
},
"relation": {
"id": "rel-son",
"label": "Son"
}
},
"insurance": {
"number": "POL-8891",
"type": "Cashless",
"payment_type": "Insurance",
"insurance_provider": "Star Health",
"pre_approved": True,
"pre_approved_amount": 50000
},
"refer": {
"id": "ref-01",
"name": "Dr. Anita Rao"
},
"doc": {
"id": "doctor-oid-456",
"name": "Dr. Vivek Sharma"
},
"docid": "doctor-oid-456",
"category": {
"id": "cat-icu",
"name": "ICU"
},
"department": {
"id": "dept-med",
"name": "General Medicine"
},
"facility": {
"id": "fac-01",
"name": "Eka General Hospital"
},
"facilityid": "fac-01",
"bed": "ICU-04",
"duration": {
"value": 3,
"unit": "days"
},
"rateplan": {
"id": "rp-standard",
"name": "Standard ICU",
"inclusions": []
},
"stage": "AD",
"status": "BED_ASSIGNED",
"admission_date": "2026-06-28T09:30:00.000Z",
"date": "2026-06-28"
}
headers = {
"auth": "<auth>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {auth: '<auth>', 'Content-Type': 'application/json'},
body: JSON.stringify({
ipid: 'IPD-2026-000481',
pid: 'pid-321',
patient: {
id: 'pat-77',
uuid: '9c2d1b6f-0a8e-5d23-8b1a-2c3d4e5f6a7b',
poid: 'poid-555',
formData: [],
profile: {personal: {gender: 'M', name: 'Suresh Kumar'}}
},
attendee: {
id: 'att-01',
name: 'Ramesh Kumar',
phone: {c: '+91', n: '9876543210'},
relation: {id: 'rel-son', label: 'Son'}
},
insurance: {
number: 'POL-8891',
type: 'Cashless',
payment_type: 'Insurance',
insurance_provider: 'Star Health',
pre_approved: true,
pre_approved_amount: 50000
},
refer: {id: 'ref-01', name: 'Dr. Anita Rao'},
doc: {id: 'doctor-oid-456', name: 'Dr. Vivek Sharma'},
docid: 'doctor-oid-456',
category: {id: 'cat-icu', name: 'ICU'},
department: {id: 'dept-med', name: 'General Medicine'},
facility: {id: 'fac-01', name: 'Eka General Hospital'},
facilityid: 'fac-01',
bed: 'ICU-04',
duration: {value: 3, unit: 'days'},
rateplan: {id: 'rp-standard', name: 'Standard ICU', inclusions: []},
stage: 'AD',
status: 'BED_ASSIGNED',
admission_date: '2026-06-28T09:30:00.000Z',
date: '2026-06-28'
})
};
fetch('https://api.eka.care/appointments/v1/ipd/admission', 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.eka.care/appointments/v1/ipd/admission",
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([
'ipid' => 'IPD-2026-000481',
'pid' => 'pid-321',
'patient' => [
'id' => 'pat-77',
'uuid' => '9c2d1b6f-0a8e-5d23-8b1a-2c3d4e5f6a7b',
'poid' => 'poid-555',
'formData' => [
],
'profile' => [
'personal' => [
'gender' => 'M',
'name' => 'Suresh Kumar'
]
]
],
'attendee' => [
'id' => 'att-01',
'name' => 'Ramesh Kumar',
'phone' => [
'c' => '+91',
'n' => '9876543210'
],
'relation' => [
'id' => 'rel-son',
'label' => 'Son'
]
],
'insurance' => [
'number' => 'POL-8891',
'type' => 'Cashless',
'payment_type' => 'Insurance',
'insurance_provider' => 'Star Health',
'pre_approved' => true,
'pre_approved_amount' => 50000
],
'refer' => [
'id' => 'ref-01',
'name' => 'Dr. Anita Rao'
],
'doc' => [
'id' => 'doctor-oid-456',
'name' => 'Dr. Vivek Sharma'
],
'docid' => 'doctor-oid-456',
'category' => [
'id' => 'cat-icu',
'name' => 'ICU'
],
'department' => [
'id' => 'dept-med',
'name' => 'General Medicine'
],
'facility' => [
'id' => 'fac-01',
'name' => 'Eka General Hospital'
],
'facilityid' => 'fac-01',
'bed' => 'ICU-04',
'duration' => [
'value' => 3,
'unit' => 'days'
],
'rateplan' => [
'id' => 'rp-standard',
'name' => 'Standard ICU',
'inclusions' => [
]
],
'stage' => 'AD',
'status' => 'BED_ASSIGNED',
'admission_date' => '2026-06-28T09:30:00.000Z',
'date' => '2026-06-28'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"auth: <auth>"
],
]);
$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.eka.care/appointments/v1/ipd/admission"
payload := strings.NewReader("{\n \"ipid\": \"IPD-2026-000481\",\n \"pid\": \"pid-321\",\n \"patient\": {\n \"id\": \"pat-77\",\n \"uuid\": \"9c2d1b6f-0a8e-5d23-8b1a-2c3d4e5f6a7b\",\n \"poid\": \"poid-555\",\n \"formData\": [],\n \"profile\": {\n \"personal\": {\n \"gender\": \"M\",\n \"name\": \"Suresh Kumar\"\n }\n }\n },\n \"attendee\": {\n \"id\": \"att-01\",\n \"name\": \"Ramesh Kumar\",\n \"phone\": {\n \"c\": \"+91\",\n \"n\": \"9876543210\"\n },\n \"relation\": {\n \"id\": \"rel-son\",\n \"label\": \"Son\"\n }\n },\n \"insurance\": {\n \"number\": \"POL-8891\",\n \"type\": \"Cashless\",\n \"payment_type\": \"Insurance\",\n \"insurance_provider\": \"Star Health\",\n \"pre_approved\": true,\n \"pre_approved_amount\": 50000\n },\n \"refer\": {\n \"id\": \"ref-01\",\n \"name\": \"Dr. Anita Rao\"\n },\n \"doc\": {\n \"id\": \"doctor-oid-456\",\n \"name\": \"Dr. Vivek Sharma\"\n },\n \"docid\": \"doctor-oid-456\",\n \"category\": {\n \"id\": \"cat-icu\",\n \"name\": \"ICU\"\n },\n \"department\": {\n \"id\": \"dept-med\",\n \"name\": \"General Medicine\"\n },\n \"facility\": {\n \"id\": \"fac-01\",\n \"name\": \"Eka General Hospital\"\n },\n \"facilityid\": \"fac-01\",\n \"bed\": \"ICU-04\",\n \"duration\": {\n \"value\": 3,\n \"unit\": \"days\"\n },\n \"rateplan\": {\n \"id\": \"rp-standard\",\n \"name\": \"Standard ICU\",\n \"inclusions\": []\n },\n \"stage\": \"AD\",\n \"status\": \"BED_ASSIGNED\",\n \"admission_date\": \"2026-06-28T09:30:00.000Z\",\n \"date\": \"2026-06-28\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("auth", "<auth>")
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.eka.care/appointments/v1/ipd/admission")
.header("auth", "<auth>")
.header("Content-Type", "application/json")
.body("{\n \"ipid\": \"IPD-2026-000481\",\n \"pid\": \"pid-321\",\n \"patient\": {\n \"id\": \"pat-77\",\n \"uuid\": \"9c2d1b6f-0a8e-5d23-8b1a-2c3d4e5f6a7b\",\n \"poid\": \"poid-555\",\n \"formData\": [],\n \"profile\": {\n \"personal\": {\n \"gender\": \"M\",\n \"name\": \"Suresh Kumar\"\n }\n }\n },\n \"attendee\": {\n \"id\": \"att-01\",\n \"name\": \"Ramesh Kumar\",\n \"phone\": {\n \"c\": \"+91\",\n \"n\": \"9876543210\"\n },\n \"relation\": {\n \"id\": \"rel-son\",\n \"label\": \"Son\"\n }\n },\n \"insurance\": {\n \"number\": \"POL-8891\",\n \"type\": \"Cashless\",\n \"payment_type\": \"Insurance\",\n \"insurance_provider\": \"Star Health\",\n \"pre_approved\": true,\n \"pre_approved_amount\": 50000\n },\n \"refer\": {\n \"id\": \"ref-01\",\n \"name\": \"Dr. Anita Rao\"\n },\n \"doc\": {\n \"id\": \"doctor-oid-456\",\n \"name\": \"Dr. Vivek Sharma\"\n },\n \"docid\": \"doctor-oid-456\",\n \"category\": {\n \"id\": \"cat-icu\",\n \"name\": \"ICU\"\n },\n \"department\": {\n \"id\": \"dept-med\",\n \"name\": \"General Medicine\"\n },\n \"facility\": {\n \"id\": \"fac-01\",\n \"name\": \"Eka General Hospital\"\n },\n \"facilityid\": \"fac-01\",\n \"bed\": \"ICU-04\",\n \"duration\": {\n \"value\": 3,\n \"unit\": \"days\"\n },\n \"rateplan\": {\n \"id\": \"rp-standard\",\n \"name\": \"Standard ICU\",\n \"inclusions\": []\n },\n \"stage\": \"AD\",\n \"status\": \"BED_ASSIGNED\",\n \"admission_date\": \"2026-06-28T09:30:00.000Z\",\n \"date\": \"2026-06-28\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eka.care/appointments/v1/ipd/admission")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["auth"] = '<auth>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ipid\": \"IPD-2026-000481\",\n \"pid\": \"pid-321\",\n \"patient\": {\n \"id\": \"pat-77\",\n \"uuid\": \"9c2d1b6f-0a8e-5d23-8b1a-2c3d4e5f6a7b\",\n \"poid\": \"poid-555\",\n \"formData\": [],\n \"profile\": {\n \"personal\": {\n \"gender\": \"M\",\n \"name\": \"Suresh Kumar\"\n }\n }\n },\n \"attendee\": {\n \"id\": \"att-01\",\n \"name\": \"Ramesh Kumar\",\n \"phone\": {\n \"c\": \"+91\",\n \"n\": \"9876543210\"\n },\n \"relation\": {\n \"id\": \"rel-son\",\n \"label\": \"Son\"\n }\n },\n \"insurance\": {\n \"number\": \"POL-8891\",\n \"type\": \"Cashless\",\n \"payment_type\": \"Insurance\",\n \"insurance_provider\": \"Star Health\",\n \"pre_approved\": true,\n \"pre_approved_amount\": 50000\n },\n \"refer\": {\n \"id\": \"ref-01\",\n \"name\": \"Dr. Anita Rao\"\n },\n \"doc\": {\n \"id\": \"doctor-oid-456\",\n \"name\": \"Dr. Vivek Sharma\"\n },\n \"docid\": \"doctor-oid-456\",\n \"category\": {\n \"id\": \"cat-icu\",\n \"name\": \"ICU\"\n },\n \"department\": {\n \"id\": \"dept-med\",\n \"name\": \"General Medicine\"\n },\n \"facility\": {\n \"id\": \"fac-01\",\n \"name\": \"Eka General Hospital\"\n },\n \"facilityid\": \"fac-01\",\n \"bed\": \"ICU-04\",\n \"duration\": {\n \"value\": 3,\n \"unit\": \"days\"\n },\n \"rateplan\": {\n \"id\": \"rp-standard\",\n \"name\": \"Standard ICU\",\n \"inclusions\": []\n },\n \"stage\": \"AD\",\n \"status\": \"BED_ASSIGNED\",\n \"admission_date\": \"2026-06-28T09:30:00.000Z\",\n \"date\": \"2026-06-28\"\n}"
response = http.request(request)
puts response.read_body{
"id": "adm-3f9c2b18-7e44-4a51",
"bid": "123456",
"admission_date": "2026-06-28T09:30:00.000Z",
"ipid": "IPD-2026-000481",
"attendee": {
"id": "att-01",
"name": "Ramesh Kumar",
"phone": {
"c": "+91",
"n": "9876543210"
},
"relation": {
"id": "rel-son",
"label": "Son"
}
},
"patient": {
"id": "pat-77",
"uuid": "9c2d1b6f-0a8e-5d23-8b1a-2c3d4e5f6a7b",
"poid": "poid-555",
"formData": [],
"profile": {
"personal": {
"gender": "M",
"name": "Suresh Kumar"
}
}
},
"insurance": {
"number": "POL-8891",
"type": "Cashless",
"payment_type": "Insurance",
"insurance_provider": "Star Health",
"pre_approved": true,
"pre_approved_amount": 50000
},
"refer": {
"id": "ref-01",
"name": "Dr. Anita Rao"
},
"doc": {
"id": "doctor-oid-456",
"name": "Dr. Vivek Sharma"
},
"stage": "AD",
"status": "BED_ASSIGNED",
"duration": {
"value": 3,
"unit": "days"
},
"bed": "ICU-04",
"rateplan": {
"id": "rp-standard",
"name": "Standard ICU",
"inclusions": []
},
"docid": "doctor-oid-456",
"category": {
"id": "cat-icu",
"name": "ICU"
},
"date": "2026-06-28",
"department": {
"id": "dept-med",
"name": "General Medicine"
},
"pid": "pid-321",
"created_at": "2026-06-28T09:30:00.000Z",
"updated_at": "2026-06-28T09:30:00.000Z",
"facility": {
"id": "fac-01",
"name": "Eka General Hospital"
},
"facilityid": "fac-01",
"totalbilled": 0,
"totalpaid": 0,
"actor_oid": "operator-oid-789"
}{
"message": "body/ipid must NOT have fewer than 1 characters"
}{
"message": "unauthenticated"
}Headers
Body
The IPD admission to create.
Patient IPD case number.
11Show child attributes
Show child attributes
Show child attributes
Show child attributes
Referring doctor (id + name).
Show child attributes
Show child attributes
The responsible doctor (id + name).
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Map of custom attribute keys to arrays of string values.
Show child attributes
Show child attributes
Coarse lifecycle stage; defaults to the active inpatient stage (AD).
IN, AD, DC Granular lifecycle status; defaults to BED_ASSIGNED.
ADMISSION_RECOMMENDED, ADMISSION_ON_HOLD, ADMISSION_CONFIRMED, ADMISSION_CANCELLED, BED_ASSIGNED, UNDER_CARE, NOT_RECEIVED, FIT_FOR_DISCHARGE, DISCHARGE_INITIATED, REFERRAL_INITIATED, LAMA_IN_PROGRESS, DAMA_IN_PROGRESS, DEATH_BEING_RECORDED, PATIENT_MISSING, DISCHARGED, LAMA_COMPLETED, DAMA_COMPLETED, REFERRED, DECEASED, ABSCONDED ISO-8601 date-time; defaults to the server now.
ISO-8601 date-time; defaults to the server now.
Response
Created — the newly created IPD admission.
Server-generated admission document id.
Business id the admission belongs to.
Admission date-time as an ISO-8601 string.
Discharge date-time as an ISO-8601 string. Present once discharged.
Patient IPD case number.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
The responsible doctor (id + name).
Show child attributes
Show child attributes
Coarse lifecycle stage of the admission.
IN, AD, DC Granular lifecycle status within the current stage.
ADMISSION_RECOMMENDED, ADMISSION_ON_HOLD, ADMISSION_CONFIRMED, ADMISSION_CANCELLED, BED_ASSIGNED, UNDER_CARE, NOT_RECEIVED, FIT_FOR_DISCHARGE, DISCHARGE_INITIATED, REFERRAL_INITIATED, LAMA_IN_PROGRESS, DAMA_IN_PROGRESS, DEATH_BEING_RECORDED, PATIENT_MISSING, DISCHARGED, LAMA_COMPLETED, DAMA_COMPLETED, REFERRED, DECEASED, ABSCONDED Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Creation date-time as an ISO-8601 string.
Last-update date-time as an ISO-8601 string.
Show child attributes
Show child attributes
Total amount billed for the admission.
Total amount paid against the admission.
Map of custom attribute keys to arrays of string values.
Show child attributes
Show child attributes
Denormalized discharge-clearance state.
Show child attributes
Show child attributes
oid of the actor that created/last acted on the admission.
Was this page helpful?

