curl --request POST \
--url https://api.maxcare.ai/v4/prescriptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-Organization-Id: <x-organization-id>' \
--header 'idempotency-key: <idempotency-key>' \
--data '
{
"sourcePrescriptionId": "rxp_5f1c0000000040000000000000000001",
"prescriberId": "prv_1a2b000000004000a000000000000001",
"sig": null,
"quantity": null,
"refills": null,
"daysSupply": null
}
'import requests
url = "https://api.maxcare.ai/v4/prescriptions"
payload = {
"sourcePrescriptionId": "rxp_5f1c0000000040000000000000000001",
"prescriberId": "prv_1a2b000000004000a000000000000001",
"sig": None,
"quantity": None,
"refills": None,
"daysSupply": None
}
headers = {
"idempotency-key": "<idempotency-key>",
"Idempotency-Key": "<idempotency-key>",
"X-Organization-Id": "<x-organization-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'idempotency-key': '<idempotency-key>',
'Idempotency-Key': '<idempotency-key>',
'X-Organization-Id': '<x-organization-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
sourcePrescriptionId: 'rxp_5f1c0000000040000000000000000001',
prescriberId: 'prv_1a2b000000004000a000000000000001',
sig: null,
quantity: null,
refills: null,
daysSupply: null
})
};
fetch('https://api.maxcare.ai/v4/prescriptions', 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.maxcare.ai/v4/prescriptions",
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([
'sourcePrescriptionId' => 'rxp_5f1c0000000040000000000000000001',
'prescriberId' => 'prv_1a2b000000004000a000000000000001',
'sig' => null,
'quantity' => null,
'refills' => null,
'daysSupply' => null
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"X-Organization-Id: <x-organization-id>",
"idempotency-key: <idempotency-key>"
],
]);
$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.maxcare.ai/v4/prescriptions"
payload := strings.NewReader("{\n \"sourcePrescriptionId\": \"rxp_5f1c0000000040000000000000000001\",\n \"prescriberId\": \"prv_1a2b000000004000a000000000000001\",\n \"sig\": null,\n \"quantity\": null,\n \"refills\": null,\n \"daysSupply\": null\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("idempotency-key", "<idempotency-key>")
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("X-Organization-Id", "<x-organization-id>")
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://api.maxcare.ai/v4/prescriptions")
.header("idempotency-key", "<idempotency-key>")
.header("Idempotency-Key", "<idempotency-key>")
.header("X-Organization-Id", "<x-organization-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sourcePrescriptionId\": \"rxp_5f1c0000000040000000000000000001\",\n \"prescriberId\": \"prv_1a2b000000004000a000000000000001\",\n \"sig\": null,\n \"quantity\": null,\n \"refills\": null,\n \"daysSupply\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.maxcare.ai/v4/prescriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["idempotency-key"] = '<idempotency-key>'
request["Idempotency-Key"] = '<idempotency-key>'
request["X-Organization-Id"] = '<x-organization-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sourcePrescriptionId\": \"rxp_5f1c0000000040000000000000000001\",\n \"prescriberId\": \"prv_1a2b000000004000a000000000000001\",\n \"sig\": null,\n \"quantity\": null,\n \"refills\": null,\n \"daysSupply\": null\n}"
response = http.request(request)
puts response.read_body{
"code": "success",
"data": {
"id": "rxp_5f1c0000000040000000000000000001",
"ehrPrescriptionId": "40000001",
"patientId": "pat_8de0303900004000a000000000000001",
"status": "erx",
"ehrStatusText": "ERX",
"writtenOn": "2026-09-12",
"writtenBy": {
"providerId": "prv_1a2b000000004000a000000000000001",
"ehrStaffId": "222",
"name": "Jane Example, MD"
},
"createdBy": {
"providerId": "prv_1a2b000000004000a000000000000001",
"ehrStaffId": "222",
"name": "Jane Example, MD"
},
"facilityId": "fac_b2c3d4e5f6a74b8c9d0e1f2a3b4c5d6e",
"drug": {
"dispensableId": "900001",
"description": "Examplumab 150 mg/mL subcutaneous syringe",
"drugName": "Examplumab",
"ndc": "00000000001",
"controlledSubstance": false,
"deaSchedule": null
},
"sig": "Inject 1 mL under the skin every 4 weeks",
"quantity": "1",
"quantityQualifier": {
"code": "ML",
"name": "Milliliter"
},
"refills": 11,
"daysSupply": 28,
"substitutionAllowed": true,
"diagnosisCodes": [
"L40.0"
],
"sourcePrescriptionId": null,
"erx": {
"status": "pharmacy_verified",
"ehrStatusText": "Pharmacy received and verified",
"errorMessage": null,
"releasedAt": "2026-09-12T15:04:05.000Z",
"releasedBy": {
"providerId": "prv_1a2b000000004000a000000000000001",
"ehrStaffId": "222",
"name": "Jane Example, MD"
},
"pharmacy": {
"ncpdpId": "0000001",
"name": "Example Clinic Pharmacy"
},
"messageId": "EMA00000000000000000000000000000000",
"remainingRefills": 11
}
}
}{
"code": "bad_request",
"message": "'id' must be a valid UUID",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"code": "unauthorized",
"message": "Invalid or missing API key",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"code": "forbidden",
"message": "Insufficient scope",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"code": "not_found",
"message": "Resource not found",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"code": "conflict",
"message": "Cannot edit a signed note",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"code": "controlled_substance_unsupported",
"message": "Controlled substances cannot be prescribed through the API",
"trace_id": "550e8400-e29b-41d4-a716-446655440000",
"data": {}
}{
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded. Maximum 1000 requests per 60 seconds.",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"code": "unexpected_integration_error",
"message": "EHR sync failed",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"code": "server_unresponsive",
"message": "EHR integration is not available for this note",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}Create a draft prescription from an existing one
Creates a PENDING draft copied from sourcePrescriptionId, written by prescriberId. Sends nothing to any pharmacy. Drug, NDC, quantity unit, substitution, facility and quick-sig are copied; sig, quantity, refills and daysSupply override the copy when non-null. The draft is read back and must match the request: otherwise 502 ehr_write_mismatch carries its id; the platform cannot void it, so staff discard it in the EHR. Idempotency-Key is required; an uncertain save answers 409 ehr_write_uncertain — check the chart before creating another. Controlled substances are refused.
curl --request POST \
--url https://api.maxcare.ai/v4/prescriptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-Organization-Id: <x-organization-id>' \
--header 'idempotency-key: <idempotency-key>' \
--data '
{
"sourcePrescriptionId": "rxp_5f1c0000000040000000000000000001",
"prescriberId": "prv_1a2b000000004000a000000000000001",
"sig": null,
"quantity": null,
"refills": null,
"daysSupply": null
}
'import requests
url = "https://api.maxcare.ai/v4/prescriptions"
payload = {
"sourcePrescriptionId": "rxp_5f1c0000000040000000000000000001",
"prescriberId": "prv_1a2b000000004000a000000000000001",
"sig": None,
"quantity": None,
"refills": None,
"daysSupply": None
}
headers = {
"idempotency-key": "<idempotency-key>",
"Idempotency-Key": "<idempotency-key>",
"X-Organization-Id": "<x-organization-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'idempotency-key': '<idempotency-key>',
'Idempotency-Key': '<idempotency-key>',
'X-Organization-Id': '<x-organization-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
sourcePrescriptionId: 'rxp_5f1c0000000040000000000000000001',
prescriberId: 'prv_1a2b000000004000a000000000000001',
sig: null,
quantity: null,
refills: null,
daysSupply: null
})
};
fetch('https://api.maxcare.ai/v4/prescriptions', 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.maxcare.ai/v4/prescriptions",
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([
'sourcePrescriptionId' => 'rxp_5f1c0000000040000000000000000001',
'prescriberId' => 'prv_1a2b000000004000a000000000000001',
'sig' => null,
'quantity' => null,
'refills' => null,
'daysSupply' => null
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>",
"X-Organization-Id: <x-organization-id>",
"idempotency-key: <idempotency-key>"
],
]);
$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.maxcare.ai/v4/prescriptions"
payload := strings.NewReader("{\n \"sourcePrescriptionId\": \"rxp_5f1c0000000040000000000000000001\",\n \"prescriberId\": \"prv_1a2b000000004000a000000000000001\",\n \"sig\": null,\n \"quantity\": null,\n \"refills\": null,\n \"daysSupply\": null\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("idempotency-key", "<idempotency-key>")
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("X-Organization-Id", "<x-organization-id>")
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://api.maxcare.ai/v4/prescriptions")
.header("idempotency-key", "<idempotency-key>")
.header("Idempotency-Key", "<idempotency-key>")
.header("X-Organization-Id", "<x-organization-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"sourcePrescriptionId\": \"rxp_5f1c0000000040000000000000000001\",\n \"prescriberId\": \"prv_1a2b000000004000a000000000000001\",\n \"sig\": null,\n \"quantity\": null,\n \"refills\": null,\n \"daysSupply\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.maxcare.ai/v4/prescriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["idempotency-key"] = '<idempotency-key>'
request["Idempotency-Key"] = '<idempotency-key>'
request["X-Organization-Id"] = '<x-organization-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"sourcePrescriptionId\": \"rxp_5f1c0000000040000000000000000001\",\n \"prescriberId\": \"prv_1a2b000000004000a000000000000001\",\n \"sig\": null,\n \"quantity\": null,\n \"refills\": null,\n \"daysSupply\": null\n}"
response = http.request(request)
puts response.read_body{
"code": "success",
"data": {
"id": "rxp_5f1c0000000040000000000000000001",
"ehrPrescriptionId": "40000001",
"patientId": "pat_8de0303900004000a000000000000001",
"status": "erx",
"ehrStatusText": "ERX",
"writtenOn": "2026-09-12",
"writtenBy": {
"providerId": "prv_1a2b000000004000a000000000000001",
"ehrStaffId": "222",
"name": "Jane Example, MD"
},
"createdBy": {
"providerId": "prv_1a2b000000004000a000000000000001",
"ehrStaffId": "222",
"name": "Jane Example, MD"
},
"facilityId": "fac_b2c3d4e5f6a74b8c9d0e1f2a3b4c5d6e",
"drug": {
"dispensableId": "900001",
"description": "Examplumab 150 mg/mL subcutaneous syringe",
"drugName": "Examplumab",
"ndc": "00000000001",
"controlledSubstance": false,
"deaSchedule": null
},
"sig": "Inject 1 mL under the skin every 4 weeks",
"quantity": "1",
"quantityQualifier": {
"code": "ML",
"name": "Milliliter"
},
"refills": 11,
"daysSupply": 28,
"substitutionAllowed": true,
"diagnosisCodes": [
"L40.0"
],
"sourcePrescriptionId": null,
"erx": {
"status": "pharmacy_verified",
"ehrStatusText": "Pharmacy received and verified",
"errorMessage": null,
"releasedAt": "2026-09-12T15:04:05.000Z",
"releasedBy": {
"providerId": "prv_1a2b000000004000a000000000000001",
"ehrStaffId": "222",
"name": "Jane Example, MD"
},
"pharmacy": {
"ncpdpId": "0000001",
"name": "Example Clinic Pharmacy"
},
"messageId": "EMA00000000000000000000000000000000",
"remainingRefills": 11
}
}
}{
"code": "bad_request",
"message": "'id' must be a valid UUID",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"code": "unauthorized",
"message": "Invalid or missing API key",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"code": "forbidden",
"message": "Insufficient scope",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"code": "not_found",
"message": "Resource not found",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"code": "conflict",
"message": "Cannot edit a signed note",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"code": "controlled_substance_unsupported",
"message": "Controlled substances cannot be prescribed through the API",
"trace_id": "550e8400-e29b-41d4-a716-446655440000",
"data": {}
}{
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded. Maximum 1000 requests per 60 seconds.",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"code": "unexpected_integration_error",
"message": "EHR sync failed",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}{
"code": "server_unresponsive",
"message": "EHR integration is not available for this note",
"trace_id": "550e8400-e29b-41d4-a716-446655440000"
}Authorizations
Marketplace API key
Headers
Unique per draft; replays return the original result for 24 hours
Target clinic organization ID
Body
The prescription to copy (rxp_…)
"rxp_5f1c0000000040000000000000000001"
Who is written as the prescriber (prv_…). Required: the EHR would otherwise default to whichever login made the call.
"prv_1a2b000000004000a000000000000001"
Null or absent: same as the source
null
Decimal string. Null or absent: same as the source
null
Null or absent: same as the source
null
Null or absent: same as the source
null
