Introduction
Welcome to the API documentation. This guide provides all the information you need to authenticate, make requests, and handle responses from our API.
Base URL
https://staging.prescribery.com
Authenticating requests
This API is authenticated by sending an Authorization header with the value "Bearer {YOUR_AUTH_KEY}".
All authenticated endpoints are marked with a requires authentication badge in the documentation below.
You can retrieve your token by visiting your dashboard and clicking Generate API token.
Agents
List Agents
requires authentication
Retrieves a paginated list of agents with optional filters and sorting capabilities.
This endpoint provides detailed profile information for agents. Clients can filter results by license state, role, or available slot date, sort by specific fields, and paginate the response.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/agents?role=%22sales-agent%22&date=%222023-09-10%22&page=1&per_page=10&sort_column=%22created_date%22&sort_order=%22D%22" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/agents"
);
const params = {
"role": ""sales-agent"",
"date": ""2023-09-10"",
"page": "1",
"per_page": "10",
"sort_column": ""created_date"",
"sort_order": ""D"",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/agents',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'role'=> '"sales-agent"',
'date'=> '"2023-09-10"',
'page'=> '1',
'per_page'=> '10',
'sort_column'=> '"created_date"',
'sort_order'=> '"D"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/agents'
params = {
'role': '"sales-agent"',
'date': '"2023-09-10"',
'page': '1',
'per_page': '10',
'sort_column': '"created_date"',
'sort_order': '"D"',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
{
"data": [
{
"member_id": 1001,
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"prefix": "Mr.",
"degree": "PhD",
"email": "agent@example.com",
"mobile": "987-654-3210",
"home_phone": "123-456-7890",
"gender": "Male",
"introduction": "Experienced insurance agent.",
"specialization": "Life Insurance",
"npi": "NPI-123456",
"zuid": "ZUID-001",
"is_member_photo_available": "yes",
"address_line1": "123 Main St",
"address_line2": "Suite 100",
"city": "Los Angeles",
"state": "CA",
"zip_code": "90001",
"country": "USA",
"created_date": "2025-09-10T10:00:00Z",
"dtg": "DTG Info"
}
],
"pagination": {
"page": 1,
"per_page": "10",
"has_more_page": true,
"sort_column": "created_date",
"sort_order": "D"
}
}
Example response (401):
{
"message": "Unauthenticated"
}
Example response (404):
{
"message": "Resource not found"
}
Example response (422):
{
"message": "Resource not found"
}
Example response (500):
{
"message": "Internal server error"
}
Received response:
Request failed with error:
Get Agent Availability
requires authentication
Retrieve the available time slots for a specific agent within a given date range. You can optionally filter by a specific time slot (e.g., morning, afternoon, evening).
This endpoint requires authentication using a bearer token.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/agent/42/availability?from_date=2025-09-12T00%3A00%3A00Z&to_date=2025-09-19T23%3A59%3A59Z&time_slot=2" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/agent/42/availability"
);
const params = {
"from_date": "2025-09-12T00:00:00Z",
"to_date": "2025-09-19T23:59:59Z",
"time_slot": "2",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/agent/42/availability',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'from_date'=> '2025-09-12T00:00:00Z',
'to_date'=> '2025-09-19T23:59:59Z',
'time_slot'=> '2',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/agent/42/availability'
params = {
'from_date': '2025-09-12T00:00:00Z',
'to_date': '2025-09-19T23:59:59Z',
'time_slot': '2',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
{
"data": {
"available_slots": [
"2025-09-14T10:30:00Z",
"2025-09-15T11:00:00Z"
],
"facility_id": "abc123",
"from_date": "2025-09-12T00:00:00Z",
"to_date": "2025-09-19T23:59:59Z",
"member_id": "member_001",
"working_days": "Monday-Friday"
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (404):
{
"message": "Agent not found."
}
Example response (500):
{
"message": "Internal server error."
}
Received response:
Request failed with error:
Appointments
List Appointments
requires authentication
Retrieves a list of all patient appointments, optionally filtered by date and status.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/appointment/list?start_date=2025-09-01&end_date=2025-09-30&status_type=sync&page=1&per_page=10&sort_column=%22created_date%2C+start_date%22&sort_order=%22D%22" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/appointment/list"
);
const params = {
"start_date": "2025-09-01",
"end_date": "2025-09-30",
"status_type": "sync",
"page": "1",
"per_page": "10",
"sort_column": ""created_date, start_date"",
"sort_order": ""D"",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/appointment/list',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'start_date'=> '2025-09-01',
'end_date'=> '2025-09-30',
'status_type'=> 'sync',
'page'=> '1',
'per_page'=> '10',
'sort_column'=> '"created_date, start_date"',
'sort_order'=> '"D"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/appointment/list'
params = {
'start_date': '2025-09-01',
'end_date': '2025-09-30',
'status_type': 'sync',
'page': '1',
'per_page': '10',
'sort_column': '"created_date, start_date"',
'sort_order': '"D"',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
{
"data": [
{
"appointment_mode": "in-person",
"category": "general",
"created_at": "2025-09-01T10:00:00Z",
"date_preference": "any",
"date_type": "2025-09-15",
"doctor_id": 12,
"duration": 30,
"end_at": "2025-09-15T10:30:00Z",
"end_date": "2025-09-15",
"end_date_time": "2025-09-15T10:30:00Z",
"facility": "Main Clinic",
"frequency": 1,
"from_date": "2025-09-15",
"from_time": "10:00",
"from_time_period": "AM",
"id": 101,
"message_to_patient": "Please arrive 15 minutes early.",
"original_datetime_tz": "UTC",
"patient_id": 45,
"pharmacy_id": "RX123",
"reason": "Checkup",
"reason_for_cancellation": null,
"scheduled_by": "staff",
"source_id": 1,
"specific_date_option_1": "2025-09-15",
"specific_date_option_2": "2025-09-16",
"specific_date_option_3": "2025-09-17",
"status": "confirmed",
"start_at": "2025-09-15T10:00:00Z",
"start_date": "2025-09-15",
"start_date_time": "2025-09-15T10:00:00Z",
"start_time": "10:00",
"start_time_period": "AM",
"status_type": "upcoming",
"time_preference": "morning",
"to_date": "2025-09-15",
"to_time": "10:30",
"to_time_period": "AM",
"updated_at": "2025-09-10T12:00:00Z",
"visit_type": "consultation",
"zoom_link": "https://zoom.us/j/abc123"
}
],
"pagination": {
"page": 1,
"per_page": "15",
"has_more_page": true,
"sort_column": "start_date",
"sort_order": "asc"
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (404):
{
"message": "Resource Not Found"
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Store Prescribed Medicines (ERX) for an Appointment
requires authentication
This endpoint allows you to associate one or more prescribed medicines (ERX) with a specific patient appointment.
The medicine data can be stored in two ways:
- If a valid subscription plan is provided and contains prescription details, the medicines are stored under that plan.
- Otherwise, the medicines are directly associated with the appointment.
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/appointment/1/prescription" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"medicine_id\": [
1,
2,
3
],
\"subscription_plan_id\": 5
}"
const url = new URL(
"https://staging.prescribery.com/api/v2/appointment/1/prescription"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"medicine_id": [
1,
2,
3
],
"subscription_plan_id": 5
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://staging.prescribery.com/api/v2/appointment/1/prescription',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'medicine_id' => [
1,
2,
3,
],
'subscription_plan_id' => 5,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/appointment/1/prescription'
payload = {
"medicine_id": [
1,
2,
3
],
"subscription_plan_id": 5
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"message": "Appointment updated with medicine successfully."
}
Example response (200):
{
"message": "Subscription data stored successfully."
}
Example response (404):
{
"message": "Medicine not found in our record."
}
Example response (422):
{
"message": "failed",
"reason": {
"medicine_id": [
"The medicine_id field is required."
]
}
}
Example response (500):
{
"message": "Internal Server Error."
}
Received response:
Request failed with error:
Appointment Status
requires authentication
Get patient appointment status by patient ID and appointment ID.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/appointment/456/status/123" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/appointment/456/status/123"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/appointment/456/status/123',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/appointment/456/status/123'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200):
{
"message": "Appointment status retrieved successfully",
"appointment_status": {
"status": "confirmed"
}
}
Example response (401):
{
"message": "Unauthenticated"
}
Example response (404):
{
"message": "Resource Not Found"
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Cancel an appointment
requires authentication
This endpoint allows a patient to cancel a previously booked appointment.
It is typically used when a patient no longer wishes to attend a scheduled session or needs to reschedule. Cancellation requests must include the appointment ID and patient ID to ensure that only the rightful owner of the appointment can cancel it. A reason for cancellation must also be provided to help with analytics or policy enforcement (e.g., identifying frequent no-shows).
On success, the appointment is marked as canceled in the system, and may be made available for rebooking. If the appointment has already occurred or is invalid, the system will return an appropriate error response.
The request requires a valid authentication token.
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/appointment/123/cancel" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"patient_id\": 456,
\"reason_for_cancellation\": \"\\\"Patient unavailable\\\"\"
}"
const url = new URL(
"https://staging.prescribery.com/api/v2/appointment/123/cancel"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"patient_id": 456,
"reason_for_cancellation": "\"Patient unavailable\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://staging.prescribery.com/api/v2/appointment/123/cancel',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'patient_id' => 456,
'reason_for_cancellation' => '"Patient unavailable"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/appointment/123/cancel'
payload = {
"patient_id": 456,
"reason_for_cancellation": "\"Patient unavailable\""
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"message": "Appointment cancelled successfully"
}
Example response (400):
{
"message": "Bad Request"
}
Example response (401):
{
"message": "Unauthenticated"
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Hold an appointment slot
requires authentication
This endpoint temporarily holds an appointment slot for a specific member (user/patient).
It is typically used during the booking process to prevent race conditions or double-booking, especially in systems with high concurrency. Once a slot is held, it is reserved for a short duration (e.g., 5β15 minutes) while the user completes the full booking workflow.
The held slot data includes:
member_id: The ID of the member requesting the appointment.start_time: The starting time of the appointment (in 24-hour format).start_date: The date of the appointment.duration_in_minutes: The length of the appointment in minutes.
On success, the response includes the held appointment ID and a success message. If the slot is already taken or invalid input is provided, appropriate error messages are returned.
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/appointment/hold-slot" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"member_id\": 2345,
\"start_time\": \"14:30\",
\"start_date\": \"2025-09-20\",
\"duration_in_minutes\": \"30\"
}"
const url = new URL(
"https://staging.prescribery.com/api/v2/appointment/hold-slot"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"member_id": 2345,
"start_time": "14:30",
"start_date": "2025-09-20",
"duration_in_minutes": "30"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://staging.prescribery.com/api/v2/appointment/hold-slot',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'member_id' => 2345,
'start_time' => '14:30',
'start_date' => '2025-09-20',
'duration_in_minutes' => '30',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/appointment/hold-slot'
payload = {
"member_id": 2345,
"start_time": "14:30",
"start_date": "2025-09-20",
"duration_in_minutes": "30"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"slot_id": "APT56789"
}
Example response (400):
{
"message": "Bad Request"
}
Example response (401):
{
"message": "Unauthenticated"
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Reschedule Appointment
requires authentication
This endpoint allows rescheduling an existing appointment by providing a new date, time, and related details.
It requires the appointmentId as a path parameter, and the request body must contain key information such as patient, doctor, reason, and timing details.
Use this endpoint to update the appointment schedule when changes are needed by either the patient or the doctor.
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/appointment/1/reschedule" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"patient_id\": 1,
\"doctor_id\": 35,
\"source_id\": 21,
\"reason\": \"\\\"Patient request\\\"\",
\"appointment_mode\": \"\\\"Video Call\\\"\",
\"category\": \"\\\"consultation\\\"\",
\"status_type\": \"\\\"sync\\\"\",
\"start_date\": \"\\\"2025-09-20\\\"\",
\"start_time\": \"\\\"11:00\\\"\",
\"start_time_period\": \"\\\"AM\\\"\",
\"visitor_id\": 75,
\"timezone\": \"\\\"America\\/Los_Angeles\\\"\"
}"
const url = new URL(
"https://staging.prescribery.com/api/v2/appointment/1/reschedule"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"patient_id": 1,
"doctor_id": 35,
"source_id": 21,
"reason": "\"Patient request\"",
"appointment_mode": "\"Video Call\"",
"category": "\"consultation\"",
"status_type": "\"sync\"",
"start_date": "\"2025-09-20\"",
"start_time": "\"11:00\"",
"start_time_period": "\"AM\"",
"visitor_id": 75,
"timezone": "\"America\/Los_Angeles\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://staging.prescribery.com/api/v2/appointment/1/reschedule',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'patient_id' => 1,
'doctor_id' => 35,
'source_id' => 21,
'reason' => '"Patient request"',
'appointment_mode' => '"Video Call"',
'category' => '"consultation"',
'status_type' => '"sync"',
'start_date' => '"2025-09-20"',
'start_time' => '"11:00"',
'start_time_period' => '"AM"',
'visitor_id' => 75,
'timezone' => '"America/Los_Angeles"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/appointment/1/reschedule'
payload = {
"patient_id": 1,
"doctor_id": 35,
"source_id": 21,
"reason": "\"Patient request\"",
"appointment_mode": "\"Video Call\"",
"category": "\"consultation\"",
"status_type": "\"sync\"",
"start_date": "\"2025-09-20\"",
"start_time": "\"11:00\"",
"start_time_period": "\"AM\"",
"visitor_id": 75,
"timezone": "\"America\/Los_Angeles\""
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"data": {
"id": "11968"
}
}
Example response (401):
{
"message": "Unauthenticated"
}
Example response (422):
{
"message": "Validation failed",
"errors": {
"field": [
"Error message"
]
}
}
Example response (404):
{
"message": "Appointment not found"
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Get patient's last appointment mode
requires authentication
This endpoint retrieves the mode (e.g., in-person, video call, phone) of the most recent appointment for a specific patient. It is useful for prefilling or suggesting the preferred mode when the patient is booking a new appointment, especially in systems with multiple modes of consultation.
The request requires both:
patient_id: The unique identifier of the patient whose appointment mode is being requested.source_id: An identifier used to scope or filter the data (e.g., related to the appointment template or source system).
The response returns the last used appointment_mode for that patient, if available.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/appointment/last-appointment-mode?patient_id=23&source_id=12" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/appointment/last-appointment-mode"
);
const params = {
"patient_id": "23",
"source_id": "12",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/appointment/last-appointment-mode',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'patient_id'=> '23',
'source_id'=> '12',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/appointment/last-appointment-mode'
params = {
'patient_id': '23',
'source_id': '12',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
{
"appointment_mode": "video"
}
Example response (401):
{
"message": "Unauthenticated"
}
Example response (404):
{
"message": "Patient or appointment data not found"
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Get Appointment Details
requires authentication
Retrieve detailed information about a specific appointment by appointment ID.
This endpoint provides comprehensive information about the appointment, including:
- Appointment mode (e.g., online, in-person)
- Associated doctor and patient information
- Date and time details (start/end)
- Status and type of the appointment
- Zoom link (if applicable)
- Any custom messages or notes sent to the patient
It is useful for:
- Displaying appointment details in patient or doctor dashboards
- Admin review of scheduled appointments
- Debugging or auditing purposes
Requires authentication via a valid token.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/appointment/456/details" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/appointment/456/details"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/appointment/456/details',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/appointment/456/details'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200):
{
"data": {
"appointment_mode": "Video Call",
"category": "appointment",
"created_at": "2025-09-15 06:54:44",
"date_preference": null,
"date_type": "single_date",
"doctor_id": 35,
"duration": 30,
"end_date": "2025-09-20",
"end_date_time": "2025-09-20 11:30:00",
"facility": null,
"frequency": null,
"from_date": null,
"from_time": null,
"from_time_period": null,
"id": 11968,
"message_to_patient": null,
"original_datetime_tz": "2025-09-20 11:00 AM PST",
"patient_id": 1,
"pharmacy_id": 22,
"reason": "Fox",
"reason_for_cancellation": "I am not intresed",
"scheduled_by": null,
"source_id": 21,
"specific_date_option_1": null,
"specific_date_option_2": null,
"specific_date_option_3": null,
"status": "cancelled",
"start_date": "2025-09-20",
"start_date_time": "2025-09-20 11:00:00",
"start_time": "11:00:00",
"start_time_period": "AM",
"status_type": "sync",
"time_preference": null,
"to_date": null,
"to_time": null,
"to_time_period": null,
"updated_at": "2025-09-16 02:14:58",
"visit_type": "5",
"zoom_link": "",
"zoom_join_link": "https://zoom.us/j/xyz",
"member_name": "Aman1 Aman1",
"type": "doctor",
"member_picture": "https://s3.us-east-2.amazonaws.com/stagingdtg/profile_pic/image1740566253.png",
"service_title": "DietDoc",
"start_at": "2025-09-20 11:00:00",
"end_at": "2025-09-20 11:30:00",
"parsed_start_time": "11:00:00",
"zoom_join_copy_link": "https://zoom.us/j/xyz",
"parsed_start_date": "2025-09-20",
"parsed_start_period": "AM"
}
}
Example response (401):
{
"message": "Unauthenticated"
}
Example response (404):
{
"message": "Appointment not found"
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Retrieve Patient Appointment Stats
requires authentication
This endpoint retrieves a list of patient appointment details associated with a given client.
It supports optional filters such as source_id, from_date, and to_date to narrow down results.
The response includes appointment status, appointment date, synchronization type, appointment ID, and patient record ID.
Use this endpoint to track appointment histories, check appointment statuses, and retrieve identifiers useful for reporting or integrations.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/appointment/patient-stats?client_id=1&source_id=21&from_date=%222024-12-01%22&to_date=%222024-12-10%22" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/appointment/patient-stats"
);
const params = {
"client_id": "1",
"source_id": "21",
"from_date": ""2024-12-01"",
"to_date": ""2024-12-10"",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/appointment/patient-stats',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'client_id'=> '1',
'source_id'=> '21',
'from_date'=> '"2024-12-01"',
'to_date'=> '"2024-12-10"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/appointment/patient-stats'
params = {
'client_id': '1',
'source_id': '21',
'from_date': '"2024-12-01"',
'to_date': '"2024-12-10"',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
{
"data": [
{
"status": "completed",
"appointment_date": "2024/01/25",
"status_type": "sync",
"appointment_id": 123,
"patient_record_id": "PR12345"
}
]
}
Example response (400):
{
"message": "Invalid input parameters"
}
Example response (401):
{
"message": "Unauthenticated"
}
Example response (403):
{
"message": "Forbidden"
}
Example response (404):
{
"message": "Resource Not Found"
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Store Appointment Discount
requires authentication
This endpoint stores discount related to a specific appointment in the database. Use this to apply a discount to an appointment with the necessary details such as patient, appointment ID, discount label, and amount.
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/appointment/11968/discount" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"patient_id\": 1,
\"discount_label\": \"\\\"Referral Discount\\\"\",
\"amount\": 25.5
}"
const url = new URL(
"https://staging.prescribery.com/api/v2/appointment/11968/discount"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"patient_id": 1,
"discount_label": "\"Referral Discount\"",
"amount": 25.5
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://staging.prescribery.com/api/v2/appointment/11968/discount',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'patient_id' => 1,
'discount_label' => '"Referral Discount"',
'amount' => 25.5,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/appointment/11968/discount'
payload = {
"patient_id": 1,
"discount_label": "\"Referral Discount\"",
"amount": 25.5
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"message": "Discount data stored successfully"
}
Example response (400):
{
"message": "Bad Request - Missing required fields or invalid data"
}
Example response (401):
{
"message": "Unauthenticated - Invalid token or missing authentication"
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Book Appointment
requires authentication
Store appointment data in the database for a patient. This includes appointment details, timing, prescription info, and optional coupon or subscription data.
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/appointments" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"source_id\": 21,
\"member_id\": 887,
\"patient_id\": 5,
\"mode\": \"phone\",
\"reason\": \"Routine check-up\",
\"patient_state\": \"california\",
\"repetition\": \"Period\",
\"start_time\": \"12:30\",
\"start_time_period\": \"AM\",
\"start_date\": \"2026-05-20\",
\"duration_in_minutes\": 30,
\"video_link\": \"https:\\/\\/zoom.us\\/j\\/xyz\",
\"order_id\": \"ORD12345\",
\"order_type\": \"lab_test\",
\"coupon_code\": \"SAVE20\",
\"coupon_type\": \"percent\",
\"coupon_value\": 20,
\"pharmacy_id\": 22,
\"message_to_patient\": \"Please join 5 mins early.\",
\"timezone\": \"PST\",
\"consultation_fee\": \"100.00\",
\"medicine_ids\": [
1,
5,
8
]
}"
const url = new URL(
"https://staging.prescribery.com/api/v2/appointments"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"source_id": 21,
"member_id": 887,
"patient_id": 5,
"mode": "phone",
"reason": "Routine check-up",
"patient_state": "california",
"repetition": "Period",
"start_time": "12:30",
"start_time_period": "AM",
"start_date": "2026-05-20",
"duration_in_minutes": 30,
"video_link": "https:\/\/zoom.us\/j\/xyz",
"order_id": "ORD12345",
"order_type": "lab_test",
"coupon_code": "SAVE20",
"coupon_type": "percent",
"coupon_value": 20,
"pharmacy_id": 22,
"message_to_patient": "Please join 5 mins early.",
"timezone": "PST",
"consultation_fee": "100.00",
"medicine_ids": [
1,
5,
8
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://staging.prescribery.com/api/v2/appointments',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'source_id' => 21,
'member_id' => 887,
'patient_id' => 5,
'mode' => 'phone',
'reason' => 'Routine check-up',
'patient_state' => 'california',
'repetition' => 'Period',
'start_time' => '12:30',
'start_time_period' => 'AM',
'start_date' => '2026-05-20',
'duration_in_minutes' => 30,
'video_link' => 'https://zoom.us/j/xyz',
'order_id' => 'ORD12345',
'order_type' => 'lab_test',
'coupon_code' => 'SAVE20',
'coupon_type' => 'percent',
'coupon_value' => 20,
'pharmacy_id' => 22,
'message_to_patient' => 'Please join 5 mins early.',
'timezone' => 'PST',
'consultation_fee' => '100.00',
'medicine_ids' => [
1,
5,
8,
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/appointments'
payload = {
"source_id": 21,
"member_id": 887,
"patient_id": 5,
"mode": "phone",
"reason": "Routine check-up",
"patient_state": "california",
"repetition": "Period",
"start_time": "12:30",
"start_time_period": "AM",
"start_date": "2026-05-20",
"duration_in_minutes": 30,
"video_link": "https:\/\/zoom.us\/j\/xyz",
"order_id": "ORD12345",
"order_type": "lab_test",
"coupon_code": "SAVE20",
"coupon_type": "percent",
"coupon_value": 20,
"pharmacy_id": 22,
"message_to_patient": "Please join 5 mins early.",
"timezone": "PST",
"consultation_fee": "100.00",
"medicine_ids": [
1,
5,
8
]
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"data": {
"appointment_id": "A123456"
}
}
Example response (400):
{
"message": "Bad Request"
}
Example response (401):
{
"message": "Unauthenticated"
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
List Patient Appointments
requires authentication
Retrieves a list of appointments for a specific patient filtered by type and optionally by date range.
The available type filter values are:
cancelled: Returns appointments that have been cancelledcompleted: Returns past completed appointmentsupcoming: Returns future scheduled appointments
Useful for displaying appointment history and upcoming appointments in patient dashboards.
Supports optional filtering by from_date and to_date for custom date ranges.
Requires authentication via a valid token.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/patient/1/appointments?type=upcoming&from_date=2025-09-10&to_date=2025-09-20" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/patient/1/appointments"
);
const params = {
"type": "upcoming",
"from_date": "2025-09-10",
"to_date": "2025-09-20",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/patient/1/appointments',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'type'=> 'upcoming',
'from_date'=> '2025-09-10',
'to_date'=> '2025-09-20',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/patient/1/appointments'
params = {
'type': 'upcoming',
'from_date': '2025-09-10',
'to_date': '2025-09-20',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
{
"data": [
{
"id": 11776,
"facility": "doctalkgo",
"category": "appointment",
"patient_id": 3269,
"doctor_id": 34,
"source_id": 97,
"pharmacy_id": null,
"status": "processing",
"appointment_mode": "Phone Call",
"date_type": "single_date",
"original_datetime_tz": "2025-12-31 07:20 AM PST",
"start_date_time": "2025-12-31 07:20:00",
"end_date_time": "2025-12-31 07:30:00",
"duration": 10,
"reason": "test1234556",
"status_type": "sync",
"zoom_link": "",
"zoom_join_link": "",
"zoom_response": "",
"tenant_id": "392ab90f-3094-407d-8510-529008ce3fd4",
"rx_tracker_status": "in_progress",
"patient_state": "California",
"created_at": "2025-08-07 09:18:29",
"updated_at": "2025-08-07 09:19:08",
"member_name": "TEST TEST",
"type": "therapist",
"member_picture": null,
"service_title": "Wellcore",
"start_at": null,
"end_at": null,
"parsed_start_time": "07:20:00",
"zoom_join_copy_link": "",
"parsed_start_date": "2025-12-31",
"parsed_start_period": "AM"
}
]
}
Example response (404):
{
"message": "No appointments found"
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Authentication
Generate Access Token Using API Key
This endpoint is used to authenticate a client application using a valid API key, and in return, it generates a short-lived access token (JWT) and a long-lived refresh token. The access token must be included in the Authorization header for all protected API requests.
How it works:
- Clients make a POST request to this endpoint, supplying their API key in the request body.
- The API key is validated against the system's credentials.
- If the key is valid:
- A JWT access token is issued with a predefined expiration (e.g., 1 hour).
- A refresh token is also returned, allowing the client to request a new access token after expiration.
- If the key is invalid or missing, an appropriate error response is returned.
When to use:
- This endpoint should be called when the client application is first initializing, or when it needs to re-authenticate using a known API key.
- It is typically used in server-to-server integrations, mobile apps, or services that do not rely on user login but need secure access to protected endpoints.
Tokens explained:
access_token: A JWT (JSON Web Token) that must be used in theAuthorizationheader of subsequent API calls asBearer <access_token>. It has an expiration (e.g., 3600 seconds).refresh_token: A secure token that can be used to obtain a new access token without re-submitting the API key. This is useful when the access token expires.token_type: Typically "Bearer", which defines the scheme used in theAuthorizationheader.
Example Authorization Header:
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOi...
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/access-token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"api_key\": \"nisi\"
}"
const url = new URL(
"https://staging.prescribery.com/api/v2/access-token"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"api_key": "nisi"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://staging.prescribery.com/api/v2/access-token',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'api_key' => 'nisi',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/access-token'
payload = {
"api_key": "nisi"
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"data": {
"token_type": "Bearer",
"expires_in": 3600,
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...",
"refresh_token": "def50200d06fe59a4ba37aca6f0fd5d5a50c05a4fe683e3c..."
}
}
Example response (401):
{
"message": "Unauthorized"
}
Example response (422):
{
"message": "The api_key field is required.",
"errors": {
"api_key": [
"The api_key field is required."
]
}
}
Example response (500):
{
"message": "Failed to generate token."
}
Received response:
Request failed with error:
Refresh Access Token
requires authentication
This endpoint allows clients to obtain a new access token by using a previously issued refresh token. It is part of the OAuth 2.0 token lifecycle and is used when the original access token has expired or is about to expire.
How it works:
- Clients send a request to this endpoint with a valid
refresh_token. - If the token is valid and hasn't expired, a new access token and new refresh token are issued.
- If the token is invalid or expired, the server returns a
401 Unauthorizedresponse.
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/refresh-token?refresh_token=6ZbQWnFuJ8dLbgZOEQ%3D%3D" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-Custom-Decode: boolean Optional. If `true`, the refresh token will be decrypted before use. Example: true"const url = new URL(
"https://staging.prescribery.com/api/v2/refresh-token"
);
const params = {
"refresh_token": "6ZbQWnFuJ8dLbgZOEQ==",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
"X-Custom-Decode": "boolean Optional. If `true`, the refresh token will be decrypted before use. Example: true",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://staging.prescribery.com/api/v2/refresh-token',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Custom-Decode' => 'boolean Optional. If `true`, the refresh token will be decrypted before use. Example: true',
],
'query' => [
'refresh_token'=> '6ZbQWnFuJ8dLbgZOEQ==',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/refresh-token'
params = {
'refresh_token': '6ZbQWnFuJ8dLbgZOEQ==',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json',
'X-Custom-Decode': 'boolean Optional. If `true`, the refresh token will be decrypted before use. Example: true'
}
response = requests.request('POST', url, headers=headers, params=params)
response.json()Example response (200):
{
"access_token": "encrypted_access_token_value",
"refresh_token": "encrypted_refresh_token_value"
}
Example response (401):
{
"message": "unauthorized"
}
Received response:
Request failed with error:
Labs
Create Lab Test Order
requires authentication
This endpoint creates a lab test order associated with the specified client ID. It accepts patient ID, an array of lab test orders, and other optional metadata like service ID, source ID, and reason for the order.
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/lab/1/save-test-order" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"patient_id\": 1,
\"order\": [
\"dolorem\"
],
\"service_id\": 3,
\"source_id\": 21,
\"reason\": \"\\\"Routine checkup\\\"\",
\"payment_status\": \"paid\",
\"payment_amount\": 250.75,
\"charge_id\": \"ch_123456\",
\"payment_method\": \"card\"
}"
const url = new URL(
"https://staging.prescribery.com/api/v2/lab/1/save-test-order"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"patient_id": 1,
"order": [
"dolorem"
],
"service_id": 3,
"source_id": 21,
"reason": "\"Routine checkup\"",
"payment_status": "paid",
"payment_amount": 250.75,
"charge_id": "ch_123456",
"payment_method": "card"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://staging.prescribery.com/api/v2/lab/1/save-test-order',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'patient_id' => 1,
'order' => [
'dolorem',
],
'service_id' => 3,
'source_id' => 21,
'reason' => '"Routine checkup"',
'payment_status' => 'paid',
'payment_amount' => 250.75,
'charge_id' => 'ch_123456',
'payment_method' => 'card',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/lab/1/save-test-order'
payload = {
"patient_id": 1,
"order": [
"dolorem"
],
"service_id": 3,
"source_id": 21,
"reason": "\"Routine checkup\"",
"payment_status": "paid",
"payment_amount": 250.75,
"charge_id": "ch_123456",
"payment_method": "card"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"token": "generated-token-string"
}
Example response (422):
{
"message": "Validation failed",
"errors": {
"field_name": [
"Error message"
]
}
}
Example response (401):
{
"message": "Unauthenticated - Invalid or missing token"
}
Example response (400):
{
"message": "Bad Request - Invalid data provided"
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Get Lab Test Details
requires authentication
Retrieve detailed lab test information using the token generated from the save-test-order endpoint.
This endpoint returns the lab name, test details, charges, and total amount for the order.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/lab/"abc123xyz"/test-details" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/lab/"abc123xyz"/test-details"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/lab/"abc123xyz"/test-details',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/lab/"abc123xyz"/test-details'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200):
{
"data": {
"total_amount": 1200,
"lab_charges": 200,
"lab_test_details": [
{
"lab_name": "City Diagnostic Center",
"lab_tests": "Blood Test, Urine Test"
}
]
}
}
Example response (422):
{
"message": "Validation failed",
"errors": {
"token": [
"The token is invalid or expired."
]
}
}
Example response (401):
{
"message": "Unauthenticated - Invalid or missing token"
}
Example response (400):
{
"message": "Bad Request - Invalid data provided"
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Update Lab Order Details
requires authentication
Update specific details of a Lab Order (such as amount, charges, or associated patient) using the provided token.
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/lab/update-order-details" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"patient_id\": 101,
\"amount\": 1500,
\"charge_id\": \"ch_123456\",
\"token\": \"abc123xyz\"
}"
const url = new URL(
"https://staging.prescribery.com/api/v2/lab/update-order-details"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"patient_id": 101,
"amount": 1500,
"charge_id": "ch_123456",
"token": "abc123xyz"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://staging.prescribery.com/api/v2/lab/update-order-details',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'patient_id' => 101,
'amount' => 1500,
'charge_id' => 'ch_123456',
'token' => 'abc123xyz',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/lab/update-order-details'
payload = {
"patient_id": 101,
"amount": 1500,
"charge_id": "ch_123456",
"token": "abc123xyz"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"data": {
"order_id": 5001,
"updated_amount": 1500,
"updated_charge_id": 12
}
}
Example response (422):
{
"message": "Validation failed",
"errors": {
"amount": [
"The amount must be a number."
]
}
}
Example response (401):
{
"message": "Unauthenticated"
}
Example response (400):
{
"message": "Bad Request"
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Upload Patient Lab Reports
requires authentication
Upload one or more lab report documents for a patient. The uploaded files will be stored in S3 and recorded in the Kulbersh order table.
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/lab/upload-report-documents" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "source_id=21" \
--form "patient_id=101" \
--form "json_response={"lab_name": "Quest Diagnostics", "test_type": "Blood Test"}" \
--form "report_files[]=@/tmp/phpQGOxKW" const url = new URL(
"https://staging.prescribery.com/api/v2/lab/upload-report-documents"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('source_id', '21');
body.append('patient_id', '101');
body.append('json_response', '{"lab_name": "Quest Diagnostics", "test_type": "Blood Test"}');
body.append('report_files[]', document.querySelector('input[name="report_files[]"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://staging.prescribery.com/api/v2/lab/upload-report-documents',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'source_id',
'contents' => '21'
],
[
'name' => 'patient_id',
'contents' => '101'
],
[
'name' => 'json_response',
'contents' => '{"lab_name": "Quest Diagnostics", "test_type": "Blood Test"}'
],
[
'name' => 'report_files[]',
'contents' => fopen('/tmp/phpQGOxKW', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/lab/upload-report-documents'
files = {
'report_files[]': open('/tmp/phpQGOxKW', 'rb')
}
payload = {
"source_id": 21,
"patient_id": 101,
"json_response": "{\"lab_name\": \"Quest Diagnostics\", \"test_type\": \"Blood Test\"}"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'multipart/form-data',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, files=files, data=payload)
response.json()Example response (200):
{
"message": "Lab reports uploaded successfully"
}
Example response (400):
{
"message": "Bad Request"
}
Example response (401):
{
"message": "Unauthenticated"
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Get Lab Test List by Client
requires authentication
Retrieves the list of labs filtered by the specified client ID. The client ID is Required. An optional method parameter can be provided to filter labs by method type (default is 1).
Requires authentication via bearer token.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/lab/list/2/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/lab/list/2/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/lab/list/2/1',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/lab/list/2/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200):
{
"data": {
"id": 101,
"user_id": 23,
"name": "LabCorp",
"soft_delete": 0,
"selected": "yes",
"lab_test": {
"id": 201,
"user_id": 23,
"website": 1,
"lab_id": 101,
"test_id": 301,
"test_description": "Blood sugar test",
"price": "50.00",
"soft_delete": 0,
"status": 1,
"test": {
"id": 301,
"user_id": 23,
"name": "Blood Sugar",
"code": "BSG123",
"soft_delete": 0,
"status": 1
}
}
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (404):
{
"message": "Resource Not Found."
}
Example response (422):
{
"message": "Unprocessable Entity."
}
Example response (500):
{
"message": "Internal Server Error."
}
Received response:
Request failed with error:
Get Lab Orders By Client
requires authentication
Fetches all lab orders of a client, or for a specific patient if patientId is provided. Supports pagination.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/lab/123/lab-orders?patient_id=7&page=1&per_page=10" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/lab/123/lab-orders"
);
const params = {
"patient_id": "7",
"page": "1",
"per_page": "10",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/lab/123/lab-orders',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'patient_id'=> '7',
'page'=> '1',
'per_page'=> '10',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/lab/123/lab-orders'
params = {
'patient_id': '7',
'page': '1',
'per_page': '10',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
{
"code": "success",
"data": [
{
"id": 1,
"serial_no": 123,
"order_amount": 100.50,
"panel": "Basic Metabolic Panel",
"patient_id": "1",
"patient_name": "John Doe",
"payment_status": "paid",
"client_name": "paid",
"order_date": "2025-07-10 10:00:00",
"results_status": "pending",
}
],
"page": "1",
"number_of_page": 11,
"total_record": 11
}
Example response (422):
{
"message": "clientId is required"
}
Example response (404):
{
"message": "Client not found"
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Leads
Store Lead
requires authentication
This endpoint allows you to create and store a new lead record in the system. Leads typically represent potential patients, clients, or customers who are interested in your services.
A lead can include identifying details such as name, email, phone number, state, and ZIP code, along with optional referral information (e.g., referral code or referred_by). This data can be used for follow-ups, sales tracking, and marketing attribution.
On successful creation, the API returns a confirmation message along with the stored lead details.
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/lead/create" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"\\\"John Doe\\\"\",
\"email\": \"\\\"johndoe@example.com\\\"\",
\"source_id\": \"21\",
\"phone_number\": \"\\\"+1234567890\\\"\",
\"zip_code\": \"\\\"94105\\\"\",
\"referred_by\": \"\\\"Google Ads\\\"\",
\"state\": \"\\\"CA\\\"\",
\"referral_code\": \"\\\"REF123\\\"\"
}"
const url = new URL(
"https://staging.prescribery.com/api/v2/lead/create"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "\"John Doe\"",
"email": "\"johndoe@example.com\"",
"source_id": "21",
"phone_number": "\"+1234567890\"",
"zip_code": "\"94105\"",
"referred_by": "\"Google Ads\"",
"state": "\"CA\"",
"referral_code": "\"REF123\""
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://staging.prescribery.com/api/v2/lead/create',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => '"John Doe"',
'email' => '"johndoe@example.com"',
'source_id' => '21',
'phone_number' => '"+1234567890"',
'zip_code' => '"94105"',
'referred_by' => '"Google Ads"',
'state' => '"CA"',
'referral_code' => '"REF123"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/lead/create'
payload = {
"name": "\"John Doe\"",
"email": "\"johndoe@example.com\"",
"source_id": "21",
"phone_number": "\"+1234567890\"",
"zip_code": "\"94105\"",
"referred_by": "\"Google Ads\"",
"state": "\"CA\"",
"referral_code": "\"REF123\""
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"data": {
"lead_id": 101,
"user_id": "65",
"affiliate_referral_id": "94105",
}
}
Example response (400):
{
"message": "Bad Request"
}
Example response (401):
{
"message": "Unauthenticated"
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Add Lead Agent Appointment
requires authentication
This endpoint creates a new appointment for a specific lead with an assigned agent (member). Appointments are typically scheduled when a lead expresses interest in services, and this allows tracking of meetings, consultations, or follow-up calls.
The appointment includes key details such as the reason for the meeting, the date and time (in PST), and the optional duration. Once created, the system returns the unique appointment ID along with a confirmation message.
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/lead/agent-appointment" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"lead_id\": 101,
\"member_id\": 45,
\"reason\": \"\\\"Initial Consultation\\\"\",
\"start_date\": \"\\\"2025-09-25\\\"\",
\"start_time\": \"\\\"02:30 PM\\\"\",
\"duration_in_minutes\": 60
}"
const url = new URL(
"https://staging.prescribery.com/api/v2/lead/agent-appointment"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"lead_id": 101,
"member_id": 45,
"reason": "\"Initial Consultation\"",
"start_date": "\"2025-09-25\"",
"start_time": "\"02:30 PM\"",
"duration_in_minutes": 60
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://staging.prescribery.com/api/v2/lead/agent-appointment',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'lead_id' => 101,
'member_id' => 45,
'reason' => '"Initial Consultation"',
'start_date' => '"2025-09-25"',
'start_time' => '"02:30 PM"',
'duration_in_minutes' => 60,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/lead/agent-appointment'
payload = {
"lead_id": 101,
"member_id": 45,
"reason": "\"Initial Consultation\"",
"start_date": "\"2025-09-25\"",
"start_time": "\"02:30 PM\"",
"duration_in_minutes": 60
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"data": {
"appointment_id": "APT-20250918-12345",
"lead_id": 101,
"member_id": 45,
"reason": "Initial Consultation",
"start_date": "2025-09-25",
"start_time": "14:30",
"duration_in_minutes": 60,
"timezone": "PST"
}
}
Example response (400):
{
"message": "Bad Request"
}
Example response (401):
{
"message": "Unauthenticated"
}
Example response (409):
{
"message": "This time-slot is already booked."
}
Example response (404):
{
"message": "Lead not found"
}
Example response (422):
{
"message": "Validation error",
"errors": {
"lead_id": [
"The lead_id field is required."
],
"start_date": [
"The start_date field must be a valid date."
]
}
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Update a Lead
requires authentication
This endpoint updates an existing leadβs information in the system. You can modify fields such as the reason for sign-up, the zip code, and the acceptance of terms of service. Typically used after a lead has been created to update or correct their details.
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/lead/42/update" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"sign_up_reason\": \"\\\"Referred by friend\\\"\",
\"zip_code\": \"\\\"94016\\\"\",
\"term_service\": \"\\\"yes\\\"\",
\"status\": \"iure\",
\"agent_id\": 3,
\"email\": \"mann.gaston@example.net\"
}"
const url = new URL(
"https://staging.prescribery.com/api/v2/lead/42/update"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"sign_up_reason": "\"Referred by friend\"",
"zip_code": "\"94016\"",
"term_service": "\"yes\"",
"status": "iure",
"agent_id": 3,
"email": "mann.gaston@example.net"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://staging.prescribery.com/api/v2/lead/42/update',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'sign_up_reason' => '"Referred by friend"',
'zip_code' => '"94016"',
'term_service' => '"yes"',
'status' => 'iure',
'agent_id' => 3,
'email' => 'mann.gaston@example.net',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/lead/42/update'
payload = {
"sign_up_reason": "\"Referred by friend\"",
"zip_code": "\"94016\"",
"term_service": "\"yes\"",
"status": "iure",
"agent_id": 3,
"email": "mann.gaston@example.net"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"data": {
"lead": {
"lead_id": 212,
"user_id": 458,
}
},
}
Example response (400):
{
"message": "Bad Request"
}
Example response (401):
{
"message": "Unauthenticated"
}
Example response (404):
{
"message": "Lead not found"
}
Example response (422):
{
"message": "Validation error",
"errors": {
"zip_code": [
"The zip_code must be a valid format."
]
}
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Members
Members
requires authentication
Fetch a paginated list of members with optional filtering, sorting, and availability checks.
This endpoint returns a list of members based on provided query parameters such as source ID, license state, availability type, and more. It supports pagination and allows sorting by specified fields.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/members?source_id=21&license_state=California&medicine_check=1&availability_type=sync&page=1&per_page=10&sort_column=created_date&sort_order=D" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/members"
);
const params = {
"source_id": "21",
"license_state": "California",
"medicine_check": "1",
"availability_type": "sync",
"page": "1",
"per_page": "10",
"sort_column": "created_date",
"sort_order": "D",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/members',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'source_id'=> '21',
'license_state'=> 'California',
'medicine_check'=> '1',
'availability_type'=> 'sync',
'page'=> '1',
'per_page'=> '10',
'sort_column'=> 'created_date',
'sort_order'=> 'D',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/members'
params = {
'source_id': '21',
'license_state': 'California',
'medicine_check': '1',
'availability_type': 'sync',
'page': '1',
'per_page': '10',
'sort_column': 'created_date',
'sort_order': 'D',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
{
"data": [
{
"member_id": 1001,
"first_name": "Jane",
"last_name": "Doe",
"full_name": "Jane Doe",
"prefix": "Dr.",
"degree": "MD",
"email": "member@example.com",
"mobile": "555-987-6543",
"home_phone": "555-123-4567",
"gender": "Female",
"address_line1": "123 Main St",
"address_line2": "Apt 4B",
"city": "Los Angeles",
"state": "CA",
"zip_code": "90001",
"country": "USA",
"specialization": "Pediatrics",
"npi": "NPI-987654",
"zuid": "ZUID-12345",
"dtg": "Some DTG Info",
"introduction": "Experienced member in healthcare.",
"is_member_photo_available": "yes",
"created_date": "2025-09-10T10:00:00Z"
}
],
"pagination": {
"page": 1,
"per_page": "10",
"has_more_page": true,
"sort_column": "created_date",
"sort_order": "D"
}
}
Example response (404):
{
"message": "Resource Not Found"
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"source_id": [
"The source id field is required."
],
"license_state": [
"The license state field is required."
]
}
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Check Member Availability
requires authentication
Returns available time slots for a specific member within a specified date and time range.
This endpoint allows clients to check when a member is available between two date-time values. Optional filters such as time slot ID and timezone can be provided for more refined results.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/members/123/availability?from_date=%222025-09-15%22&to_date=%222025-09-15%22&time_slot=5&timezone=%22America%2FPhoenix%22" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/members/123/availability"
);
const params = {
"from_date": ""2025-09-15"",
"to_date": ""2025-09-15"",
"time_slot": "5",
"timezone": ""America/Phoenix"",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/members/123/availability',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'from_date'=> '"2025-09-15"',
'to_date'=> '"2025-09-15"',
'time_slot'=> '5',
'timezone'=> '"America/Phoenix"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/members/123/availability'
params = {
'from_date': '"2025-09-15"',
'to_date': '"2025-09-15"',
'time_slot': '5',
'timezone': '"America/Phoenix"',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
{
"data": {
"member_id": "123",
"facility_id": "FAC-001",
"from_date": "2025-09-15T09:00:00Z",
"to_date": "2025-09-15T17:00:00Z",
"working_days": "Mon-Fri",
"available_slots": [
"2025-09-15T09:30:00Z",
"2025-09-15T10:00:00Z",
"2025-09-15T11:30:00Z"
]
}
}
Example response (404):
{
"message": "Resource Not Found"
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"from_date": [
"The from date field is required."
],
"to_date": [
"The to date field is required."
]
}
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Retrieve Member Details
requires authentication
Fetches detailed profile information for a specific member by their unique ID.
This endpoint returns personal and contact details of the member, including name, email, phone number, and profile avatar. Useful for displaying member profiles in applications.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/members/123/details" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/members/123/details"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/members/123/details',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/members/123/details'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200):
{
"data": {
"id": 1,
"full_name": "John Doe",
"first_name": "John",
"last_name": "Doe",
"email": "john@example.com",
"avatar": "https://example.com/avatar.jpg",
"phone_number": "1234567890"
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (404):
{
"message": "Member Not Found"
}
Example response (422):
{
"message": "The member was not found.",
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Members Available Slots
requires authentication
Retrieve available time slots for multiple members based on filter criteria such as source ID, license state, date range, time slot, and timezone.
This endpoint allows clients to query for available appointment slots for all matching members. The response groups available slots by date and includes the associated member IDs.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/members/availableslots?source_id=21&license_state=California&from_date=2025-11-20&to_date=2025-11-25&time_slot=10&timezone=America%2FPhoenix" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/members/availableslots"
);
const params = {
"source_id": "21",
"license_state": "California",
"from_date": "2025-11-20",
"to_date": "2025-11-25",
"time_slot": "10",
"timezone": "America/Phoenix",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/members/availableslots',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'source_id'=> '21',
'license_state'=> 'California',
'from_date'=> '2025-11-20',
'to_date'=> '2025-11-25',
'time_slot'=> '10',
'timezone'=> 'America/Phoenix',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/members/availableslots'
params = {
'source_id': '21',
'license_state': 'California',
'from_date': '2025-11-20',
'to_date': '2025-11-25',
'time_slot': '10',
'timezone': 'America/Phoenix',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
{
"data": {
"2023-11-20": [
{
"start_time": "09:00",
"end_time": "10:00",
"member_id": "member123"
},
{
"start_time": "10:00",
"end_time": "11:00",
"member_id": "member456"
}
],
"2023-11-21": [
{
"start_time": "13:00",
"end_time": "14:00",
"member_id": "member789"
}
]
}
}
Example response (404):
{
"message": "Resource Not Found"
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"source_id": [
"The source id field is required."
],
"license_state": [
"The license state field is required."
]
}
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Patients
Get Active Patients (Paginated)
requires authentication
Retrieves a paginated list of active patients, supporting filtering, sorting, and pagination.
You can filter by search (full name, email, or record ID) and request additional flags such as whether the patient has accepted terms.
If the authenticated user belongs to a company, the results are scoped to that client.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/patients?search=est&with_terms=1&sort_column=first_name&sort_order=D&page=1&per_page=10" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/patients"
);
const params = {
"search": "est",
"with_terms": "1",
"sort_column": "first_name",
"sort_order": "D",
"page": "1",
"per_page": "10",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/patients',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'search'=> 'est',
'with_terms'=> '1',
'sort_column'=> 'first_name',
'sort_order'=> 'D',
'page'=> '1',
'per_page'=> '10',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/patients'
params = {
'search': 'est',
'with_terms': '1',
'sort_column': 'first_name',
'sort_order': 'D',
'page': '1',
'per_page': '10',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
{
"data": [
{
"gender": "female",
"first_name": "Alice",
"last_name": "Smith",
"full_name": "Alice Smith",
"email": "alice@example.com",
"mobile": "9876543210",
"dob": "1990-05-01",
"record_id": "PAT1023",
"patient_id": 42,
"created_time": "2025-07-09 10:32:00",
"created_date": "2025-07-09 10:32:00",
"active": "active",
"postal_code": "10001",
"city": "New York",
"state": "NY",
"height": "165",
"weight": "60",
"privacy_policy": "<html>Policy content...</html>",
"client_logo": "https://example.com/storage/logo.png",
"primary_color": "#1E90FF",
"font_color": "#333333",
"term_service": 1,
"identifier": {
"use": "usual",
"value": 42
},
"stripe_customer_id": "cus_abc123"
}
],
"input": {
"search": "Alice",
"sort_column": "created_at",
"sort_order": "D"
},
"pagination": {
"page": 1,
"per_page": 10,
"has_more_page": "true",
"sort_column": "created_at",
"sort_order": "D"
}
}
Example response (401):
{
"message": "Unauthenticated"
}
Example response (500):
{
"message": "Internal Server Error.",
}
Received response:
Request failed with error:
Create Patient
requires authentication
Store a patient record.
This endpoint registers a new patient with first name, last name, dob(date of birth in Y-m-d format), gender, billing and shipping address, unique email and phone number.
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/patients" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"first_name\": \"John\",
\"last_name\": \"Doe\",
\"dob\": \"1990-01-01\",
\"gender\": \"male\",
\"email\": \"john.doe@example.com\",
\"mobile\": \"9898989898\",
\"billing_address\": {
\"address_line1\": \"123 Elm St\",
\"address_line2\": \"Apt 4B\",
\"city\": \"California city\",
\"state\": \"California\",
\"postal_code\": \"90001\",
\"country\": \"us\"
},
\"driver_license_number\": \"ABC123456\",
\"language\": \"English\",
\"communication_type\": \"phone\",
\"referred_by\": \"Facebook\",
\"term_service\": true,
\"height\": \"180\",
\"weight\": \"70\",
\"shipping_address\": {
\"address_line1\": \"500 Market Street\",
\"address_line2\": \"Suite 8\",
\"city\": \"San Francisco\",
\"state\": \"California\",
\"country\": \"us\",
\"postal_code\": \"94105\"
}
}"
const url = new URL(
"https://staging.prescribery.com/api/v2/patients"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"first_name": "John",
"last_name": "Doe",
"dob": "1990-01-01",
"gender": "male",
"email": "john.doe@example.com",
"mobile": "9898989898",
"billing_address": {
"address_line1": "123 Elm St",
"address_line2": "Apt 4B",
"city": "California city",
"state": "California",
"postal_code": "90001",
"country": "us"
},
"driver_license_number": "ABC123456",
"language": "English",
"communication_type": "phone",
"referred_by": "Facebook",
"term_service": true,
"height": "180",
"weight": "70",
"shipping_address": {
"address_line1": "500 Market Street",
"address_line2": "Suite 8",
"city": "San Francisco",
"state": "California",
"country": "us",
"postal_code": "94105"
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://staging.prescribery.com/api/v2/patients',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'first_name' => 'John',
'last_name' => 'Doe',
'dob' => '1990-01-01',
'gender' => 'male',
'email' => 'john.doe@example.com',
'mobile' => '9898989898',
'billing_address' => [
'address_line1' => '123 Elm St',
'address_line2' => 'Apt 4B',
'city' => 'California city',
'state' => 'California',
'postal_code' => '90001',
'country' => 'us',
],
'driver_license_number' => 'ABC123456',
'language' => 'English',
'communication_type' => 'phone',
'referred_by' => 'Facebook',
'term_service' => true,
'height' => '180',
'weight' => '70',
'shipping_address' => [
'address_line1' => '500 Market Street',
'address_line2' => 'Suite 8',
'city' => 'San Francisco',
'state' => 'California',
'country' => 'us',
'postal_code' => '94105',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/patients'
payload = {
"first_name": "John",
"last_name": "Doe",
"dob": "1990-01-01",
"gender": "male",
"email": "john.doe@example.com",
"mobile": "9898989898",
"billing_address": {
"address_line1": "123 Elm St",
"address_line2": "Apt 4B",
"city": "California city",
"state": "California",
"postal_code": "90001",
"country": "us"
},
"driver_license_number": "ABC123456",
"language": "English",
"communication_type": "phone",
"referred_by": "Facebook",
"term_service": true,
"height": "180",
"weight": "70",
"shipping_address": {
"address_line1": "500 Market Street",
"address_line2": "Suite 8",
"city": "San Francisco",
"state": "California",
"country": "us",
"postal_code": "94105"
}
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"data": [
{
"identifier": {
"use": "usual",
"value": 105
},
"id": "105",
"record_id": "PAT105",
"first_name": "John",
"last_name": "Doe",
"dob": "1990-01-01",
"address_line1": "123 Elm Street",
"address_licne2": "Apt 4B",
"city": "Los Angeles",
"state": "Califrnia",
"country": "us",
"postal_code": "90001",
"district": null,
"email": "john.doe@example.com",
"mobile": "9876543210",
"smoking_status": "",
"marital_status": "",
"employment_status": "",
"gender": "male",
"height": "180",
"weight": "70",
"status": "active",
"blood_group": null,
"profile_img": null,
"communication_type": "phone",
"language": "English",
"shipping_address_line1": null,
"shipping_address_line2": null,
"shipping_city": null,
"shipping_state": "California",
"shipping_postal_code": "90001",
"term_service": 0,
}
],
}
Example response (401):
{
"message": "Unauthenticated"
}
Example response (422):
{
"message": "failed",
"reason": {
"email": [
"The email field is required."
],
"dob": [
"The dob field is required."
]
}
}
Example response (500):
{
"message": "Internal Server Error.",
}
Received response:
Request failed with error:
Check User Qualification
requires authentication
This endpoint verifies whether a patient qualifies based on the provided information: email, date of birth (DOB), and current medications.
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/patients/check-qualification" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"johndoe@example.com\",
\"dob\": \"1990-05-12\",
\"medications\": \"Aspirin,Metformin\"
}"
const url = new URL(
"https://staging.prescribery.com/api/v2/patients/check-qualification"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "johndoe@example.com",
"dob": "1990-05-12",
"medications": "Aspirin,Metformin"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://staging.prescribery.com/api/v2/patients/check-qualification',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'email' => 'johndoe@example.com',
'dob' => '1990-05-12',
'medications' => 'Aspirin,Metformin',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/patients/check-qualification'
payload = {
"email": "johndoe@example.com",
"dob": "1990-05-12",
"medications": "Aspirin,Metformin"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"message": "User qualifies based on provided information"
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"email": [
"The email field is required."
],
"dob": [
"The dob field is required."
],
"medications": [
"The medications field is required."
]
}
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Update Patient
requires authentication
Update an existing patient.
This endpoint updates the details of an existing patient using validated input. Upon success, it returns the updated patient resource wrapped in a standardized JSON structure, along with the original input and pagination metadata.
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/patients/12 or PAT000001" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"first_name\": \"John\",
\"last_name\": \"Doe\",
\"dob\": \"1990-01-01\",
\"gender\": \"male\",
\"email\": \"john.doe@example.com\",
\"mobile\": \"9876543210\",
\"billing_address\": {
\"address_line1\": \"123 Elm Street\",
\"address_line2\": \"Apt 4B\",
\"city\": \"California city\",
\"state\": \"California\",
\"postal_code\": \"90001\",
\"country\": \"us\"
},
\"driver_license_number\": \"ABC123456\",
\"language\": \"English\",
\"communication_type\": \"phone\",
\"referred_by\": \"Google Ads\",
\"term_service\": true,
\"height\": \"175\",
\"weight\": \"70\",
\"shipping_address\": {
\"address_line1\": \"500 Market Street\",
\"address_line2\": \"Suite 8\",
\"city\": \"San Francisco\",
\"state\": \"CA\",
\"country\": \"us\",
\"postal_code\": \"94105\"
}
}"
const url = new URL(
"https://staging.prescribery.com/api/v2/patients/12 or PAT000001"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"first_name": "John",
"last_name": "Doe",
"dob": "1990-01-01",
"gender": "male",
"email": "john.doe@example.com",
"mobile": "9876543210",
"billing_address": {
"address_line1": "123 Elm Street",
"address_line2": "Apt 4B",
"city": "California city",
"state": "California",
"postal_code": "90001",
"country": "us"
},
"driver_license_number": "ABC123456",
"language": "English",
"communication_type": "phone",
"referred_by": "Google Ads",
"term_service": true,
"height": "175",
"weight": "70",
"shipping_address": {
"address_line1": "500 Market Street",
"address_line2": "Suite 8",
"city": "San Francisco",
"state": "CA",
"country": "us",
"postal_code": "94105"
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://staging.prescribery.com/api/v2/patients/12 or PAT000001',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'first_name' => 'John',
'last_name' => 'Doe',
'dob' => '1990-01-01',
'gender' => 'male',
'email' => 'john.doe@example.com',
'mobile' => '9876543210',
'billing_address' => [
'address_line1' => '123 Elm Street',
'address_line2' => 'Apt 4B',
'city' => 'California city',
'state' => 'California',
'postal_code' => '90001',
'country' => 'us',
],
'driver_license_number' => 'ABC123456',
'language' => 'English',
'communication_type' => 'phone',
'referred_by' => 'Google Ads',
'term_service' => true,
'height' => '175',
'weight' => '70',
'shipping_address' => [
'address_line1' => '500 Market Street',
'address_line2' => 'Suite 8',
'city' => 'San Francisco',
'state' => 'CA',
'country' => 'us',
'postal_code' => '94105',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/patients/12 or PAT000001'
payload = {
"first_name": "John",
"last_name": "Doe",
"dob": "1990-01-01",
"gender": "male",
"email": "john.doe@example.com",
"mobile": "9876543210",
"billing_address": {
"address_line1": "123 Elm Street",
"address_line2": "Apt 4B",
"city": "California city",
"state": "California",
"postal_code": "90001",
"country": "us"
},
"driver_license_number": "ABC123456",
"language": "English",
"communication_type": "phone",
"referred_by": "Google Ads",
"term_service": true,
"height": "175",
"weight": "70",
"shipping_address": {
"address_line1": "500 Market Street",
"address_line2": "Suite 8",
"city": "San Francisco",
"state": "CA",
"country": "us",
"postal_code": "94105"
}
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"data": [
{
"gender": "female",
"first_name": "Alice",
"email": "alice@example.com",
"created_time": "2025-07-10 09:20:00",
"mobile": "9876543210",
"last_name": "Smith",
"active": "active",
"record_id": "PAT1023",
"full_name": "Alice Smith",
"patient_id": 42,
"dob": "1990-05-01",
"postal_code": "10001",
"state": "NY",
"city": "New York",
"height": "165",
"weight": "60",
"created_date": "2025-07-10 09:20:00",
"privacy_policy": "<html>Policy content...</html>",
"client_logo": "https://example.com/storage/logo.png",
"primary_color": "#1E90FF",
"font_color": "#333333",
"term_service": 1,
"identifier": {
"use": "usual",
"value": 42
},
"stripe_customer_id": "cus_ABC1234567"
}
],
}
Example response (422):
{
"reason": {
"email": [
"The email field is required."
],
"dob": [
"The dob must be a valid date."
]
}
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Upload a document for a patient.
requires authentication
Upload and store a patient's document (front + optional back). Accepts base64-encoded image or PDF data.
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/patients/1/documents" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"title\": \"Driving License\",
\"document_file\": \"data:image\\/jpeg;base64,\\/9j\\/4AAQSkZJRgABAQAAAQABAAD...\",
\"document_file_back\": \"data:image\\/png;base64,iVBORw0KGgoAAAANSUhEUgAA...\"
}"
const url = new URL(
"https://staging.prescribery.com/api/v2/patients/1/documents"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"title": "Driving License",
"document_file": "data:image\/jpeg;base64,\/9j\/4AAQSkZJRgABAQAAAQABAAD...",
"document_file_back": "data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://staging.prescribery.com/api/v2/patients/1/documents',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'title' => 'Driving License',
'document_file' => 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD...',
'document_file_back' => 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/patients/1/documents'
payload = {
"title": "Driving License",
"document_file": "data:image\/jpeg;base64,\/9j\/4AAQSkZJRgABAQAAAQABAAD...",
"document_file_back": "data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"documents": [
{
"document_id": 5,
"patient_id": 1,
"document_title": "Blood Report",
"document_file": "https://s3.amazonaws.com/bucket/document.pdf",
"document_thumb": "https://s3.amazonaws.com/bucket/thumbnail.jpg",
"document_date": "2024-06-01 10:23:00"
}
]
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"title": [
"The title field is required."
],
"document_file": [
"The document_file must be a valid base64-encoded file of type: jpg, jpeg, png, or pdf."
]
}
}
Example response (500):
{
"message": "Internal Server Error",
}
Received response:
Request failed with error:
Get patient questionnaires
requires authentication
Get a list of questionnaires answered by the patient
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/patients/dolor/questionnaires?per_page=10&page=1&questionnaire_name_startswith=A&questionnaire_name_contains=Diabetes" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/patients/dolor/questionnaires"
);
const params = {
"per_page": "10",
"page": "1",
"questionnaire_name_startswith": "A",
"questionnaire_name_contains": "Diabetes",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/patients/dolor/questionnaires',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'per_page'=> '10',
'page'=> '1',
'questionnaire_name_startswith'=> 'A',
'questionnaire_name_contains'=> 'Diabetes',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/patients/dolor/questionnaires'
params = {
'per_page': '10',
'page': '1',
'questionnaire_name_startswith': 'A',
'questionnaire_name_contains': 'Diabetes',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
{
"data": [
{
"ques_map_id": 12,
"questionnaire_id": 5,
"questionnaire_name": "Diabetes Checkup",
"is_submitted": true,
"is_saved": true
}
],
"pagination": {
"page": 1,
"per_page": 10,
"has_more_page": true,
"search_criteria": {
"column_name": "questionnaire_name",
"search_text": "Dia",
"comparator": "contains"
}
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Get patient's questionnaire answers
requires authentication
This endpoint returns a list of answers submitted by a patient for a given template.
Requires authentication and role-based access (e.g. company users).
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/patients/patient-questionnaire-answer?record_id=abc123&template_id=45" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/patients/patient-questionnaire-answer"
);
const params = {
"record_id": "abc123",
"template_id": "45",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/patients/patient-questionnaire-answer',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'record_id'=> 'abc123',
'template_id'=> '45',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/patients/patient-questionnaire-answer'
params = {
'record_id': 'abc123',
'template_id': '45',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
{
"data": [
{
"id": 12,
"template_id": 45,
"answers": [
{
"question": "Do you have any allergies?",
"answer": "Peanuts, Pollen"
},
{
"question": "Medications",
"answer": "Aspirin, Ibuprofen"
}
]
}
]
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (404):
{
"message": "Questionnaire not found."
}
Example response (500):
{
"message": "Internal Server Error."
}
Received response:
Request failed with error:
Retrieve patient prescriptions
requires authentication
This endpoint fetches a list of prescriptions for a specific patient.
You can optionally provide a date range (from_date and to_date) to filter prescriptions.
If no date range is given, it defaults to todayβs prescriptions.
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/patients/123/prescriptions?from_date=2025-03-01&to_date=2025-03-05" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/patients/123/prescriptions"
);
const params = {
"from_date": "2025-03-01",
"to_date": "2025-03-05",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://staging.prescribery.com/api/v2/patients/123/prescriptions',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'from_date'=> '2025-03-01',
'to_date'=> '2025-03-05',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/patients/123/prescriptions'
params = {
'from_date': '2025-03-01',
'to_date': '2025-03-05',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, params=params)
response.json()Example response (200):
{
"data": [
{
"drug": "Amoxicillin",
"status": "transmit",
"dispense": 30,
"dispense_unit": "mg",
"refills": 2,
"drug_type": "Antibiotic",
"directions": "Take one tablet every 8 hours",
"note_to_pharmacy": "Urgent delivery required",
"pharmacy_name": "ABC Pharmacy",
"renewal_at": "01 Mar 2025"
}
]
}
Example response (400):
{
"message": "Bad Request"
}
Example response (401):
{
"message": "Unauthenticated"
}
Example response (404):
{
"message": "Patient not found"
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Verify Patient from Idology
requires authentication
This endpoint verifies patient details using Idology based on the provided patient ID.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/patients/123/verify-from-idology" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/patients/123/verify-from-idology"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/patients/123/verify-from-idology',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/patients/123/verify-from-idology'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200):
{
"response": [
"Verification successful",
"Additional verification info if any"
]
}
Example response (400):
{
"message": "Bad Request - Invalid patient ID"
}
Example response (401):
{
"message": "Unauthenticated - Token missing or invalid"
}
Example response (404):
{
"message": "Patient not found"
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Payments
Create Braintree Customer
requires authentication
This endpoint creates a Braintree customer for the given patient. If the customer already exists, it returns the existing Braintree customer ID and nonce. Otherwise, it creates a new Braintree customer using the provided payment method nonce and stores the credentials.
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/patients/payments/braintree/customer" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"patient_id\": 1,
\"nonce\": \"fake-valid-nonce\"
}"
const url = new URL(
"https://staging.prescribery.com/api/v2/patients/payments/braintree/customer"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"patient_id": 1,
"nonce": "fake-valid-nonce"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://staging.prescribery.com/api/v2/patients/payments/braintree/customer',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'patient_id' => 1,
'nonce' => 'fake-valid-nonce',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/patients/payments/braintree/customer'
payload = {
"patient_id": 1,
"nonce": "fake-valid-nonce"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"braintree_customer_id": "abcdef123456",
"braintree_nonce": "a1b2c3d4e5f6"
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"patient_id": [
"Patient ID is required."
],
"nonce": [
"Payment nonce is required."
]
}
}
Example response (500):
{
"message": "Internal Server Error."
}
Received response:
Request failed with error:
Get Braintree Client Token
requires authentication
This endpoint generates a Braintree client token using default or dynamic gateway credentials.
If source_id or client_id is passed, the token is generated using their specific Braintree settings.
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/patients/payments/braintree/token" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"source_id\": 21,
\"client_id\": 5
}"
const url = new URL(
"https://staging.prescribery.com/api/v2/patients/payments/braintree/token"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"source_id": 21,
"client_id": 5
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://staging.prescribery.com/api/v2/patients/payments/braintree/token',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'source_id' => 21,
'client_id' => 5,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/patients/payments/braintree/token'
payload = {
"source_id": 21,
"client_id": 5
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"token": "sandbox_f252zhq7_hh4cpc39zq4rgjcg",
"gateway_id": "client_braintree_id_001",
}
Example response (404):
{
"message": "Client not found"
}
Example response (500):
{
"message": "Internal Server Error."
}
Received response:
Request failed with error:
Initiate Braintree Payment
requires authentication
This endpoint initiates a Braintree payment for a patient using a nonce and amount. Optionally stores card info and generates a QuickBooks invoice if applicable.
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/patients/payments/braintree/initiate" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"patient_id\": 1,
\"nonce\": \"fake-valid-nonce\",
\"amount\": \"250\",
\"order_id\": \"ORDER123\",
\"source_id\": 3,
\"gateway_id\": \"cli_gw_001\",
\"qb_channel\": \"online\",
\"aptType\": \"async\"
}"
const url = new URL(
"https://staging.prescribery.com/api/v2/patients/payments/braintree/initiate"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"patient_id": 1,
"nonce": "fake-valid-nonce",
"amount": "250",
"order_id": "ORDER123",
"source_id": 3,
"gateway_id": "cli_gw_001",
"qb_channel": "online",
"aptType": "async"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://staging.prescribery.com/api/v2/patients/payments/braintree/initiate',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'patient_id' => 1,
'nonce' => 'fake-valid-nonce',
'amount' => '250',
'order_id' => 'ORDER123',
'source_id' => 3,
'gateway_id' => 'cli_gw_001',
'qb_channel' => 'online',
'aptType' => 'async',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/patients/payments/braintree/initiate'
payload = {
"patient_id": 1,
"nonce": "fake-valid-nonce",
"amount": "250",
"order_id": "ORDER123",
"source_id": 3,
"gateway_id": "cli_gw_001",
"qb_channel": "online",
"aptType": "async"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"transaction_id": "bt_txn_123456",
"gateway_id": "braintree_abc"
}
Example response (422):
{
"errors": {
"patient_id": [
"The patient id field is required."
],
"nonce": [
"The nonce field is required."
],
"amount": [
"The amount field is required."
]
}
}
Example response (500):
{
"message": "Internal Server Error."
}
Received response:
Request failed with error:
Store Card Details on Braintree
requires authentication
Saves a card for the patient to Braintree and stores the customer ID and token.
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/patients/payments/braintree/card" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"patient_id\": 1,
\"nonce\": \"fake-valid-nonce\",
\"source_id\": 2
}"
const url = new URL(
"https://staging.prescribery.com/api/v2/patients/payments/braintree/card"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"patient_id": 1,
"nonce": "fake-valid-nonce",
"source_id": 2
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://staging.prescribery.com/api/v2/patients/payments/braintree/card',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'patient_id' => 1,
'nonce' => 'fake-valid-nonce',
'source_id' => 2,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/patients/payments/braintree/card'
payload = {
"patient_id": 1,
"nonce": "fake-valid-nonce",
"source_id": 2
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"braintree_nonce": "abc123xyz",
"braintree_customer_id": "cust_456def",
}
Example response (404):
{
"message": "Patient not found"
}
Example response (422):
{
"message": "The nonce field is required."
}
Received response:
Request failed with error:
Store PayPal Payment Details
requires authentication
Stores payment details for a PayPal transaction. Optionally triggers a PayPal charged event.
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/patients/payments/paypal/store" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"patient_id\": 1,
\"agent_id\": 12,
\"transection_id\": \"PAYPAL_TXN_123\",
\"payment_mode\": \"paypal\",
\"amount\": \"250.50\",
\"billing_address\": \"\\\"123 Main St, NY\\\"\",
\"payment_status\": \"success\",
\"channel\": \"lab_test\"
}"
const url = new URL(
"https://staging.prescribery.com/api/v2/patients/payments/paypal/store"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"patient_id": 1,
"agent_id": 12,
"transection_id": "PAYPAL_TXN_123",
"payment_mode": "paypal",
"amount": "250.50",
"billing_address": "\"123 Main St, NY\"",
"payment_status": "success",
"channel": "lab_test"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://staging.prescribery.com/api/v2/patients/payments/paypal/store',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'patient_id' => 1,
'agent_id' => 12,
'transection_id' => 'PAYPAL_TXN_123',
'payment_mode' => 'paypal',
'amount' => '250.50',
'billing_address' => '"123 Main St, NY"',
'payment_status' => 'success',
'channel' => 'lab_test',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/patients/payments/paypal/store'
payload = {
"patient_id": 1,
"agent_id": 12,
"transection_id": "PAYPAL_TXN_123",
"payment_mode": "paypal",
"amount": "250.50",
"billing_address": "\"123 Main St, NY\"",
"payment_status": "success",
"channel": "lab_test"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"message": "Your payment detail has been stored!"
}
Example response (500):
{
"message": "Something went wrong."
}
Received response:
Request failed with error:
Pharmacy
Get Pharmacies
requires authentication
This endpoint retrieves a list of pharmacies filtered by pharmacy name and state. It returns detailed information about each pharmacy, including contact details, address, and configuration options.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/pharmacy/list?pharmacy_name=%22Doespot%22&state=%22CA%22" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/pharmacy/list"
);
const params = {
"pharmacy_name": ""Doespot"",
"state": ""CA"",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/pharmacy/list',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'pharmacy_name'=> '"Doespot"',
'state'=> '"CA"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/pharmacy/list'
params = {
'pharmacy_name': '"Doespot"',
'state': '"CA"',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
{
"data": [
{
"id": 1,
"pharmacy_name": "Doespot Pharmacy",
"phone_number": "123-456-7890",
"email": "info@doespot.com",
"primary_option": "Option A",
"api_name": "default",
"status": 1,
"type": "default",
"ndc": 123456,
"daw_code": 0,
"attach_questionnaire": 0,
"created_at": "2025-09-15T06:51:23Z",
"updated_at": "2025-09-15T06:51:23Z",
"faxable_name": "Doespot Fax",
"states": "CA",
"is_doctalkgo_pharmacy": 0,
"contact_number": "123-456-7890",
"soft_delete": 0,
"npi_number": "1234567890",
"ppi_name": "Primary PPI",
"address_line1": "123 Main St",
"address_line2": "",
"city": "Los Angeles",
"state": "CA",
"country": "USA",
"postal_code": "90001",
"ncpdp": "987654",
"dosespot_pharmacy_id": "DS12345",
"webhook": "https://example.com/webhook",
"tenant_id": "392ab90f-3094-407d-8510-529008ce3fd4",
"api_configuration": "default",
"show_contact": 1
}
]
}
Example response (401):
{
"message": "Unauthenticated - Token missing or invalid"
}
Example response (404):
{
"message": "No pharmacies found matching the criteria"
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"pharmacy_name": [
"The pharmacy name field is required."
],
"state": [
"The state field is required."
]
}
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Search Pharmacies on Dosespot
requires authentication
This endpoint allows searching for pharmacies by name. If no name is provided, it may return all pharmacies or a default list.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/pharmacy/search-on-dosespot?name=%22Dosespot%22" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/pharmacy/search-on-dosespot"
);
const params = {
"name": ""Dosespot"",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/pharmacy/search-on-dosespot',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'name'=> '"Dosespot"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/pharmacy/search-on-dosespot'
params = {
'name': '"Dosespot"',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
{
"data": [
{
"id": 1,
"name": "Dosespot Pharmacy",
"address": "123 Main Street",
"city": "Los Angeles",
"state": "CA",
"zip_code": "90001"
}
]
}
Example response (401):
{
"message": "Unauthenticated"
}
Example response (404):
{
"message": "No pharmacies found"
}
Example response (422):
{
"message": "Invalid query parameters"
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Questionnaires
Get a paginated list of questionnaires/templates
requires authentication
This endpoint retrieves a list of questionnaires or templates for the current authenticated user. The list supports pagination, sorting, and filters based on the user's role and tenant.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/questionnaires?sort_column=created_time&sort_order=D&per_page=10&page=1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/questionnaires"
);
const params = {
"sort_column": "created_time",
"sort_order": "D",
"per_page": "10",
"page": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/questionnaires',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'sort_column'=> 'created_time',
'sort_order'=> 'D',
'per_page'=> '10',
'page'=> '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/questionnaires'
params = {
'sort_column': 'created_time',
'sort_order': 'D',
'per_page': '10',
'page': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
{
"data": [
{
"template_id": 1,
"questionnaire_name": "Health Survey",
"questionnaire_type": "General Questionnaire",
"created_time": 1694334025,
"source_id": "3,5"
},
],
"pagination": {
"page": 1,
"per_page": 10,
"has_more_page": "true",
"sort_column": "created_time",
"sort_order": "D"
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (500):
{
"message": "Internal Server Error."
}
Received response:
Request failed with error:
Submit Questionnaire
requires authentication
This endpoint allows you to submit answers to a specific questionnaire template for a given patient. It supports updates and creations of new responses, logs responses from email links, and stores associated metadata such as coupon codes, appointment types, medications, and allergies.
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/questionnaires/answers" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"template_id\": 5643,
\"patient_id\": 5,
\"answers\": \"eos\",
\"ques_map_id\": 5,
\"coupon_code\": \"\\\"FREEMED2025\\\"\",
\"ip_address\": \"\\\"192.168.1.1\\\"\",
\"questionnaire_id\": 12
}"
const url = new URL(
"https://staging.prescribery.com/api/v2/questionnaires/answers"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"template_id": 5643,
"patient_id": 5,
"answers": "eos",
"ques_map_id": 5,
"coupon_code": "\"FREEMED2025\"",
"ip_address": "\"192.168.1.1\"",
"questionnaire_id": 12
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://staging.prescribery.com/api/v2/questionnaires/answers',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'template_id' => 5643,
'patient_id' => 5,
'answers' => 'eos',
'ques_map_id' => 5,
'coupon_code' => '"FREEMED2025"',
'ip_address' => '"192.168.1.1"',
'questionnaire_id' => 12,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/questionnaires/answers'
payload = {
"template_id": 5643,
"patient_id": 5,
"answers": "eos",
"ques_map_id": 5,
"coupon_code": "\"FREEMED2025\"",
"ip_address": "\"192.168.1.1\"",
"questionnaire_id": 12
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"data": {
"ques_map_id": 123
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (422):
{
"message": "failed",
"reason": {
"template_id": [
"The template id is required."
],
"patient_id": [
"The patient Id is required."
],
"answers": [
"Answers are required."
]
}
}
Example response (500):
{
"message": "Something went wrong."
}
Received response:
Request failed with error:
Questionnaire
requires authentication
This endpoint returns the Questionnaires JSON for the given template ID and type. It can optionally retrieve a specific version of the template's questionnaires.
Requires authentication. Behavior changes based on user role (company role limits results to source-matched templates).
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/questionnaires/5643?group_questionnaire=" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/questionnaires/5643"
);
const params = {
"group_questionnaire": "0",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/questionnaires/5643',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'group_questionnaire'=> '0',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/questionnaires/5643'
params = {
'group_questionnaire': '0',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
{
"data": [
{
"notes": "test",
"inline": false,
"value": [
"Yes",
"No"
],
"type": "radio-group",
"conditions": "",
"group_questionnaire": "",
"notes_type": "Question with Options",
"is_multi_choice": "",
"options": [],
"is_deleted": "",
"template_id": "4",
"is_mandatory": "",
"position": 3,
"entry_id": "",
"className": "",
"description": "",
"placeholder": "",
"dqReason": "",
"dqVal": "Yes"
}
]
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (500):
{
"message": "Internal Server Error.",
}
Received response:
Request failed with error:
Client Questionnaire Report Webhook
requires authentication
Fetches questionnaire answers filtered by client, source, and date range. Returns a structured list of patient-submitted questions and answers, along with metadata such as age range, gender, zip code, and UTM tracking data.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/questionnaires/client-report-webhook?client_id=1&source_id=5&from_date=2023-01-01&to_date=2023-12-31&is_test_data_required=1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/questionnaires/client-report-webhook"
);
const params = {
"client_id": "1",
"source_id": "5",
"from_date": "2023-01-01",
"to_date": "2023-12-31",
"is_test_data_required": "1",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/questionnaires/client-report-webhook',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'client_id'=> '1',
'source_id'=> '5',
'from_date'=> '2023-01-01',
'to_date'=> '2023-12-31',
'is_test_data_required'=> '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/questionnaires/client-report-webhook'
params = {
'client_id': '1',
'source_id': '5',
'from_date': '2023-01-01',
'to_date': '2023-12-31',
'is_test_data_required': '1',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
{
"data": [
{
"template_id": 23,
"questionnaire": [
{
"question": "Do you have allergies?",
"answer": "Pollen, Dust"
}
],
"created_at": "2024-01-01T12:00:00Z",
"updated_at": "2024-01-01T12:00:00Z",
"patient": null,
"patient_age_range": "21 to 30",
"patient_gender": "male",
"patient_zip_code": "123",
"visitor": {
"utm_params": {
"utm_source": "Google",
"utm_medium": "cpc",
"utm_content": "spring_campaign"
}
},
"version": "1.0"
}
]
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (500):
{
"message": "Something went wrong."
}
Received response:
Request failed with error:
Services
Get Services
requires authentication
Retrieve a paginated list of services, optionally filtered and sorted by various parameters.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/services?id=12&search=dental&client_id=5&type=consultation&category=diagnostics&action=categorywise&page=1&per_page=10&sort_column=title&sort_order=A" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/services"
);
const params = {
"id": "12",
"search": "dental",
"client_id": "5",
"type": "consultation",
"category": "diagnostics",
"action": "categorywise",
"page": "1",
"per_page": "10",
"sort_column": "title",
"sort_order": "A",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/services',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'id'=> '12',
'search'=> 'dental',
'client_id'=> '5',
'type'=> 'consultation',
'category'=> 'diagnostics',
'action'=> 'categorywise',
'page'=> '1',
'per_page'=> '10',
'sort_column'=> 'title',
'sort_order'=> 'A',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/services'
params = {
'id': '12',
'search': 'dental',
'client_id': '5',
'type': 'consultation',
'category': 'diagnostics',
'action': 'categorywise',
'page': '1',
'per_page': '10',
'sort_column': 'title',
'sort_order': 'A',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
{
"data": [
{
"id": 1,
"name": "Category Name",
"services": [
{
"id": 101,
"title": "Service Title",
"description": "Service description",
"amount": "100.00",
"after_approval_amount": "80.00",
"background_color": "#FFFFFF",
"booking_with": "online",
"created_date": "2025-08-11T10:00:00Z",
"icon": "icon.png",
"status": 1,
"source_id": 5,
"template_id": 2,
"precautions": "No food before service",
"diagnosis": "N/A",
"treatments": "Basic Cleaning",
"starting_price": "150.00"
}
]
}
],
"pagination": {
"page": 1,
"per_page": "10",
"has_more_page": true,
"sort_column": "created_date",
"sort_order": "D"
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (404):
{
"message": "Resource Not Found"
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Get client services
requires authentication
Fetch a list of services available for a specific client, including details
from related appointment_sources and optionally the related subscription plan.
Only services marked as visible on the website (website = 1) are returned.
Results are ordered by the services.order field.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/clients/46/services" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/clients/46/services"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/clients/46/services',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/clients/46/services'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200):
{
"data": [
{
"id": 156,
"title": "001Test",
"description": "<p>Test</p>",
"precautions": "<p>Test</p>",
"diagnosis": "<p>Test</p>",
"treatments": "<p>Test</p>",
"amount": "0.00",
"after_approval_amount": "0.00",
"background_color": "A odit excepturi cor",
"booking_with": "nutritionist",
"created_at": "2024-02-22T17:37:54.000000Z",
"status": 0,
"source_id": 61,
"template_id": 24,
"subscription_id": 112,
"sales_agent_role_name": null,
"icon": null,
"icon_full_url": null,
"role_info": null,
"subscription_plan": {
"id": 112,
"plan_id": "2ab",
"plan_name": "04_06_2024_test_1",
"description": "test",
"clients": "1",
"sources": "12",
"price_per_cycle": 1,
"price_calculated": 1,
"frequency": "1",
"max_cycles": 1,
"has_prescription": 1,
"rpm_subscription": 0,
"initial": 0,
"category_id": "1",
"sub_category_id": "1",
"discount_type": null,
"discount": null,
"deleted_at": null,
"created_at": "2024-06-04T19:04:51.000000Z",
"updated_at": "2024-06-04T19:04:51.000000Z",
"deactivated": null,
"excluded_states": null,
"gateway_id": null,
"qb_service": null,
"qb_class": null,
"qb_company_id": null
}
}
]
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (404):
{
"message": "Resource Not Found"
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Get Service by Client and Category
requires authentication
This endpoint retrieves a list of active services for a given client and category. If a service doesnβt have a questionnaire template assigned, the system will attempt to fetch one based on its source ID.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/services/by-client-and-category?client_id=123&category_id=5&service_for=both" \
--header "Authorization: Bearer {token}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/services/by-client-and-category"
);
const params = {
"client_id": "123",
"category_id": "5",
"service_for": "both",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {token}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/services/by-client-and-category',
[
'headers' => [
'Authorization' => 'Bearer {token}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'client_id'=> '123',
'category_id'=> '5',
'service_for'=> 'both',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/services/by-client-and-category'
params = {
'client_id': '123',
'category_id': '5',
'service_for': 'both',
}
headers = {
'Authorization': 'Bearer {token}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
{
"data": [
{
"id": 1,
"client_id": 123,
"template_id": 1,
"type_id": 1,
"title": "abc",
"description": "abc",
"source_id": 1,
"status": 1,
"booking_with": "doctor",
"price": 150,
"product_and_price": "[]",
"add_on": "[]",
"service_for": "both",
"charge_consultation": 1,
"labs": [
{
"lab_id": 12,
"name": "abc"
}
],
"sales_agent_role_name": "abc",
"icon_full_url": "abc",
"role_info": "abc"
}
]
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Get Service Product and Prices
requires authentication
This endpoint retrieves a service based on the provided service ID. It returns details such as service info, add-ons, labs data, product pricing, and more.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/services/6/product-and-prices" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/services/6/product-and-prices"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/services/6/product-and-prices',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/services/6/product-and-prices'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200):
{
"data": {
"id": 1,
"client_id": 1,
"template_id": null,
"type_id": 2,
"title": "Sample Service",
"description": "This is a sample service.",
"source_id": 1,
"status": "active",
"booking_with": "online",
"price": 99.99,
"product_and_price": "[]",
"add_on": "[]",
"labs": "[]",
"charge_consultation": 10,
"sales_agent_role_name": null,
"icon_full_url": null,
"role_info": null
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Services Listing for Sub Category
requires authentication
This endpoint retrieves a list of services based on the given client ID and subcategory ID.
You can optionally specify the service_for type (regular, premium, or both).
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/123/123/services?service_for=both" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/123/123/services"
);
const params = {
"service_for": "both",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/123/123/services',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'service_for'=> 'both',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/123/123/services'
params = {
'service_for': 'both',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
{
"data": [
{
"id": 1,
"client_id": 1,
"template_id": 1,
"type_id": 1,
"title": "abc",
"sub_title": "abc",
"description": "<p>abc</p>",
"starting_price": "abc",
"icon": "http://abc.jpeg",
"background_color": null,
"medication": "<p>abc</p>",
"membership": "<p>abc</p>",
"medication_detail": "<p>abc</p>",
"status": 1,
"source_id": 1,
"booking_with": "abc",
"sales_agent_role": 16,
"created_at": "2023-11-29T03:50:32.000000Z",
"updated_at": "2024-07-18T22:00:13.000000Z",
"soft_delete": "0",
"category_ids": "36",
"tenant_id": "392ab90f",
"excluded_states": "[]",
"short_description": "abc",
"price": null,
"product_and_price": "[]",
"precautions": "<p>abc</p>",
"diagnosis": "<p>abc</p>",
"treatments": "<p>abc</p>",
"add_on": null,
"website": 1,
"is_multiple": 0,
"is_prevail_membership": 1,
"prevail_membership_fee": 9.99,
"order": null,
"labs": "[]",
"service_for": "both",
"is_appt_on_lab_order": "yes",
"subscription_id": null,
"renewal_template_id": null,
"patient_portal_visible": 0,
"renewal_source_id": null,
"charge_consultation": 0,
"s3_upload": 0,
"allow_lead_signup": 0,
"patient_dashboard_visible": 0,
"is_shipping": 0,
"shipping_label": "shipping",
"shipping_price": 0,
"health_benefits": null,
"gender": null,
"sales_agent_role_name": "abc",
"icon_full_url": "http://abc.jpeg",
"pivot": {
"type_id": 1,
"service_id": 1
},
"role_info": {
"id": 16,
"label": "abc",
"name": "abc",
"guard_name": "web",
"created_at": "2021-11-02T19:18:45.000000Z",
"updated_at": "2022-09-16T17:12:21.000000Z",
"soft_delete": 0,
"related_to": 0,
"tenant_id": "392ab90f",
"disable_role": 0,
"client_id": null
}
}
]
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Get Service Details
requires authentication
Retrieves details of a specific service by its ID.
This endpoint returns a detailed view of the service, including information about the service's associated subscription plan, products, add-ons, lab tests, and lab charges.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/services/143" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/services/143"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/services/143',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/services/143'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200):
{
"data": {
"id": 10,
"client_id": 1,
"template_id": 27,
"type_id": 2,
"title": "Cholesterol",
"sub_title": null,
"description": "<p>test</p>",
"starting_price": null,
"icon": "http://abc.png",
"background_color": "#000000ff",
"medication": "<p>test</p>",
"membership": "<p>test</p>",
"status": 0,
"source_id": 21,
"booking_with": "provider",
"sales_agent_role": null,
"created_at": "2020-12-16T13:22:31.000000Z",
"updated_at": "2024-07-18T20:14:43.000000Z",
"soft_delete": "0",
"link_with_ids": "1",
"category_ids": "2",
"tenant_id": "392ab90f",
"excluded_states": "[]",
"short_description": "abc",
"price": null,
"product_and_price": "[]",
"precautions": "<p>abc</p>",
"diagnosis": "<p>abc</p>",
"treatments": "<p>abc</p>",
"add_on": null,
"website": 0,
"is_multiple": 0,
"is_prevail_membership": 0,
"prevail_membership_fee": null,
"order": null,
"labs": "[]",
"service_for": "both",
"is_appt_on_lab_order": "no",
"subscription_id": null,
"renewal_template_id": null,
"patient_portal_visible": 0,
"renewal_source_id": null,
"charge_consultation": 0,
"s3_upload": 0,
"allow_lead_signup": 0,
"patient_dashboard_visible": 0,
"is_shipping": 0,
"shipping_label": "shipping",
"shipping_price": 0,
"health_benefits": null,
"gender": null,
"lab_service_charge": 0,
"client_lab_charge": 0,
"lab_test_data": null,
"sales_agent_role_name": null,
"icon_full_url": "http://abc.png",
"subscription_plan": null,
"role_info": null
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (404):
{
"message": "Service not found."
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Sources
Get a single appointment source by ID.
requires authentication
This endpoint retrieves detailed information about a specific appointment source, including its pricing, duration, funnel URL, and any linked questionnaire template. If the source is soft-deleted, it will still be included.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/sources/21" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/sources/21"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/sources/21',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/sources/21'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200):
{
"data": {
"id": 5,
"title": "Initial Consultation",
"amount": 100,
"video_amount": 120,
"async_amount": 90,
"after_approval_amount": 110,
"funnel_url": "https://example.com/funnel",
"duration": 30,
"color": "#FF5733",
"standing_order": true,
"type": "consultation",
"delay_days": 2,
"payment_method": "credit_card",
"gateway_id": "stripe",
"excluded_states": [
"NY",
"CA"
],
"questionnaire_template_id": 12
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (404):
{
"message": "Requested source not found"
}
Received response:
Request failed with error:
Get Client Active Sources
requires authentication
Returns a list of active sources associated with a client, along with the latest related questionnaire template.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/clients/123/sources" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/clients/123/sources"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/clients/123/sources',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/clients/123/sources'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()Example response (200):
{
"data": [
{
"id": 1,
"title": "Phentermine",
"amount": 1,
"after_approval_amount": 0,
"video_amount": "0.00",
"status": 1,
"state_rule": 0,
"created_at": "2020-09-25T18:32:15.000000Z",
"updated_at": "2024-04-22T22:42:56.000000Z",
"soft_delete": 0,
"funnel_url": "",
"duration": "1",
"color": "",
"type": "sync",
"subtype": "both",
"standing_order": 0,
"delay_days": 0,
"post_visit_summary": 0,
"related_to": 1,
"appointment_mode": 0,
"doc_upload_option": 1,
"payment_method": "",
"super_bill": 0,
"tenant_id": "392ab90f-3094-1529008ce3fd4",
"sync_questionnare_id": 0,
"async_questionnare_id": 0,
"async_amount": "0.00",
"rpm_amount": 0,
"gateway_id": null,
"deleted_at": null,
"qb_company_id": null,
"excluded_states": "[\"Alabama"]",
"qb_service": null,
"qb_class": null,
"async_qb_service": null,
"reassessment_id": null,
"reassessment_source_id": null,
"is_controlled_substance": 0,
"renewal_source_id": null,
"questionnaire_id": null
}
]
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (404):
{
"reason": "Client not found"
}
Received response:
Request failed with error:
State rule
State Rule Implementation
requires authentication
Retrieve the care settings (establishing and continued care) based on the provided state_name and source_id.
The response varies depending on whether custom roles and rules exist for the given source and state.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/staterule?state_name=California&source_id=21" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"https://staging.prescribery.com/api/v2/staterule"
);
const params = {
"state_name": "California",
"source_id": "21",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://staging.prescribery.com/api/v2/staterule',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'state_name'=> 'California',
'source_id'=> '21',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/staterule'
params = {
'state_name': 'California',
'source_id': '21',
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()Example response (200):
{
"data": {
"establishingCare": "audio", // Possible values: "audio", "video", "async"
"continuedCare": "audio" // Possible values: "audio", "video", "async"
}
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"state_name": [
"The state name field is required."
],
"source_id": [
"The source id field is required."
]
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (404):
{
"message": "Resource Not Found"
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error: