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": "PST",
"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\": \"02:30\",
\"start_date\": \"2025-09-20\",
\"duration_in_minutes\": \"30\",
\"start_time_period\": \"PM\",
\"timezone\": \"America\\/Los_Angeles\"
}"
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": "02:30",
"start_date": "2025-09-20",
"duration_in_minutes": "30",
"start_time_period": "PM",
"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/hold-slot',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'member_id' => 2345,
'start_time' => '02:30',
'start_date' => '2025-09-20',
'duration_in_minutes' => '30',
'start_time_period' => 'PM',
'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/hold-slot'
payload = {
"member_id": 2345,
"start_time": "02:30",
"start_date": "2025-09-20",
"duration_in_minutes": "30",
"start_time_period": "PM",
"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):
{
"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": "Prescribery Provider",
"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\": \"audio\",
\"reason\": \"Routine check-up\",
\"patient_state\": \"california\",
\"repetition\": \"Single Date\",
\"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,
\"sales_order_id\": 15,
\"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": "audio",
"reason": "Routine check-up",
"patient_state": "california",
"repetition": "Single Date",
"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,
"sales_order_id": 15,
"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' => 'audio',
'reason' => 'Routine check-up',
'patient_state' => 'california',
'repetition' => 'Single Date',
'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,
'sales_order_id' => 15,
'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": "audio",
"reason": "Routine check-up",
"patient_state": "california",
"repetition": "Single Date",
"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,
"sales_order_id": 15,
"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:
Get Patient Medication Status
requires authentication
Calculate medication status (rest period, active days, etc.) for a patient across multiple products.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/appointment/patient-medication-status?patient_id=45&product_ids=%22148%2C149%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-medication-status"
);
const params = {
"patient_id": "45",
"product_ids": ""148,149"",
};
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-medication-status',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'patient_id'=> '45',
'product_ids'=> '"148,149"',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/appointment/patient-medication-status'
params = {
'patient_id': '45',
'product_ids': '"148,149"',
}
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):
{
"success": true,
"data": {
"148": {
"Enclomiphene": {
"can_order": false,
"reason": "Patient is in rest period",
"rest_days_remaining": 5,
"can_order_date": "2026-05-19",
"days_passed": 25,
"days_of_supply": 30
}
}
}
}
Example response (422):
{
"success": false,
"message": "patient_id is required"
}
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\": \"quidem\"
}"
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": "quidem"
};
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' => 'quidem',
],
]
);
$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": "quidem"
}
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:
User Login
Authenticate a user using their registered email address and password. Upon successful authentication, the system generates a Personal Access Token which must be used to access protected endpoints.
How it works:
- The user submits their email address and password.
- The request payload is validated.
- The credentials are verified against the stored user account.
- If authentication succeeds:
- User Profile information and Personal Access Token is returned.
- If authentication fails, an unauthorized response is returned.
When to use:
Use this endpoint when a user wants to sign in to the application. The returned access token should be included in the Authorization header for all authenticated API requests.
Example Authorization Header:
Authorization: Bearer <access_token>
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/user/sign-in" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"johndoe@example.com\",
\"password\": \"password@123\",
\"fcm_token\": \"fMEP0vJqS0uZ...\"
}"
const url = new URL(
"https://staging.prescribery.com/api/v2/user/sign-in"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "johndoe@example.com",
"password": "password@123",
"fcm_token": "fMEP0vJqS0uZ..."
};
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/user/sign-in',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'email' => 'johndoe@example.com',
'password' => 'password@123',
'fcm_token' => 'fMEP0vJqS0uZ...',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/user/sign-in'
payload = {
"email": "johndoe@example.com",
"password": "password@123",
"fcm_token": "fMEP0vJqS0uZ..."
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"message": "Login Successful!",
"data": {
"member_id": 1,
"country": "United States of America",
"gender": "male",
"city": "San Francisco",
"prefix": "",
"degree": "",
"mobile": "6012345678",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"zip_code": "94016",
"address_line1": "123 Main St",
"address_line2": "",
"state": "CA",
"created_date": "2020-01-01 00:00:00",
"email": "johndoe@example.com",
"introduction": "",
"dtg": "8445589773",
"avatar": "https://example.com/avatar.jpg",
"s3_upload": 0,
"user_details" : {
"id": 1,
"user_id": 1,
"date_of_birth": "1990-01-01",
"birth_place": "San Francisco",
"gender": "male",
"practice_experience": 5,
"appointment_delay_minutes": 30,
"specialists": ["1","2","3"],
"sub_specialists": ["1","2","3"],
"board_certified": "DCNA",
"certifying_board": "American Board of Internal Medicine"
},
"state_code": "CA",
"specialization": "",
"is_member_photo_available": "",
"token" : {
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...",
"token_type": "Bearer",
}
}
Example response (400):
{
"message": "Request failed!",
"reason": {
"email": "The email field is required.",
"password": "The password field is required."
},
"data": {}
}
Example response (401):
{
"message": "Request failed!",
"reason": "Unauthorized Access! Please check username and password are correct and try again.",
"data": {}
}
Received response:
Request failed with error:
Generate OTP
This endpoint is used to generate a one-time password (OTP) for a user.
How it works:
- Clients make a POST request to this endpoint, providing the user's email address.
- The server generates a random 6-digit OTP and sends it to the user's email address.
When to use:
- This endpoint should be used when a user wants to reset their password.
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/user/generate-otp" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"johndoe@example.com\"
}"
const url = new URL(
"https://staging.prescribery.com/api/v2/user/generate-otp"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "johndoe@example.com"
};
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/user/generate-otp',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'email' => 'johndoe@example.com',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/user/generate-otp'
payload = {
"email": "johndoe@example.com"
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"message": "OTP has been sent to your email.",
"data": {}
}
Example response (400):
{
"message": "Request failed!",
"reason": {
"email": "The email field is required."
},
"data": {}
}
Example response (404):
{
"message": "Request failed!",
"reason": "Email not found.",
"data": {}
}
Received response:
Request failed with error:
Create New Password
This endpoint is used to reset the password for a user.
How it works:
- Clients make a POST request to this endpoint, providing the user's email address, verification code, and new password.
- The server verifies the verification code and updates the user's password.
When to use:
- This endpoint should be used when a user wants to reset their password after receiving an OTP.
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/user/create-password" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"johndoe@example.com\",
\"verification_code\": \"123456\",
\"password\": \"Password@123\",
\"password_confirmation\": \"Password@123\"
}"
const url = new URL(
"https://staging.prescribery.com/api/v2/user/create-password"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "johndoe@example.com",
"verification_code": "123456",
"password": "Password@123",
"password_confirmation": "Password@123"
};
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/user/create-password',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'email' => 'johndoe@example.com',
'verification_code' => '123456',
'password' => 'Password@123',
'password_confirmation' => 'Password@123',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/user/create-password'
payload = {
"email": "johndoe@example.com",
"verification_code": "123456",
"password": "Password@123",
"password_confirmation": "Password@123"
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"message": "Password saved successfully!",
"data": {}
}
Example response (400):
{
"message": "Request failed!",
"reason": {
"email": "The email field is required.",
"verification_code": "The verification code field is required.",
"password": "The password field is required.",
"password_confirmation": "The password confirmation field is required.",
"password.regex": "Your password must be more than 8 characters long, should contain at least 1 Uppercase, 1 Lowercase, 1 Numeric, and 1 special character."
},
"data": {}
}
Example response (404, Invalid verification code):
{
"message": "Verification code not matched!",
"data": {}
}
Example response (404, Email not found):
{
"message": "Request Failed!",
"reason": "Email not found.",
"data": {}
}
Received response:
Request failed with error:
Generate SSO Login Token
Issues a short-lived, single-use SSO login token for a patient, on behalf of a trusted external client identified by its registered SSO client ID/secret.
How it works:
- The calling system submits its registered sso_client_id, sso_client_secret, and the patient's email.
- The client credentials are verified against the registered SSO client.
- A short-lived, single-use SSO token is generated for the matched, active patient.
When to use:
Use this endpoint server-to-server when a patient who is already authenticated on an
external system (e.g. WordPress) clicks through to the Prescribery patient portal and
should be logged in automatically. Append the returned token as ?sso_token=<token> to
the patient login URL and redirect the patient's browser there.
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/sso/token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"sso_client_id\": \"sso_xxxxxxxxxxxxxxxxxxxxxxxx\",
\"sso_client_secret\": \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\",
\"email\": \"johndoe@example.com\"
}"
const url = new URL(
"https://staging.prescribery.com/api/v2/sso/token"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"sso_client_id": "sso_xxxxxxxxxxxxxxxxxxxxxxxx",
"sso_client_secret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"email": "johndoe@example.com"
};
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/sso/token',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'sso_client_id' => 'sso_xxxxxxxxxxxxxxxxxxxxxxxx',
'sso_client_secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'email' => 'johndoe@example.com',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/sso/token'
payload = {
"sso_client_id": "sso_xxxxxxxxxxxxxxxxxxxxxxxx",
"sso_client_secret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"email": "johndoe@example.com"
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"message": "SSO token generated successfully!",
"data": {
"token": "Cnc7WqjkyC...",
"expires_in": 180
}
}
Example response (400):
{
"message": "Request failed!",
"reason": {
"email": "The email field is required."
},
"data": {}
}
Example response (401):
{
"message": "Request failed!",
"reason": "Invalid SSO credentials.",
"data": {}
}
Example response (404):
{
"message": "Request failed!",
"reason": "Patient not found.",
"data": {}
}
Example response (422):
{
"message": "Request failed!",
"reason": "Unable to identify patient.",
"data": {}
}
Received response:
Request failed with error:
Clients
Get Client Addon Consultation Fees
requires authentication
Returns the addon consultation fee for a specific client. If the client has a specific fee set, it will be returned; otherwise, the default global fee will be used.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/client/1/addon-consultation-fees" \
--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/client/1/addon-consultation-fees"
);
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/client/1/addon-consultation-fees',
[
'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/client/1/addon-consultation-fees'
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):
{
"status": true,
"addon_consultation_fee": 10
}
Example response (404):
{
"message": "Client not found"
}
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\": [
\"officiis\"
],
\"source_id\": 21,
\"service_id\": 3,
\"reason\": \"\\\"Routine checkup\\\"\",
\"payment_status\": \"paid\",
\"payment_amount\": 250.75,
\"charge_id\": \"ch_123456\",
\"payment_method\": \"card\",
\"external_order_id\": \"\\\"10045\\\"\"
}"
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": [
"officiis"
],
"source_id": 21,
"service_id": 3,
"reason": "\"Routine checkup\"",
"payment_status": "paid",
"payment_amount": 250.75,
"charge_id": "ch_123456",
"payment_method": "card",
"external_order_id": "\"10045\""
};
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' => [
'officiis',
],
'source_id' => 21,
'service_id' => 3,
'reason' => '"Routine checkup"',
'payment_status' => 'paid',
'payment_amount' => 250.75,
'charge_id' => 'ch_123456',
'payment_method' => 'card',
'external_order_id' => '"10045"',
],
]
);
$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": [
"officiis"
],
"source_id": 21,
"service_id": 3,
"reason": "\"Routine checkup\"",
"payment_status": "paid",
"payment_amount": 250.75,
"charge_id": "ch_123456",
"payment_method": "card",
"external_order_id": "\"10045\""
}
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.
Only unpaid (pending) orders are returned. After a successful POST /lab/update-order-details
(or any other payment), this endpoint responds 404 with "Sorry! lab test detail not found."
The order still exists — 404 here means it has already been paid, not that the token or order
is missing.
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": "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"
}
Example response (404):
{
"message": "Sorry! lab test detail not found."
}
Received response:
Request failed with error:
Update Lab Order Details
requires authentication
Records payment for a still-pending lab order using the token from save-test-order.
To mark the order Paid, send patient_id, token, amount, and charge_id.
There is no payment_status request field — supplying amount together with charge_id
is the payment assertion. That flips patient_lab_payments.payment_status from
pending to success and the linked lab_test_submittions.payment_status from
pending to paid. On GET /lab/{clientId}/lab-orders those values surface as
Title-case "Paid".
A 400 with "Lab test payment could not be completed." means the order was already
paid (the update only matches a still-pending payment) or the token/patient did not
match. It is not a malformed-payload error and is not retryable; treat the order as already paid.
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,
\"token\": \"abc123xyz\",
\"amount\": 1500,
\"charge_id\": \"ch_123456\"
}"
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,
"token": "abc123xyz",
"amount": 1500,
"charge_id": "ch_123456"
};
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,
'token' => 'abc123xyz',
'amount' => 1500.0,
'charge_id' => 'ch_123456',
],
]
);
$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,
"token": "abc123xyz",
"amount": 1500,
"charge_id": "ch_123456"
}
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 lab test payment has been completed successfully."
}
Example response (400):
{
"message": "Lab test payment could not be completed."
}
Example response (422):
{
"message": "Validation failed",
"errors": {
"amount": [
"The amount must be a number."
]
}
}
Example response (401):
{
"message": "Unauthenticated"
}
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/phppaywIP" 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/phppaywIP', '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/phppaywIP', '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"
}
Example response (422):
{
"message": "Patient not found"
}
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.
Response field types and casing (do not rely on lowercase comparisons):
serial_nois an alphanumeric string (order number), not an integer.order_amountis a string, not a number.payment_statusis Title-case:"Paid"or"Pending".=== "paid"will never match.results_statusis Title-case:"Completed"once a callback PDF url exists for the order, otherwise"Pending".client_nameis the client's display name.
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": "2619978383791PR1002",
"order_amount": "100.50",
"panel": "Basic Metabolic Panel",
"patient_id": "1",
"patient_name": "John Doe",
"payment_status": "Paid",
"client_name": "Prescribery",
"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:
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/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/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/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/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,
"method": 5,
"lab_type": 3,
"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:
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\\\"\",
\"source\": \"\\\"Facebook, Product Type, Site\\\"\",
\"sign_up_reason\": \"\\\"Product name\\\"\"
}"
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\"",
"source": "\"Facebook, Product Type, Site\"",
"sign_up_reason": "\"Product name\""
};
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"',
'source' => '"Facebook, Product Type, Site"',
'sign_up_reason' => '"Product name"',
],
]
);
$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\"",
"source": "\"Facebook, Product Type, Site\"",
"sign_up_reason": "\"Product name\""
}
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\": \"\\\"Product Name\\\"\",
\"zip_code\": \"\\\"94016\\\"\",
\"term_service\": \"\\\"yes\\\"\",
\"status\": \"iure\",
\"agent_id\": 5,
\"email\": \"vullrich@example.net\",
\"source\": \"\\\"Facebook\\\"\"
}"
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": "\"Product Name\"",
"zip_code": "\"94016\"",
"term_service": "\"yes\"",
"status": "iure",
"agent_id": 5,
"email": "vullrich@example.net",
"source": "\"Facebook\""
};
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' => '"Product Name"',
'zip_code' => '"94016"',
'term_service' => '"yes"',
'status' => 'iure',
'agent_id' => 5,
'email' => 'vullrich@example.net',
'source' => '"Facebook"',
],
]
);
$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": "\"Product Name\"",
"zip_code": "\"94016\"",
"term_service": "\"yes\"",
"status": "iure",
"agent_id": 5,
"email": "vullrich@example.net",
"source": "\"Facebook\""
}
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:
Get Leads
requires authentication
Retrieves a paginated list of active leads assigned to the authenticated user. Closed (Lost), Disqualified, Duplicate, and converted patient leads are excluded.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/lead" \
--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/lead"
);
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/lead',
[
'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/lead'
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": "Leads fetched successfully.",
"data": {
"current_page": 1,
"data": [
{
"id": 1142,
"name": "Lana",
"email": "lana@yopmail.com",
"phone_number": "6012451223",
"patient_id": null,
"status_id": 1,
"status": "New",
"user_id": 1034,
"source": null,
"patient_type": "new",
"disqualified_reason": null,
"source_id": 308,
"assigned_to": 1034,
"address_line": "123 Test Street",
"source_info": {
"id": 308,
"title": "Dietdec",
"amount": "50.00",
"status": 1
}
}
],
"from": 1,
"to": 1,
"last_page": 1,
"per_page": 10,
"total": 1
}
}
Example response (200):
{
"message": "Leads fetched successfully.",
"data": {
"current_page": 1,
"data": [],
"total": 0
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (500):
{
"data": [],
"message": "An unexpected error occurred while fetching leads."
}
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:
Patient Zendesk
Create a Zendesk ticket for a patient.
requires authentication
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/patient/zendesk/ticket" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"patient_id\": 390,
\"subject\": \"This is sample subject\",
\"body\": \"This is sample ticket\"
}"
const url = new URL(
"https://staging.prescribery.com/api/v2/patient/zendesk/ticket"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"patient_id": 390,
"subject": "This is sample subject",
"body": "This is sample ticket"
};
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/patient/zendesk/ticket',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'patient_id' => 390,
'subject' => 'This is sample subject',
'body' => 'This is sample ticket',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/patient/zendesk/ticket'
payload = {
"patient_id": 390,
"subject": "This is sample subject",
"body": "This is sample ticket"
}
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):
{
"status": "success",
"message": "Ticket created successfully.",
"data": {
"zendesk_ticket_id": 12345
}
}
Example response (422):
{
"status": "error",
"errors": {
"patient_id": "The patient id field is required."
}
}
Example response (500):
{
"status": "error",
"message": "Something went wrong",
"data": []
}
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=vel&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": "vel",
"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'=> 'vel',
'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': 'vel',
'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": "5",
"weight": "60",
"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,
\"informed_consent\": true,
\"height\": \"73 i.e. 6\'1\\\"\",
\"weight\": \"135\",
\"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,
"informed_consent": true,
"height": "73 i.e. 6'1\"",
"weight": "135",
"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,
'informed_consent' => true,
'height' => '73 i.e. 6\'1"',
'weight' => '135',
'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,
"informed_consent": true,
"height": "73 i.e. 6'1\"",
"weight": "135",
"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": "5",
"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,
"informed_consent": 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,
\"informed_consent\": 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,
"informed_consent": 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,
'informed_consent' => 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,
"informed_consent": 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",
"address_line1": "123 Elm Street",
"height": "5",
"weight": "60",
"created_date": "2025-07-10 09:20:00",
},
}
],
}
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). document_file must be a
full data URL (data:<mime>;base64,<payload>), not a bare base64 string.
The upload response wraps items in documents and identifies each with document_id
(and document_title). This is a different shape from GET /patients/{patientId}/documents,
which wraps items in data and uses id / title. Do not share a single client type
between the two endpoints.
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/et/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/et/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/et/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/et/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:
Patient document detail
requires authentication
Get a list of document data by the patient id and document id
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/patients/voluptas/documents/sit" \
--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/voluptas/documents/sit"
);
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/voluptas/documents/sit',
[
'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/voluptas/documents/sit'
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": 1642,
"patient_id": 11,
"title": "dummy",
"document_file": "https://example.com",
"status": 0,
"verified": null,
"document_expiry_date": null,
"s3_upload": 1,
"created_at":2023-09-15 11:59:43,
"mode_of_upload": null,
"who_upload_document": null,
"rotate_deg": null,
"document_file_back": null,
"is_edit": 1,
"file_name": "Image1633342069.jpeg"
}
],
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Get patient documents
requires authentication
Get a list of patient documents by the patient.
page and per_page are required query parameters with no defaults — omitting either
returns 422. per_page must be an integer from 10 to 20 inclusive; values above 20
(for example 50) also return 422.
List items are wrapped in data and identified by id (and title). This is not the
same shape as POST /patients/{patientId}/documents, which wraps items in documents
and uses document_id / document_title. Do not share a single client type between
the two endpoints.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/patients/1/documents?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/1/documents"
);
const params = {
"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/1/documents',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'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/1/documents'
params = {
'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": [
{
"id": 1642,
"patient_id": 5,
"title": "dummy",
"document_file": "https://example.com",
"status": 0,
"verified": null,
"document_expiry_date": null,
"s3_upload": 1,
"created_at": "2023-09-15 11:59:43",
"mode_of_upload": null,
"who_upload_document": null,
"rotate_deg": null,
"document_file_back": null,
"is_edit": 1,
"file_name": "Image1633342069.jpeg"
}
],
"pagination": {
"page": 1,
"per_page": 10,
"has_more_page": true
}
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"page": [
"The page field is required."
],
"per_page": [
"The per page field is required."
]
}
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Get Patient Details
requires authentication
This endpoint retrieves the details of a specific patient using the provided patient ID.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/patients/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/patients/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/patients/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/patients/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):
{
"data": [
{
"id": 42,
"gender": "female",
"first_name": "Alice",
"email": "alice@example.com",
"created_time": "2025-07-09 10:32:00",
"mobile": "9876543210",
"last_name": "Smith",
"full_name": "Alice Smith",
"dob": "1990-05-01",
"record_id": "PAT1023",
"patient_id": 42,
"created_date": "2025-07-09 10:32:00",
"active": "active",
"postal_code": "10001",
"city": "New York",
"state": "NY",
"height": "5",
"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,
"status": "active",
"is_verified": true,
"driver_license_number": "ABC123456",
"language": "English",
"communication_type": "phone",
"referred_by": "Facebook",
"informed_consent": true,
"shipping_address_line1": "3555 Front St",
"shipping_address_line2": "3555 Front St",
"shipping_city": "San Diego",
"shipping_state": "California",
"shipping_country": "us",
"shipping_postal_code": null
}
]
}
Example response (404):
{
"message": "Patient not found"
}
Example response (422):
{
"message": "Patient id field is required"
}
Example response (401):
{
"message": "Unauthenticated - Token missing or invalid"
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Get Privacy Policy / Terms of Use
requires authentication
Returns the privacy policy or consent/terms content for a client.
If clientId is provided, the API returns the consent content
associated with that client. Otherwise, it attempts to resolve
the client using the current subdomain.
If no client-specific consent exists, the default privacy policy is returned.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/patients/privacy-policy/5" \
--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/privacy-policy/5"
);
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/privacy-policy/5',
[
'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/privacy-policy/5'
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": "Your privacy policy or terms of use content here..."
}
Example response (401):
{
"message": "Unauthenticated - Token missing or invalid"
}
Example response (404):
{
"message": "Terms of use not found for the given client"
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Get Informed Consent
requires authentication
Returns the informed consent content for compounded or non-FDA-approved peptide treatment from the config file.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/patients/informed-consent" \
--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/informed-consent"
);
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/informed-consent',
[
'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/informed-consent'
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": "Informed Consent for Compounded or Non-FDA-Approved Peptide Treatment..."
}
Example response (401):
{
"message": "Unauthenticated - Token missing or invalid"
}
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:
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:
Get Patient Transactions
requires authentication
Returns the complete payment history for a specified patient. Supports optional filters for date range and payment status.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/patients/1/transactions?from_date=2026-05-01&to_date=2026-05-31&status=success&page=1&per_page=15" \
--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/1/transactions"
);
const params = {
"from_date": "2026-05-01",
"to_date": "2026-05-31",
"status": "success",
"page": "1",
"per_page": "15",
};
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/1/transactions',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'from_date'=> '2026-05-01',
'to_date'=> '2026-05-31',
'status'=> 'success',
'page'=> '1',
'per_page'=> '15',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/patients/1/transactions'
params = {
'from_date': '2026-05-01',
'to_date': '2026-05-31',
'status': 'success',
'page': '1',
'per_page': '15',
}
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):
{
"current_page": 1,
"data": [
{
"transaction_id": "TXN123456",
"patient_id": "PAT1023",
"name": "John Doe",
"product": "encounter",
"amount": "150.00",
"status": "success",
"reason": "test",
"updated_at": "2026-05-10 12:45:00"
"date_of_the_refund": "2026-05-10 12:45:00",
}
],
"from": 1,
"last_page": 1,
"per_page": 10,
"has_more_page": 1,
"total": "false"
}
Example response (404):
{
"message": "Patient not found with this ID",
"status": "error"
}
Example response (401):
{
"message": "Unauthenticated - Token missing or invalid"
}
Example response (422):
{
"message": "Validation failed"
}
Example response (500):
{
"message": "Internal Server Error"
}
Received response:
Request failed with error:
Get Client Payments Details
requires authentication
This endpoint retrieves all payment records associated with a specific client (via their active sources). It supports filtering by date range, payment status, and search keyword.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/transactions?clientId=123&from_date=2026-05-01&to_date=2026-05-31&status=success&search=John&page=1&per_page=15" \
--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/transactions"
);
const params = {
"clientId": "123",
"from_date": "2026-05-01",
"to_date": "2026-05-31",
"status": "success",
"search": "John",
"page": "1",
"per_page": "15",
};
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/transactions',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'clientId'=> '123',
'from_date'=> '2026-05-01',
'to_date'=> '2026-05-31',
'status'=> 'success',
'search'=> 'John',
'page'=> '1',
'per_page'=> '15',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/transactions'
params = {
'clientId': '123',
'from_date': '2026-05-01',
'to_date': '2026-05-31',
'status': 'success',
'search': 'John',
'page': '1',
'per_page': '15',
}
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):
{
"current_page": 1,
"data": [
{
"transaction_id": "txn_3Nxxxxxxxxxxx",
"patient_id": 412,
"name": "Jane Doe",
"product": "Consultation",
"amount": 100,
"status": "success",
"reason": null,
"updated": "2026-05-18 12:00:00",
"date_of_the_refund": null
}
],
"last_page": 1,
"per_page": 15,
"total": 1,
"has_more_page": false
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (404):
{
"message": "Client not found"
}
Received response:
Request failed with error:
Get Payment Token
requires authentication
Generates a client token or public key for the requested payment gateway.
If source_id, client_id, or gateway_id is passed, the token is generated using that gateway's credentials.
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,
\"gateway_id\": 11
}"
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,
"gateway_id": 11
};
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,
'gateway_id' => 11,
],
]
);
$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,
"gateway_id": 11
}
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": 11,
"payment_method": "braintree"
}
Example response (400):
{
"message": "Unsupported payment method."
}
Example response (404):
{
"message": "Client not found"
}
Example response (500):
{
"message": "Internal Server Error."
}
Received response:
Request failed with error:
Initiate Payment
requires authentication
Charges a patient using the requested payment gateway and a client-generated nonce/token. 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\": 11,
\"qb_channel\": \"online\",
\"aptType\": \"async\",
\"add_card\": \"on\",
\"makeDefault\": true,
\"expiration\": \"10\\/29\",
\"cardF4L4\": \"****1111\"
}"
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": 11,
"qb_channel": "online",
"aptType": "async",
"add_card": "on",
"makeDefault": true,
"expiration": "10\/29",
"cardF4L4": "****1111"
};
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' => 11,
'qb_channel' => 'online',
'aptType' => 'async',
'add_card' => 'on',
'makeDefault' => true,
'expiration' => '10/29',
'cardF4L4' => '****1111',
],
]
);
$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": 11,
"qb_channel": "online",
"aptType": "async",
"add_card": "on",
"makeDefault": true,
"expiration": "10\/29",
"cardF4L4": "****1111"
}
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": 11,
"payment_method": "braintree"
}
Example response (400):
{
"message": "Unsupported payment method."
}
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 Payment Card
requires authentication
Vaults a card for the patient on the requested payment gateway 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,
\"gateway_id\": 11,
\"makeDefault\": true,
\"cardF4L4\": \"****1111\",
\"card_type\": \"ut\",
\"expiration\": \"10\\/29\"
}"
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,
"gateway_id": 11,
"makeDefault": true,
"cardF4L4": "****1111",
"card_type": "ut",
"expiration": "10\/29"
};
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,
'gateway_id' => 11,
'makeDefault' => true,
'cardF4L4' => '****1111',
'card_type' => 'ut',
'expiration' => '10/29',
],
]
);
$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,
"gateway_id": 11,
"makeDefault": true,
"cardF4L4": "****1111",
"card_type": "ut",
"expiration": "10\/29"
}
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):
{
"payment_token": "abc123xyz",
"customer_id": "cust_456def",
"payment_method": "braintree"
}
Example response (400):
{
"message": "Unsupported payment method."
}
Example response (404):
{
"message": "Patient not found"
}
Example response (422):
{
"message": "The nonce field is required."
}
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:
Providers
Sign Up a Provider
requires authentication
Register a new healthcare provider with all required details and documents.
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/provider/signup" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "first_name=John" \
--form "last_name=Doe" \
--form "date_of_birth=1985-05-15" \
--form "city=New York" \
--form "zip_code=10001" \
--form "state=NY" \
--form "country=USA" \
--form "email=john.doe@example.com" \
--form "password=Password@123" \
--form "password_confirmation=Password@123" \
--form "phone_number=1234567890" \
--form "address=123 Main St, New York, NY" \
--form "gender=Male" \
--form "license_type=MD" \
--form "birth_place=Los Angeles" \
--form "social_security_number=123-45-6789" \
--form "practice_experience=10" \
--form "board_certified=Yes" \
--form "certifying_board=American Board of Internal Medicine" \
--form "npi_number=1234567890" \
--form "taxonomy=207R00000X" \
--form "caqh_number=12345678" \
--form "medicare_patn=PTN123456" \
--form "medicaid_number=MC123456" \
--form "malpractice_history=None" \
--form "hours_availabilty=8" \
--form "specialist[]=Urology" \
--form "sub_specialist[]=Allergy and immunology" \
--form "active_dea_substance_certificate[]=California" \
--form "active_state_medical_licenses[]=Alaska" \
--form "available_days[]=1" \
--form "current_cv=@/tmp/php9ZEZPP" \
--form "medical_degree[][]=@/tmp/phpChPkqQ" \
--form "training_certificate[][]=@/tmp/phpawfDOR" \
--form "board_certificate[][]=@/tmp/phpE5hnzS" \
--form "driver_license[][]=@/tmp/phpXZu3ES" \
--form "medical_license[][]=@/tmp/phpnJ7e4Q" \
--form "substance_certificate[][]=@/tmp/phpqkdnEO" \
--form "certificate_insurance[][]=@/tmp/phpNTekMO" const url = new URL(
"https://staging.prescribery.com/api/v2/provider/signup"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('first_name', 'John');
body.append('last_name', 'Doe');
body.append('date_of_birth', '1985-05-15');
body.append('city', 'New York');
body.append('zip_code', '10001');
body.append('state', 'NY');
body.append('country', 'USA');
body.append('email', 'john.doe@example.com');
body.append('password', 'Password@123');
body.append('password_confirmation', 'Password@123');
body.append('phone_number', '1234567890');
body.append('address', '123 Main St, New York, NY');
body.append('gender', 'Male');
body.append('license_type', 'MD');
body.append('birth_place', 'Los Angeles');
body.append('social_security_number', '123-45-6789');
body.append('practice_experience', '10');
body.append('board_certified', 'Yes');
body.append('certifying_board', 'American Board of Internal Medicine');
body.append('npi_number', '1234567890');
body.append('taxonomy', '207R00000X');
body.append('caqh_number', '12345678');
body.append('medicare_patn', 'PTN123456');
body.append('medicaid_number', 'MC123456');
body.append('malpractice_history', 'None');
body.append('hours_availabilty', '8');
body.append('specialist[]', 'Urology');
body.append('sub_specialist[]', 'Allergy and immunology');
body.append('active_dea_substance_certificate[]', 'California');
body.append('active_state_medical_licenses[]', 'Alaska');
body.append('available_days[]', '1');
body.append('current_cv', document.querySelector('input[name="current_cv"]').files[0]);
body.append('medical_degree[][]', document.querySelector('input[name="medical_degree[][]"]').files[0]);
body.append('training_certificate[][]', document.querySelector('input[name="training_certificate[][]"]').files[0]);
body.append('board_certificate[][]', document.querySelector('input[name="board_certificate[][]"]').files[0]);
body.append('driver_license[][]', document.querySelector('input[name="driver_license[][]"]').files[0]);
body.append('medical_license[][]', document.querySelector('input[name="medical_license[][]"]').files[0]);
body.append('substance_certificate[][]', document.querySelector('input[name="substance_certificate[][]"]').files[0]);
body.append('certificate_insurance[][]', document.querySelector('input[name="certificate_insurance[][]"]').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/provider/signup',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'first_name',
'contents' => 'John'
],
[
'name' => 'last_name',
'contents' => 'Doe'
],
[
'name' => 'date_of_birth',
'contents' => '1985-05-15'
],
[
'name' => 'city',
'contents' => 'New York'
],
[
'name' => 'zip_code',
'contents' => '10001'
],
[
'name' => 'state',
'contents' => 'NY'
],
[
'name' => 'country',
'contents' => 'USA'
],
[
'name' => 'email',
'contents' => 'john.doe@example.com'
],
[
'name' => 'password',
'contents' => 'Password@123'
],
[
'name' => 'password_confirmation',
'contents' => 'Password@123'
],
[
'name' => 'phone_number',
'contents' => '1234567890'
],
[
'name' => 'address',
'contents' => '123 Main St, New York, NY'
],
[
'name' => 'gender',
'contents' => 'Male'
],
[
'name' => 'license_type',
'contents' => 'MD'
],
[
'name' => 'birth_place',
'contents' => 'Los Angeles'
],
[
'name' => 'social_security_number',
'contents' => '123-45-6789'
],
[
'name' => 'practice_experience',
'contents' => '10'
],
[
'name' => 'board_certified',
'contents' => 'Yes'
],
[
'name' => 'certifying_board',
'contents' => 'American Board of Internal Medicine'
],
[
'name' => 'npi_number',
'contents' => '1234567890'
],
[
'name' => 'taxonomy',
'contents' => '207R00000X'
],
[
'name' => 'caqh_number',
'contents' => '12345678'
],
[
'name' => 'medicare_patn',
'contents' => 'PTN123456'
],
[
'name' => 'medicaid_number',
'contents' => 'MC123456'
],
[
'name' => 'malpractice_history',
'contents' => 'None'
],
[
'name' => 'hours_availabilty',
'contents' => '8'
],
[
'name' => 'specialist[]',
'contents' => 'Urology'
],
[
'name' => 'sub_specialist[]',
'contents' => 'Allergy and immunology'
],
[
'name' => 'active_dea_substance_certificate[]',
'contents' => 'California'
],
[
'name' => 'active_state_medical_licenses[]',
'contents' => 'Alaska'
],
[
'name' => 'available_days[]',
'contents' => '1'
],
[
'name' => 'current_cv',
'contents' => fopen('/tmp/php9ZEZPP', 'r')
],
[
'name' => 'medical_degree[][]',
'contents' => fopen('/tmp/phpChPkqQ', 'r')
],
[
'name' => 'training_certificate[][]',
'contents' => fopen('/tmp/phpawfDOR', 'r')
],
[
'name' => 'board_certificate[][]',
'contents' => fopen('/tmp/phpE5hnzS', 'r')
],
[
'name' => 'driver_license[][]',
'contents' => fopen('/tmp/phpXZu3ES', 'r')
],
[
'name' => 'medical_license[][]',
'contents' => fopen('/tmp/phpnJ7e4Q', 'r')
],
[
'name' => 'substance_certificate[][]',
'contents' => fopen('/tmp/phpqkdnEO', 'r')
],
[
'name' => 'certificate_insurance[][]',
'contents' => fopen('/tmp/phpNTekMO', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/provider/signup'
files = {
'current_cv': open('/tmp/php9ZEZPP', 'rb'),
'medical_degree[][]': open('/tmp/phpChPkqQ', 'rb'),
'training_certificate[][]': open('/tmp/phpawfDOR', 'rb'),
'board_certificate[][]': open('/tmp/phpE5hnzS', 'rb'),
'driver_license[][]': open('/tmp/phpXZu3ES', 'rb'),
'medical_license[][]': open('/tmp/phpnJ7e4Q', 'rb'),
'substance_certificate[][]': open('/tmp/phpqkdnEO', 'rb'),
'certificate_insurance[][]': open('/tmp/phpNTekMO', 'rb')
}
payload = {
"first_name": "John",
"last_name": "Doe",
"date_of_birth": "1985-05-15",
"city": "New York",
"zip_code": "10001",
"state": "NY",
"country": "USA",
"email": "john.doe@example.com",
"password": "Password@123",
"password_confirmation": "Password@123",
"phone_number": "1234567890",
"address": "123 Main St, New York, NY",
"gender": "Male",
"license_type": "MD",
"birth_place": "Los Angeles",
"social_security_number": "123-45-6789",
"practice_experience": "10",
"board_certified": "Yes",
"certifying_board": "American Board of Internal Medicine",
"npi_number": "1234567890",
"taxonomy": "207R00000X",
"caqh_number": "12345678",
"medicare_patn": "PTN123456",
"medicaid_number": "MC123456",
"malpractice_history": "None",
"hours_availabilty": "8",
"specialist": [
"Urology",
"Dermatology"
],
"sub_specialist": [
"Allergy and immunology"
],
"active_dea_substance_certificate": [
"California"
],
"active_state_medical_licenses": [
"Alaska",
"Colorado"
],
"available_days": [
1,
3,
5
]
}
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": "Free"
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"email": [
"The email has already been taken."
]
}
}
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:
Check slot availability for a provider.
requires authentication
This endpoint checks whether a given time slot for a provider (doctor) is available for booking. It validates the input, verifies the provider exists and has the correct role, then checks for any overlapping appointments.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/provider/slot/status?doctor_id=15&start_date=2025-09-25&start_time=09%3A00%3A00&end_time=09%3A30%3A00" \
--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/provider/slot/status"
);
const params = {
"doctor_id": "15",
"start_date": "2025-09-25",
"start_time": "09:00:00",
"end_time": "09:30:00",
};
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/provider/slot/status',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'doctor_id'=> '15',
'start_date'=> '2025-09-25',
'start_time'=> '09:00:00',
'end_time'=> '09:30:00',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/provider/slot/status'
params = {
'doctor_id': '15',
'start_date': '2025-09-25',
'start_time': '09:00:00',
'end_time': '09:30:00',
}
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": "[]"
}
Example response (401):
{
"message": "Unauthenticated."
}
Example response (404):
{
"message": "Provider not found"
}
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\": \"dolore\",
\"ques_map_id\": 5,
\"coupon_code\": \"\\\"FREEMED2025\\\"\",
\"ip_address\": \"\\\"192.168.1.1\\\"\",
\"questionnaire_id\": 12,
\"service_ids\": \"1,2,3\"
}"
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": "dolore",
"ques_map_id": 5,
"coupon_code": "\"FREEMED2025\"",
"ip_address": "\"192.168.1.1\"",
"questionnaire_id": 12,
"service_ids": "1,2,3"
};
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' => 'dolore',
'ques_map_id' => 5,
'coupon_code' => '"FREEMED2025"',
'ip_address' => '"192.168.1.1"',
'questionnaire_id' => 12,
'service_ids' => '1,2,3',
],
]
);
$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": "dolore",
"ques_map_id": 5,
"coupon_code": "\"FREEMED2025\"",
"ip_address": "\"192.168.1.1\"",
"questionnaire_id": 12,
"service_ids": "1,2,3"
}
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=&service_ids=1%2C2%2C3" \
--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",
"service_ids": "1,2,3",
};
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',
'service_ids'=> '1,2,3',
],
]
);
$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',
'service_ids': '1,2,3',
}
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": "",
"isConditional": "",
"title": "",
"subTitle": "",
"flow": "",
"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",
"upload_file_type": "",
"allow_multiple_files": ""
}
]
}
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?client_id=123&id=12&search=dental&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 = {
"client_id": "123",
"id": "12",
"search": "dental",
"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' => [
'client_id'=> '123',
'id'=> '12',
'search'=> 'dental',
'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 = {
'client_id': '123',
'id': '12',
'search': 'dental',
'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 medication
Check State Medication Availability
Given a client, a source and a list of WooCommerce product ids, resolve each product to the
medicine(s) it is mapped to (client + source -> eRx template -> template JSON medicinesArr
-> drug -> medicine) and report, for every requested state, whether each resolved medicine is
available (not part of the state rule excludedMeds list).
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/state-medications/check-availability" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"client_id\": 259,
\"source_id\": 21,
\"wc_product_ids\": [
\"8366804107556\",
\"10154388357412\"
],
\"states\": [
\"AL\",
\"AK\"
]
}"
const url = new URL(
"https://staging.prescribery.com/api/v2/state-medications/check-availability"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"client_id": 259,
"source_id": 21,
"wc_product_ids": [
"8366804107556",
"10154388357412"
],
"states": [
"AL",
"AK"
]
};
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/state-medications/check-availability',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'client_id' => 259,
'source_id' => 21,
'wc_product_ids' => [
'8366804107556',
'10154388357412',
],
'states' => [
'AL',
'AK',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/state-medications/check-availability'
payload = {
"client_id": 259,
"source_id": 21,
"wc_product_ids": [
"8366804107556",
"10154388357412"
],
"states": [
"AL",
"AK"
]
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()Example response (200):
{
"data": [
{
"state": "AL",
"state_code": "AL",
"state_name": "Alabama",
"rule_found": true,
"products": [
{
"wc_product_id": "8366804107556",
"resolved": true,
"available": false,
"reason": "One or more mapped medicines are excluded for this state",
"medicines": [
{
"medicine_id": 2759,
"drug_name": "Semaglutide1 0.25 mg (2 mg/mL), 1 mL vial",
"available": false,
"reason": "Excluded for this state"
}
]
},
{
"wc_product_id": "9999999",
"resolved": false,
"available": false,
"reason": "No product-to-template mapping found for this client/source",
"medicines": []
}
]
}
]
}
Example response (422):
{
"message": "The given data was invalid.",
"errors": {
"client_id": [
"The client id field is required."
],
"source_id": [
"The source id field is required."
],
"wc_product_ids": [
"The wc product ids field is required."
],
"states": [
"The states field is required."
]
}
}
Example response (500):
{
"message": "Internal Server Error."
}
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&patient_id=123&service_ids=1%2C2%2C3" \
--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",
"patient_id": "123",
"service_ids": "1,2,3",
};
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',
'patient_id'=> '123',
'service_ids'=> '1,2,3',
],
]
);
$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',
'patient_id': '123',
'service_ids': '1,2,3',
}
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:
User Payment Cards
List Payment Cards
requires authentication
Retrieves all payment cards saved by the authenticated user, enriched with live metadata from Braintree.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/user/payment-card" \
--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/user/payment-card"
);
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/user/payment-card',
[
'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/user/payment-card'
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):
{
"status": "success",
"message": "Cards retrieved successfully.",
"data": [
{
"id": 1,
"payment_method": "braintree",
"card_type": "Visa",
"card_last_four": "1111",
"card_first_four": "4111",
"expiration": "12/2030",
"is_default": 1,
"gateway_id": 11,
"created_at": "2023-10-01 12:00:00",
"cardholder_name": "John Doe"
}
]
}
* @response 400 {
"status": "error",
"message": "Something went wrong!",
"reason": "Error description here"
}
* @return \Illuminate\Http\JsonResponse
Received response:
Request failed with error:
Add Payment Card
requires authentication
Securely stores a newly created card in the Braintree vault using a tokenized nonce provided by the client application.
Example request:
curl --request POST \
"https://staging.prescribery.com/api/v2/user/payment-card" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"nonce\": \"tokencc_bf_3bb...\",
\"gateway_id\": 11,
\"cardF4L4\": \"41111111\",
\"expiration\": \"12\\/2030\",
\"makeDefault\": true
}"
const url = new URL(
"https://staging.prescribery.com/api/v2/user/payment-card"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"nonce": "tokencc_bf_3bb...",
"gateway_id": 11,
"cardF4L4": "41111111",
"expiration": "12\/2030",
"makeDefault": true
};
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/user/payment-card',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'nonce' => 'tokencc_bf_3bb...',
'gateway_id' => 11,
'cardF4L4' => '41111111',
'expiration' => '12/2030',
'makeDefault' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/user/payment-card'
payload = {
"nonce": "tokencc_bf_3bb...",
"gateway_id": 11,
"cardF4L4": "41111111",
"expiration": "12\/2030",
"makeDefault": true
}
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):
{
"status": "success",
"message": "Card successfully saved.",
"data": {
"status": "success",
"braintree_nonce": "7yamthbn",
"brainTreeCustomerId": "12032239319"
}
}
Example response (422):
{
"status": "error",
"errors": {
"nonce": "The nonce field is required."
}
}
* @return \Illuminate\Http\JsonResponse
Received response:
Request failed with error:
Set Default Payment Card
requires authentication
Updates an existing payment card to be the default method for the user.
Example request:
curl --request PUT \
"https://staging.prescribery.com/api/v2/user/payment-card/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"make_default\": true
}"
const url = new URL(
"https://staging.prescribery.com/api/v2/user/payment-card/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"make_default": true
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://staging.prescribery.com/api/v2/user/payment-card/1',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'make_default' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/user/payment-card/1'
payload = {
"make_default": true
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()Example response (200):
{
"status": "success",
"message": "Payment card updated successfully!",
"data": {
"id": 1,
"is_default": 1
}
}
Example response (422):
{
"status": "error",
"errors": {
"make_default": "The make default field is required."
}
}
Example response (404):
{
"status": "error",
"message": "Payment card not found!"
}
* @return \Illuminate\Http\JsonResponse
Received response:
Request failed with error:
Delete Payment Card
requires authentication
Removes a payment card from the user's account and deletes it from the Braintree vault. If the deleted card was the default, an alternate card is automatically promoted to default.
Example request:
curl --request DELETE \
"https://staging.prescribery.com/api/v2/user/payment-card/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/user/payment-card/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->delete(
'https://staging.prescribery.com/api/v2/user/payment-card/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/user/payment-card/1'
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('DELETE', url, headers=headers)
response.json()Example response (200):
{
"status": "success",
"message": "Payment card deleted successfully!"
}
Example response (404):
{
"status": "error",
"message": "Payment card not found!"
}
* @return \Illuminate\Http\JsonResponse
Received response:
Request failed with error:
Get Payment Methods
requires authentication
Retrieves the list of available payment methods for the specified payment gateway. The returned payment methods are filtered based on the authenticated user's permissions and assigned appointment sources.
How it works:
- Returns payment methods matching the provided gateway.
- Users with the
show_all_payment_methodpermission receive all matching payment methods. - Other users receive only payment methods mapped to their active appointment sources.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/user/payment-methods/easypaydirect" \
--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/user/payment-methods/easypaydirect"
);
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/user/payment-methods/easypaydirect',
[
'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/user/payment-methods/easypaydirect'
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):
{
"status": "success",
"data": [
{
"id": 26,
"name": "EasyPay",
"gateway": "easypaydirect"
}
]
}
Example response (200, No payment methods found):
{
"status": "success",
"data": []
}
Example response (500):
{
"status": "error",
"message": "Failed to retrieve payment methods."
}
Received response:
Request failed with error:
Users
Get Profile
requires authentication
Retrieves the authenticated user's profile information.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/user/profile/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/user/profile/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/user/profile/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/user/profile/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": {
"member_id": 1,
"country": "United States of America",
"gender": "male",
"city": "San Francisco",
"prefix": "",
"degree": "",
"mobile": "6012345678",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"zip_code": "94016",
"address_line1": "123 Main St",
"address_line2": "",
"state": "CA",
"created_date": "2020-01-01 00:00:00",
"email": "johndoe@example.com",
"introduction": "",
"dtg": "8445589773",
"avatar": "https://example.com/avatar.jpg",
"s3_upload": 0,
"user_details" : {
"id": 1,
"user_id": 1,
"date_of_birth": "1990-01-01",
"birth_place": "San Francisco",
"gender": "male",
"practice_experience": 5,
"appointment_delay_minutes": 30,
"specialists": ["1","2","3"],
"sub_specialists": ["1","2","3"],
"board_certified": "DCNA",
"certifying_board": "American Board of Internal Medicine"
},
"state_code": "CA",
"specialization": "",
"is_member_photo_available": "",
}
}
Example response (404):
{
"message": "User not found",
"data": null
}
Received response:
Request failed with error:
Update Profile
requires authentication
Updates the authenticated user's profile information.
Supported fields include personal details such as name, contact information, address, date of birth, gender, and profile image.
Example request:
curl --request PUT \
"https://staging.prescribery.com/api/v2/user/profile/1" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "first_name=Test" \
--form "last_name=Coach" \
--form "phone_number=6012451223" \
--form "address=123 Main St" \
--form "city=California" \
--form "state=16" \
--form "zip_code=12345" \
--form "dob=2001-05-25" \
--form "gender=female" \
--form "email=coach@example.com" \
--form "image=@/tmp/php8scXtP" const url = new URL(
"https://staging.prescribery.com/api/v2/user/profile/1"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('first_name', 'Test');
body.append('last_name', 'Coach');
body.append('phone_number', '6012451223');
body.append('address', '123 Main St');
body.append('city', 'California');
body.append('state', '16');
body.append('zip_code', '12345');
body.append('dob', '2001-05-25');
body.append('gender', 'female');
body.append('email', 'coach@example.com');
body.append('image', document.querySelector('input[name="image"]').files[0]);
fetch(url, {
method: "PUT",
headers,
body,
}).then(response => response.json());$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://staging.prescribery.com/api/v2/user/profile/1',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'first_name',
'contents' => 'Test'
],
[
'name' => 'last_name',
'contents' => 'Coach'
],
[
'name' => 'phone_number',
'contents' => '6012451223'
],
[
'name' => 'address',
'contents' => '123 Main St'
],
[
'name' => 'city',
'contents' => 'California'
],
[
'name' => 'state',
'contents' => '16'
],
[
'name' => 'zip_code',
'contents' => '12345'
],
[
'name' => 'dob',
'contents' => '2001-05-25'
],
[
'name' => 'gender',
'contents' => 'female'
],
[
'name' => 'email',
'contents' => 'coach@example.com'
],
[
'name' => 'image',
'contents' => fopen('/tmp/php8scXtP', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));import requests
import json
url = 'https://staging.prescribery.com/api/v2/user/profile/1'
files = {
'image': open('/tmp/php8scXtP', 'rb')
}
payload = {
"first_name": "Test",
"last_name": "Coach",
"phone_number": "6012451223",
"address": "123 Main St",
"city": "California",
"state": "16",
"zip_code": "12345",
"dob": "2001-05-25",
"gender": "female",
"email": "coach@example.com"
}
headers = {
'Authorization': 'Bearer {YOUR_AUTH_KEY}',
'Content-Type': 'multipart/form-data',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, files=files, data=payload)
response.json()Example response (200):
{
"status": "success",
"message": "Profile updated successfully.",
"data": {
"member_id": 1,
"country": "United States of America",
"gender": "male",
"city": "San Francisco",
"prefix": "",
"degree": "",
"mobile": "6012345678",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"zip_code": "94016",
"address_line1": "123 Main St",
"address_line2": "",
"state": "CA",
"created_date": "2020-01-01 00:00:00",
"email": "johndoe@example.com",
"introduction": "",
"dtg": "8445589773",
"avatar": "https://example.com/avatar.jpg",
"s3_upload": 0,
"user_details" : {
"id": 1,
"user_id": 1,
"date_of_birth": "1990-01-01",
"birth_place": "San Francisco",
"gender": "male",
"practice_experience": 5,
"appointment_delay_minutes": 30,
"specialists": ["1","2","3"],
"sub_specialists": ["1","2","3"],
"board_certified": "DCNA",
"certifying_board": "American Board of Internal Medicine"
},
"state_code": "CA",
"specialization": "",
"is_member_photo_available": "",
}
}
Example response (404):
{
"status": "error",
"message": "User not found."
}
Example response (422):
{
"status": "error",
"errors": {
"first_name": "The first name field is required.",
"phone_number": "The phone number must be 10 digits."
}
}
Example response (500):
{
"status": "error",
"message": "An unexpected error occurred while updating profile."
}
Received response:
Request failed with error:
Get States
requires authentication
Retrieves the list of active states. Optionally filter states by country code.
Example request:
curl --request GET \
--get "https://staging.prescribery.com/api/v2/user/states/us" \
--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/user/states/us"
);
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/user/states/us',
[
'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/user/states/us'
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):
{
"status": "success",
"message": "States retrieved successfully.",
"data": [
{
"id": 1,
"state": "Alabama",
"country_code": "us"
},
{
"id": 2,
"state": "Alaska",
"country_code": "us"
},
{
"id": 3,
"state": "Arizona",
"country_code": "us"
}
]
}
Example response (500):
{
"status": "error",
"message": "Unable to retrieve states."
}
Received response:
Request failed with error: