curl --request POST \
--url https://api.maxcare.ai/v4/prescriptions/{id}/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Organization-Id: <x-organization-id>' \
--data '
{
"pharmacyNcpdpId": "0000001",
"idempotencyKey": "rxsend-rxp_5f1c0000000040000000000000000001-1",
"linkPharmacyToPatient": true,
"sessionToken": "<string>",
"acknowledgeActiveErx": false
}
'import requests
url = "https://api.maxcare.ai/v4/prescriptions/{id}/send"
payload = {
"pharmacyNcpdpId": "0000001",
"idempotencyKey": "rxsend-rxp_5f1c0000000040000000000000000001-1",
"linkPharmacyToPatient": True,
"sessionToken": "<string>",
"acknowledgeActiveErx": False
}
headers = {
"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: {
'X-Organization-Id': '<x-organization-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
pharmacyNcpdpId: '0000001',
idempotencyKey: 'rxsend-rxp_5f1c0000000040000000000000000001-1',
linkPharmacyToPatient: true,
sessionToken: '<string>',
acknowledgeActiveErx: false
})
};
fetch('https://api.maxcare.ai/v4/prescriptions/{id}/send', 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/{id}/send",
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([
'pharmacyNcpdpId' => '0000001',
'idempotencyKey' => 'rxsend-rxp_5f1c0000000040000000000000000001-1',
'linkPharmacyToPatient' => true,
'sessionToken' => '<string>',
'acknowledgeActiveErx' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Organization-Id: <x-organization-id>"
],
]);
$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/{id}/send"
payload := strings.NewReader("{\n \"pharmacyNcpdpId\": \"0000001\",\n \"idempotencyKey\": \"rxsend-rxp_5f1c0000000040000000000000000001-1\",\n \"linkPharmacyToPatient\": true,\n \"sessionToken\": \"<string>\",\n \"acknowledgeActiveErx\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
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/{id}/send")
.header("X-Organization-Id", "<x-organization-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"pharmacyNcpdpId\": \"0000001\",\n \"idempotencyKey\": \"rxsend-rxp_5f1c0000000040000000000000000001-1\",\n \"linkPharmacyToPatient\": true,\n \"sessionToken\": \"<string>\",\n \"acknowledgeActiveErx\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.maxcare.ai/v4/prescriptions/{id}/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Organization-Id"] = '<x-organization-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"pharmacyNcpdpId\": \"0000001\",\n \"idempotencyKey\": \"rxsend-rxp_5f1c0000000040000000000000000001-1\",\n \"linkPharmacyToPatient\": true,\n \"sessionToken\": \"<string>\",\n \"acknowledgeActiveErx\": false\n}"
response = http.request(request)
puts response.read_body{
"code": "success",
"data": {
"id": "rxs_77aa000000004000a000000000000001",
"prescriptionId": "rxp_5f1c0000000040000000000000000001",
"pharmacyNcpdpId": "0000001",
"status": "submitted",
"statusDetail": null,
"authorizedBy": {
"userId": "usr_0a1b2c3d4e5f40718293a4b5c6d7e8f9",
"clerkUserId": "user_2abcDEFghiJKLmno",
"orgRole": "org:member"
},
"acknowledgedActiveErx": false,
"requestedAt": "2026-09-30T14:00:00.000Z",
"erx": {
"status": "initiated",
"messageId": "EMA00000000000000000000000000000000",
"releasedAt": "2026-09-30T14:00:02.000Z",
"releasedBy": {
"ehrStaffId": "333",
"name": "Sam Staff"
},
"pharmacy": {
"ncpdpId": "0000001",
"name": "Example Clinic Pharmacy"
}
}
}
}{
"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"
}E-prescribe a pending prescription to a pharmacy
Sends one PENDING prescription to one pharmacy over Surescripts. Sending is the prescriber’s signature in the EHR and cannot be recalled through Max AI. It is released under the sending user’s own EHR login, resolved from sessionToken; with none usable the answer is 409 no_sending_identity — call maxcare.pickProvider() and retry with the same key. Every pre-send check refuses without sending and frees the key. 200 carries submitted or refused. 202 means unknown: the send was issued and no answer arrived, so it MAY have reached the pharmacy — never send again; repeat this request with the same idempotencyKey to learn the outcome. Controlled substances are always refused.
curl --request POST \
--url https://api.maxcare.ai/v4/prescriptions/{id}/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-Organization-Id: <x-organization-id>' \
--data '
{
"pharmacyNcpdpId": "0000001",
"idempotencyKey": "rxsend-rxp_5f1c0000000040000000000000000001-1",
"linkPharmacyToPatient": true,
"sessionToken": "<string>",
"acknowledgeActiveErx": false
}
'import requests
url = "https://api.maxcare.ai/v4/prescriptions/{id}/send"
payload = {
"pharmacyNcpdpId": "0000001",
"idempotencyKey": "rxsend-rxp_5f1c0000000040000000000000000001-1",
"linkPharmacyToPatient": True,
"sessionToken": "<string>",
"acknowledgeActiveErx": False
}
headers = {
"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: {
'X-Organization-Id': '<x-organization-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
pharmacyNcpdpId: '0000001',
idempotencyKey: 'rxsend-rxp_5f1c0000000040000000000000000001-1',
linkPharmacyToPatient: true,
sessionToken: '<string>',
acknowledgeActiveErx: false
})
};
fetch('https://api.maxcare.ai/v4/prescriptions/{id}/send', 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/{id}/send",
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([
'pharmacyNcpdpId' => '0000001',
'idempotencyKey' => 'rxsend-rxp_5f1c0000000040000000000000000001-1',
'linkPharmacyToPatient' => true,
'sessionToken' => '<string>',
'acknowledgeActiveErx' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"X-Organization-Id: <x-organization-id>"
],
]);
$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/{id}/send"
payload := strings.NewReader("{\n \"pharmacyNcpdpId\": \"0000001\",\n \"idempotencyKey\": \"rxsend-rxp_5f1c0000000040000000000000000001-1\",\n \"linkPharmacyToPatient\": true,\n \"sessionToken\": \"<string>\",\n \"acknowledgeActiveErx\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
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/{id}/send")
.header("X-Organization-Id", "<x-organization-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"pharmacyNcpdpId\": \"0000001\",\n \"idempotencyKey\": \"rxsend-rxp_5f1c0000000040000000000000000001-1\",\n \"linkPharmacyToPatient\": true,\n \"sessionToken\": \"<string>\",\n \"acknowledgeActiveErx\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.maxcare.ai/v4/prescriptions/{id}/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Organization-Id"] = '<x-organization-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"pharmacyNcpdpId\": \"0000001\",\n \"idempotencyKey\": \"rxsend-rxp_5f1c0000000040000000000000000001-1\",\n \"linkPharmacyToPatient\": true,\n \"sessionToken\": \"<string>\",\n \"acknowledgeActiveErx\": false\n}"
response = http.request(request)
puts response.read_body{
"code": "success",
"data": {
"id": "rxs_77aa000000004000a000000000000001",
"prescriptionId": "rxp_5f1c0000000040000000000000000001",
"pharmacyNcpdpId": "0000001",
"status": "submitted",
"statusDetail": null,
"authorizedBy": {
"userId": "usr_0a1b2c3d4e5f40718293a4b5c6d7e8f9",
"clerkUserId": "user_2abcDEFghiJKLmno",
"orgRole": "org:member"
},
"acknowledgedActiveErx": false,
"requestedAt": "2026-09-30T14:00:00.000Z",
"erx": {
"status": "initiated",
"messageId": "EMA00000000000000000000000000000000",
"releasedAt": "2026-09-30T14:00:02.000Z",
"releasedBy": {
"ehrStaffId": "333",
"name": "Sam Staff"
},
"pharmacy": {
"ncpdpId": "0000001",
"name": "Example Clinic Pharmacy"
}
}
}
}{
"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
Target clinic organization ID
Path Parameters
Prescription ID (rxp_…)
Body
Target pharmacy NCPDP id (7 digits)
"0000001"
Required, scoped to (app, organization), never expires. The same key and the same (prescription, pharmacy) returns the original send record and never sends again — also without a valid sessionToken, so a lost outcome can be learned after the token expired. A different prescription or pharmacy under a used key is 409 idempotency_key_reused.
"rxsend-rxp_5f1c0000000040000000000000000001-1"
Must be true in v1: the pharmacy is linked to the patient (never as default) before sending
true
The App Bridge app token of the user who pressed Send, forwarded in the same request as the click. Required to create a send record.
Send even though the same drug was released to another pharmacy within 90 days (recorded on the send)
false
