MENU navbar-image

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"
}
 

Request      

GET api/v2/agents

Query Parameters

role  string optional  

Optional. Filter agents by their role.

date  string optional  

Optional. Filter agents by available slot date (YYYY-MM-DD).

page  integer optional  

Optional. Page number for pagination. Defaults to 1.

per_page  integer optional  

Optional. Number of records per page. Defaults to 10.

sort_column  string optional  

Optional. Column used for sorting. Valid options: member_id, full_name, first_name, last_name, email, mobile, city, state, country, created_date.

sort_order  string optional  

Optional. Sorting direction: "D" (descending) or "A" (ascending).

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."
}
 

Request      

GET api/v2/agent/{agentId}/availability

URL Parameters

agentId  integer  

The ID of the agent to check availability for.

Query Parameters

from_date  string  

datetime Start of the date range (inclusive). Format: YYYY-MM-DDTHH:MM:SSZ.

to_date  string  

datetime End of the date range (inclusive). Format: YYYY-MM-DDTHH:MM:SSZ.

time_slot  integer optional  

Optional time slot to filter by (e.g., morning=1, afternoon=2, evening=3).

Appointments

List Appointments

requires authentication

Retrieves a list of all patient appointments, optionally filtered by date and status.

Example request:
curl --request GET \
    --get "https://staging.prescribery.com/api/v2/appointment/list?start_date=2025-09-01&end_date=2025-09-30&status_type=sync&page=1&per_page=10&sort_column=%22created_date%2C+start_date%22&sort_order=%22D%22" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://staging.prescribery.com/api/v2/appointment/list"
);

const params = {
    "start_date": "2025-09-01",
    "end_date": "2025-09-30",
    "status_type": "sync",
    "page": "1",
    "per_page": "10",
    "sort_column": ""created_date, start_date"",
    "sort_order": ""D"",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://staging.prescribery.com/api/v2/appointment/list',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'start_date'=> '2025-09-01',
            'end_date'=> '2025-09-30',
            'status_type'=> 'sync',
            'page'=> '1',
            'per_page'=> '10',
            'sort_column'=> '"created_date, start_date"',
            'sort_order'=> '"D"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://staging.prescribery.com/api/v2/appointment/list'
params = {
  'start_date': '2025-09-01',
  'end_date': '2025-09-30',
  'status_type': 'sync',
  'page': '1',
  'per_page': '10',
  'sort_column': '"created_date, start_date"',
  'sort_order': '"D"',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


{
    "data": [
        {
            "appointment_mode": "in-person",
            "category": "general",
            "created_at": "2025-09-01T10:00:00Z",
            "date_preference": "any",
            "date_type": "2025-09-15",
            "doctor_id": 12,
            "duration": 30,
            "end_at": "2025-09-15T10:30:00Z",
            "end_date": "2025-09-15",
            "end_date_time": "2025-09-15T10:30:00Z",
            "facility": "Main Clinic",
            "frequency": 1,
            "from_date": "2025-09-15",
            "from_time": "10:00",
            "from_time_period": "AM",
            "id": 101,
            "message_to_patient": "Please arrive 15 minutes early.",
            "original_datetime_tz": "UTC",
            "patient_id": 45,
            "pharmacy_id": "RX123",
            "reason": "Checkup",
            "reason_for_cancellation": null,
            "scheduled_by": "staff",
            "source_id": 1,
            "specific_date_option_1": "2025-09-15",
            "specific_date_option_2": "2025-09-16",
            "specific_date_option_3": "2025-09-17",
            "status": "confirmed",
            "start_at": "2025-09-15T10:00:00Z",
            "start_date": "2025-09-15",
            "start_date_time": "2025-09-15T10:00:00Z",
            "start_time": "10:00",
            "start_time_period": "AM",
            "status_type": "upcoming",
            "time_preference": "morning",
            "to_date": "2025-09-15",
            "to_time": "10:30",
            "to_time_period": "AM",
            "updated_at": "2025-09-10T12:00:00Z",
            "visit_type": "consultation",
            "zoom_link": "https://zoom.us/j/abc123"
        }
    ],
    "pagination": {
        "page": 1,
        "per_page": "15",
        "has_more_page": true,
        "sort_column": "start_date",
        "sort_order": "asc"
    }
}
 

Example response (401):


{
    "message": "Unauthenticated."
}
 

Example response (404):


{
    "message": "Resource Not Found"
}
 

Example response (500):


{
    "message": "Internal Server Error"
}
 

Request      

GET api/v2/appointment/list

Query Parameters

start_date  string  

date filter results by start date.

end_date  string  

date filter results by end date.

status_type  string  

filter results by appointment status.

page  integer optional  

Optional. Page number for pagination. Defaults to 1.

per_page  integer optional  

Optional. Number of records per page. Defaults to 10.

sort_column  string optional  

Optional. Column used for sorting. Valid options: created_date.

sort_order  string optional  

Optional. Sorting direction: "D" (descending) or "A" (ascending).

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:

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."
}
 

Request      

POST api/v2/appointment/{appointmentId}/prescription

URL Parameters

appointmentId  integer  

Body Parameters

medicine_id  string[]  

A list of medicine IDs to assign to the appointment.

subscription_plan_id  integer optional  

Optional. ID of the subscription plan to use, if applicable.

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"
}
 

Request      

GET api/v2/appointment/{appointmentId}/status/{patientId}

URL Parameters

appointmentId  integer  

The ID of the appointment.

patientId  integer  

The ID of the patient fetch from the patients endpoint.

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"
}
 

Request      

POST api/v2/appointment/{appointmentId}/cancel

URL Parameters

appointmentId  integer  

The ID of the appointment.

Body Parameters

patient_id  integer  

The ID of the patient.

reason_for_cancellation  string  

Reason why the appointment is being cancelled.

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:

On success, the response includes the held appointment ID and a success message. If the slot is already taken or invalid input is provided, appropriate error messages are returned.

Example request:
curl --request POST \
    "https://staging.prescribery.com/api/v2/appointment/hold-slot" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"member_id\": 2345,
    \"start_time\": \"14:30\",
    \"start_date\": \"2025-09-20\",
    \"duration_in_minutes\": \"30\"
}"
const url = new URL(
    "https://staging.prescribery.com/api/v2/appointment/hold-slot"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "member_id": 2345,
    "start_time": "14:30",
    "start_date": "2025-09-20",
    "duration_in_minutes": "30"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://staging.prescribery.com/api/v2/appointment/hold-slot',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'member_id' => 2345,
            'start_time' => '14:30',
            'start_date' => '2025-09-20',
            'duration_in_minutes' => '30',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://staging.prescribery.com/api/v2/appointment/hold-slot'
payload = {
    "member_id": 2345,
    "start_time": "14:30",
    "start_date": "2025-09-20",
    "duration_in_minutes": "30"
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):


{
    "slot_id": "APT56789"
}
 

Example response (400):


{
    "message": "Bad Request"
}
 

Example response (401):


{
    "message": "Unauthenticated"
}
 

Example response (500):


{
    "message": "Internal Server Error"
}
 

Request      

POST api/v2/appointment/hold-slot

Body Parameters

member_id  integer  

The ID of the member.

start_time  string  

Start time of the appointment (24-hour format).

start_date  string  

Start date of the appointment (YYYY-MM-DD).

duration_in_minutes  string  

Duration of the appointment in minutes.

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"
}
 

Request      

POST api/v2/appointment/{appointmentId}/reschedule

URL Parameters

appointmentId  integer  

The ID of the appointment to be rescheduled.

Body Parameters

patient_id  integer  

The ID of the patient.

doctor_id  integer  

The ID of the doctor.

source_id  integer  

The source ID related to the appointment.

reason  string  

The reason for rescheduling the appointment.

appointment_mode  string  

The mode of the appointment (e.g., "Video Call", "In-person", "Phone Call").

category  string  

The appointment category.

status_type  string  

The status type, either "sync" or "async".

start_date  string  

New start date (format: YYYY-MM-DD).

start_time  string  

New start time (format: HH:MM).

start_time_period  string optional  

Optional Time period for the start time (AM/PM).

visitor_id  integer optional  

Optional Visitor ID if applicable.

timezone  string optional  

Optional Timezone for the appointment.

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:

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"
}
 

Request      

GET api/v2/appointment/last-appointment-mode

Query Parameters

patient_id  integer  

The ID of the patient.

source_id  integer  

The ID of the source/template.

Get Appointment Details

requires authentication

Retrieve detailed information about a specific appointment by appointment ID.

This endpoint provides comprehensive information about the appointment, including:

It is useful for:

Requires authentication via a valid token.

Example request:
curl --request GET \
    --get "https://staging.prescribery.com/api/v2/appointment/456/details" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://staging.prescribery.com/api/v2/appointment/456/details"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://staging.prescribery.com/api/v2/appointment/456/details',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://staging.prescribery.com/api/v2/appointment/456/details'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "data": {
        "appointment_mode": "Video Call",
        "category": "appointment",
        "created_at": "2025-09-15 06:54:44",
        "date_preference": null,
        "date_type": "single_date",
        "doctor_id": 35,
        "duration": 30,
        "end_date": "2025-09-20",
        "end_date_time": "2025-09-20 11:30:00",
        "facility": null,
        "frequency": null,
        "from_date": null,
        "from_time": null,
        "from_time_period": null,
        "id": 11968,
        "message_to_patient": null,
        "original_datetime_tz": "2025-09-20 11:00 AM PST",
        "patient_id": 1,
        "pharmacy_id": 22,
        "reason": "Fox",
        "reason_for_cancellation": "I am not intresed",
        "scheduled_by": null,
        "source_id": 21,
        "specific_date_option_1": null,
        "specific_date_option_2": null,
        "specific_date_option_3": null,
        "status": "cancelled",
        "start_date": "2025-09-20",
        "start_date_time": "2025-09-20 11:00:00",
        "start_time": "11:00:00",
        "start_time_period": "AM",
        "status_type": "sync",
        "time_preference": null,
        "to_date": null,
        "to_time": null,
        "to_time_period": null,
        "updated_at": "2025-09-16 02:14:58",
        "visit_type": "5",
        "zoom_link": "",
        "zoom_join_link": "https://zoom.us/j/xyz",
        "member_name": "Aman1 Aman1",
        "type": "doctor",
        "member_picture": "https://s3.us-east-2.amazonaws.com/stagingdtg/profile_pic/image1740566253.png",
        "service_title": "DietDoc",
        "start_at": "2025-09-20 11:00:00",
        "end_at": "2025-09-20 11:30:00",
        "parsed_start_time": "11:00:00",
        "zoom_join_copy_link": "https://zoom.us/j/xyz",
        "parsed_start_date": "2025-09-20",
        "parsed_start_period": "AM"
    }
}
 

Example response (401):


{
    "message": "Unauthenticated"
}
 

Example response (404):


{
    "message": "Appointment not found"
}
 

Example response (500):


{
    "message": "Internal Server Error"
}
 

Request      

GET api/v2/appointment/{appointmentId}/details

URL Parameters

appointmentId  integer  

The ID of the appointment to retrieve details for.

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"
}
 

Request      

GET api/v2/appointment/patient-stats

Query Parameters

client_id  integer  

The ID of the client for which the appointment statistics are retrieved.

source_id  integer optional  

Optional Filter appointments by source ID.

from_date  string optional  

Optional Filter appointments from this date (format: YYYY-MM-DD).

to_date  string optional  

Optional Filter appointments up to this date (format: YYYY-MM-DD).

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"
}
 

Request      

POST api/v2/appointment/{appointmentId}/discount

URL Parameters

appointmentId  integer  

The ID of the appointment.

Body Parameters

patient_id  integer  

The ID of the patient.

discount_label  string optional  

Optional A label or description for the discount.

amount  number  

The discount amount applied.

Book Appointment

requires authentication

Store appointment data in the database for a patient. This includes appointment details, timing, prescription info, and optional coupon or subscription data.

Example request:
curl --request POST \
    "https://staging.prescribery.com/api/v2/appointments" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"source_id\": 21,
    \"member_id\": 887,
    \"patient_id\": 5,
    \"mode\": \"phone\",
    \"reason\": \"Routine check-up\",
    \"patient_state\": \"california\",
    \"repetition\": \"Period\",
    \"start_time\": \"12:30\",
    \"start_time_period\": \"AM\",
    \"start_date\": \"2026-05-20\",
    \"duration_in_minutes\": 30,
    \"video_link\": \"https:\\/\\/zoom.us\\/j\\/xyz\",
    \"order_id\": \"ORD12345\",
    \"order_type\": \"lab_test\",
    \"coupon_code\": \"SAVE20\",
    \"coupon_type\": \"percent\",
    \"coupon_value\": 20,
    \"pharmacy_id\": 22,
    \"message_to_patient\": \"Please join 5 mins early.\",
    \"timezone\": \"PST\",
    \"consultation_fee\": \"100.00\",
    \"medicine_ids\": [
        1,
        5,
        8
    ]
}"
const url = new URL(
    "https://staging.prescribery.com/api/v2/appointments"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "source_id": 21,
    "member_id": 887,
    "patient_id": 5,
    "mode": "phone",
    "reason": "Routine check-up",
    "patient_state": "california",
    "repetition": "Period",
    "start_time": "12:30",
    "start_time_period": "AM",
    "start_date": "2026-05-20",
    "duration_in_minutes": 30,
    "video_link": "https:\/\/zoom.us\/j\/xyz",
    "order_id": "ORD12345",
    "order_type": "lab_test",
    "coupon_code": "SAVE20",
    "coupon_type": "percent",
    "coupon_value": 20,
    "pharmacy_id": 22,
    "message_to_patient": "Please join 5 mins early.",
    "timezone": "PST",
    "consultation_fee": "100.00",
    "medicine_ids": [
        1,
        5,
        8
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://staging.prescribery.com/api/v2/appointments',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'source_id' => 21,
            'member_id' => 887,
            'patient_id' => 5,
            'mode' => 'phone',
            'reason' => 'Routine check-up',
            'patient_state' => 'california',
            'repetition' => 'Period',
            'start_time' => '12:30',
            'start_time_period' => 'AM',
            'start_date' => '2026-05-20',
            'duration_in_minutes' => 30,
            'video_link' => 'https://zoom.us/j/xyz',
            'order_id' => 'ORD12345',
            'order_type' => 'lab_test',
            'coupon_code' => 'SAVE20',
            'coupon_type' => 'percent',
            'coupon_value' => 20,
            'pharmacy_id' => 22,
            'message_to_patient' => 'Please join 5 mins early.',
            'timezone' => 'PST',
            'consultation_fee' => '100.00',
            'medicine_ids' => [
                1,
                5,
                8,
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://staging.prescribery.com/api/v2/appointments'
payload = {
    "source_id": 21,
    "member_id": 887,
    "patient_id": 5,
    "mode": "phone",
    "reason": "Routine check-up",
    "patient_state": "california",
    "repetition": "Period",
    "start_time": "12:30",
    "start_time_period": "AM",
    "start_date": "2026-05-20",
    "duration_in_minutes": 30,
    "video_link": "https:\/\/zoom.us\/j\/xyz",
    "order_id": "ORD12345",
    "order_type": "lab_test",
    "coupon_code": "SAVE20",
    "coupon_type": "percent",
    "coupon_value": 20,
    "pharmacy_id": 22,
    "message_to_patient": "Please join 5 mins early.",
    "timezone": "PST",
    "consultation_fee": "100.00",
    "medicine_ids": [
        1,
        5,
        8
    ]
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):


{
    "data": {
        "appointment_id": "A123456"
    }
}
 

Example response (400):


{
    "message": "Bad Request"
}
 

Example response (401):


{
    "message": "Unauthenticated"
}
 

Example response (500):


{
    "message": "Internal Server Error"
}
 

Request      

POST api/v2/appointments

Body Parameters

source_id  integer  

Source ID of the appointment request fetch from get client active sources.

member_id  integer  

ID of the member booking the appointment fetch from the members endpoint.

patient_id  integer  

ID of the patient.

mode  string  

Mode of the appointment (e.g., video, phone, async).

reason  string  

Reason for the appointment.

patient_state  string  

State where the patient is located.

repetition  string optional  

Must be one of Single Date or Period.

start_time  string optional  

The start time of the appointment (PST) also referred to as a time-slot (e.g., 9:10).

start_time_period  string optional  

Period (AM/PM) for start time.

start_date  date optional  

The start date of the appointment (format: YYYY-MM-DD, e.g., 2026-05-20).

duration_in_minutes  integer optional  

Duration of the appointment in minutes.

video_link  string optional  

Video link for online consultation (if applicable).

order_id  string optional  

The related order ID, if any.

order_type  string optional  

The type of the order associated with this appointment.

coupon_code  string optional  

Optional coupon code used.

coupon_type  string optional  

Type of coupon.

coupon_value  integer optional  

Value of the coupon.

pharmacy_id  integer optional  

ID of the preferred pharmacy fetch from the pharmacy list endpoint.

message_to_patient  string optional  

A message sent to the patient.

timezone  string optional  

Timezone for the appointment (e.g., PST).

consultation_fee  string optional  

Fees charged for the consultation.

medicine_ids  string[] optional  

The list of medicine IDs to be included in the appointment should be fetched from the service details using the service ID provided inside product_and_price.

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:

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"
}
 

Request      

GET api/v2/patient/{patientId}/appointments

URL Parameters

patientId  integer  

The ID of the patient fetch from the patients endpoint.

Query Parameters

type  string  

The appointment status filter. Allowed values: cancelled, completed, upcoming.

from_date  string optional  

Optional Start date filter in date-time format (e.g., "2025-09-10")

to_date  string optional  

Optional End date filter in date-time format (e.g., "2025-09-20")

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:

When to use:

Tokens explained:

Example Authorization Header:

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOi...
Example request:
curl --request POST \
    "https://staging.prescribery.com/api/v2/access-token" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"api_key\": \"nisi\"
}"
const url = new URL(
    "https://staging.prescribery.com/api/v2/access-token"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "api_key": "nisi"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://staging.prescribery.com/api/v2/access-token',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'api_key' => 'nisi',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://staging.prescribery.com/api/v2/access-token'
payload = {
    "api_key": "nisi"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):


{
    "data": {
        "token_type": "Bearer",
        "expires_in": 3600,
        "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...",
        "refresh_token": "def50200d06fe59a4ba37aca6f0fd5d5a50c05a4fe683e3c..."
    }
}
 

Example response (401):


{
    "message": "Unauthorized"
}
 

Example response (422):


{
    "message": "The api_key field is required.",
    "errors": {
        "api_key": [
            "The api_key field is required."
        ]
    }
}
 

Example response (500):


{
    "message": "Failed to generate token."
}
 

Request      

POST api/v2/access-token

Body Parameters

api_key  string  

The API key issued to your application.

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:

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"
}
 

Request      

POST api/v2/refresh-token

Query Parameters

refresh_token  string  

The refresh token used to request a new access token.

Labs

Create Lab Test Order

requires authentication

This endpoint creates a lab test order associated with the specified client ID. It accepts patient ID, an array of lab test orders, and other optional metadata like service ID, source ID, and reason for the order.

Example request:
curl --request POST \
    "https://staging.prescribery.com/api/v2/lab/1/save-test-order" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"patient_id\": 1,
    \"order\": [
        \"dolorem\"
    ],
    \"service_id\": 3,
    \"source_id\": 21,
    \"reason\": \"\\\"Routine checkup\\\"\",
    \"payment_status\": \"paid\",
    \"payment_amount\": 250.75,
    \"charge_id\": \"ch_123456\",
    \"payment_method\": \"card\"
}"
const url = new URL(
    "https://staging.prescribery.com/api/v2/lab/1/save-test-order"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "patient_id": 1,
    "order": [
        "dolorem"
    ],
    "service_id": 3,
    "source_id": 21,
    "reason": "\"Routine checkup\"",
    "payment_status": "paid",
    "payment_amount": 250.75,
    "charge_id": "ch_123456",
    "payment_method": "card"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://staging.prescribery.com/api/v2/lab/1/save-test-order',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'patient_id' => 1,
            'order' => [
                'dolorem',
            ],
            'service_id' => 3,
            'source_id' => 21,
            'reason' => '"Routine checkup"',
            'payment_status' => 'paid',
            'payment_amount' => 250.75,
            'charge_id' => 'ch_123456',
            'payment_method' => 'card',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://staging.prescribery.com/api/v2/lab/1/save-test-order'
payload = {
    "patient_id": 1,
    "order": [
        "dolorem"
    ],
    "service_id": 3,
    "source_id": 21,
    "reason": "\"Routine checkup\"",
    "payment_status": "paid",
    "payment_amount": 250.75,
    "charge_id": "ch_123456",
    "payment_method": "card"
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):


{
    "token": "generated-token-string"
}
 

Example response (422):


{
    "message": "Validation failed",
    "errors": {
        "field_name": [
            "Error message"
        ]
    }
}
 

Example response (401):


{
    "message": "Unauthenticated - Invalid or missing token"
}
 

Example response (400):


{
    "message": "Bad Request - Invalid data provided"
}
 

Example response (500):


{
    "message": "Internal Server Error"
}
 

Request      

POST api/v2/lab/{clientId}/save-test-order

URL Parameters

clientId  integer  

Body Parameters

patient_id  integer  

The ID of the patient.

order  string[]  

An array of lab test orders, each containing lab_id and test_id.

order[].lab_id  integer  

The ID of the lab to order a test from. Obtain this from the "id" field in the lab list response (e.g., "id": 34 in the example response above).

order[].test_id  integer  

The ID of the test to order from the selected lab. Obtain this from the "test_id" field inside the "lab_test" array of the selected lab in the lab list response (e.g., "test_id": 4 in the example response above).

service_id  integer optional  

Optional Service ID related to the order fetch from get client service.

source_id  integer optional  

Optional Source ID of the order origin fetch from get client active sources.

reason  string optional  

Optional Reason for placing the lab test order.

payment_status  string optional  

Payment status for the order. Allowed values: pending, paid, failed.

payment_amount  string optional  

Required if payment_status = paid. The total amount paid for the order. This field is required when payment_status is paid.

charge_id  string optional  

Required if payment_status = paid. Unique identifier for the payment charge. This field is required when payment_status is paid.

payment_method  string optional  

Required if payment_status = paid. The payment method used (e.g., card, paypal). This field is required when payment_status is paid.

Get Lab Test Details

requires authentication

Retrieve detailed lab test information using the token generated from the save-test-order endpoint. This endpoint returns the lab name, test details, charges, and total amount for the order.

Example request:
curl --request GET \
    --get "https://staging.prescribery.com/api/v2/lab/"abc123xyz"/test-details" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://staging.prescribery.com/api/v2/lab/"abc123xyz"/test-details"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://staging.prescribery.com/api/v2/lab/"abc123xyz"/test-details',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://staging.prescribery.com/api/v2/lab/"abc123xyz"/test-details'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "data": {
        "total_amount": 1200,
        "lab_charges": 200,
        "lab_test_details": [
            {
                "lab_name": "City Diagnostic Center",
                "lab_tests": "Blood Test, Urine Test"
            }
        ]
    }
}
 

Example response (422):


{
    "message": "Validation failed",
    "errors": {
        "token": [
            "The token is invalid or expired."
        ]
    }
}
 

Example response (401):


{
    "message": "Unauthenticated - Invalid or missing token"
}
 

Example response (400):


{
    "message": "Bad Request - Invalid data provided"
}
 

Example response (500):


{
    "message": "Internal Server Error"
}
 

Request      

GET api/v2/lab/{token}/test-details

URL Parameters

token  string  

The unique token returned from the save-test-order endpoint.

Update Lab Order Details

requires authentication

Update specific details of a Lab Order (such as amount, charges, or associated patient) using the provided token.

Example request:
curl --request POST \
    "https://staging.prescribery.com/api/v2/lab/update-order-details" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"patient_id\": 101,
    \"amount\": 1500,
    \"charge_id\": \"ch_123456\",
    \"token\": \"abc123xyz\"
}"
const url = new URL(
    "https://staging.prescribery.com/api/v2/lab/update-order-details"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "patient_id": 101,
    "amount": 1500,
    "charge_id": "ch_123456",
    "token": "abc123xyz"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://staging.prescribery.com/api/v2/lab/update-order-details',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'patient_id' => 101,
            'amount' => 1500,
            'charge_id' => 'ch_123456',
            'token' => 'abc123xyz',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://staging.prescribery.com/api/v2/lab/update-order-details'
payload = {
    "patient_id": 101,
    "amount": 1500,
    "charge_id": "ch_123456",
    "token": "abc123xyz"
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):


{
    "data": {
        "order_id": 5001,
        "updated_amount": 1500,
        "updated_charge_id": 12
    }
}
 

Example response (422):


{
    "message": "Validation failed",
    "errors": {
        "amount": [
            "The amount must be a number."
        ]
    }
}
 

Example response (401):


{
    "message": "Unauthenticated"
}
 

Example response (400):


{
    "message": "Bad Request"
}
 

Example response (500):


{
    "message": "Internal Server Error"
}
 

Request      

POST api/v2/lab/update-order-details

Body Parameters

patient_id  integer  

The ID of the patient associated with the order.

amount  integer  

The updated amount for the lab order.

charge_id  string  

The charge ID associated with the order.

token  string  

The unique token received from the save-test-order endpoint.

Upload Patient Lab Reports

requires authentication

Upload one or more lab report documents for a patient. The uploaded files will be stored in S3 and recorded in the Kulbersh order table.

Example request:
curl --request POST \
    "https://staging.prescribery.com/api/v2/lab/upload-report-documents" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "source_id=21" \
    --form "patient_id=101" \
    --form "json_response={"lab_name": "Quest Diagnostics", "test_type": "Blood Test"}" \
    --form "report_files[]=@/tmp/phpQGOxKW" 
const url = new URL(
    "https://staging.prescribery.com/api/v2/lab/upload-report-documents"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('source_id', '21');
body.append('patient_id', '101');
body.append('json_response', '{"lab_name": "Quest Diagnostics", "test_type": "Blood Test"}');
body.append('report_files[]', document.querySelector('input[name="report_files[]"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://staging.prescribery.com/api/v2/lab/upload-report-documents',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'multipart/form-data',
            'Accept' => 'application/json',
        ],
        'multipart' => [
            [
                'name' => 'source_id',
                'contents' => '21'
            ],
            [
                'name' => 'patient_id',
                'contents' => '101'
            ],
            [
                'name' => 'json_response',
                'contents' => '{"lab_name": "Quest Diagnostics", "test_type": "Blood Test"}'
            ],
            [
                'name' => 'report_files[]',
                'contents' => fopen('/tmp/phpQGOxKW', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://staging.prescribery.com/api/v2/lab/upload-report-documents'
files = {
  'report_files[]': open('/tmp/phpQGOxKW', 'rb')
}
payload = {
    "source_id": 21,
    "patient_id": 101,
    "json_response": "{\"lab_name\": \"Quest Diagnostics\", \"test_type\": \"Blood Test\"}"
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'multipart/form-data',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, files=files, data=payload)
response.json()

Example response (200):


{
    "message": "Lab reports uploaded successfully"
}
 

Example response (400):


{
    "message": "Bad Request"
}
 

Example response (401):


{
    "message": "Unauthenticated"
}
 

Example response (500):


{
    "message": "Internal Server Error"
}
 

Request      

POST api/v2/lab/upload-report-documents

Body Parameters

source_id  integer  

The source ID related to the patient’s lab order.

patient_id  integer  

The ID of the patient the lab reports belong to.

json_response  json optional  

optional A JSON payload for additional lab report metadata.

report_files  file[]  

The lab report files to upload (supports multiple files).

Get Lab Test List by Client

requires authentication

Retrieves the list of labs filtered by the specified client ID. The client ID is Required. An optional method parameter can be provided to filter labs by method type (default is 1).

Requires authentication via bearer token.

Example request:
curl --request GET \
    --get "https://staging.prescribery.com/api/v2/lab/list/2/1" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://staging.prescribery.com/api/v2/lab/list/2/1"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://staging.prescribery.com/api/v2/lab/list/2/1',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://staging.prescribery.com/api/v2/lab/list/2/1'
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):


{
    "data": {
        "id": 101,
        "user_id": 23,
        "name": "LabCorp",
        "soft_delete": 0,
        "selected": "yes",
        "lab_test": {
            "id": 201,
            "user_id": 23,
            "website": 1,
            "lab_id": 101,
            "test_id": 301,
            "test_description": "Blood sugar test",
            "price": "50.00",
            "soft_delete": 0,
            "status": 1,
            "test": {
                "id": 301,
                "user_id": 23,
                "name": "Blood Sugar",
                "code": "BSG123",
                "soft_delete": 0,
                "status": 1
            }
        }
    }
}
 

Example response (401):


{
    "message": "Unauthenticated."
}
 

Example response (404):


{
    "message": "Resource Not Found."
}
 

Example response (422):


{
    "message": "Unprocessable Entity."
}
 

Example response (500):


{
    "message": "Internal Server Error."
}
 

Request      

GET api/v2/lab/list/{clientId}/{method?}

URL Parameters

clientId  integer  

The ID of the client to filter labs.

method  integer optional  

Optional method to filter the labs using the medyhod id (1 for Kulbersh, 2 for Tasso, 3 for Scarlet qnd 4 for MyDirectLabs).

Get Lab Orders By Client

requires authentication

Fetches all lab orders of a client, or for a specific patient if patientId is provided. Supports pagination.

Example request:
curl --request GET \
    --get "https://staging.prescribery.com/api/v2/lab/123/lab-orders?patient_id=7&page=1&per_page=10" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://staging.prescribery.com/api/v2/lab/123/lab-orders"
);

const params = {
    "patient_id": "7",
    "page": "1",
    "per_page": "10",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://staging.prescribery.com/api/v2/lab/123/lab-orders',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'patient_id'=> '7',
            'page'=> '1',
            'per_page'=> '10',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://staging.prescribery.com/api/v2/lab/123/lab-orders'
params = {
  'patient_id': '7',
  'page': '1',
  'per_page': '10',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


{
 "code": "success",
 "data": [
   {
    "id": 1,
    "serial_no": 123,
    "order_amount": 100.50,
    "panel": "Basic Metabolic Panel",
    "patient_id": "1",
    "patient_name": "John Doe",
    "payment_status": "paid",
    "client_name": "paid",
    "order_date": "2025-07-10 10:00:00",
    "results_status": "pending",
   }
 ],
 "page": "1",
 "number_of_page": 11,
 "total_record": 11
}
 

Example response (422):


{
    "message": "clientId is required"
}
 

Example response (404):


{
    "message": "Client not found"
}
 

Example response (500):


{
    "message": "Internal Server Error"
}
 

Request      

GET api/v2/lab/{clientId}/lab-orders

URL Parameters

clientId  integer  

The unique ID of the client whose patient labs are being retrieved.

Query Parameters

patient_id  integer optional  

optional The unique ID of the patient to filter labs by. If not provided, labs for all patients of the client will be returned fetch patient id from the patients endpoint.

page  integer optional  

optional Page number for pagination. Default is 1.

per_page  integer optional  

optional Number of records per page for pagination. Default is 10. maximum is 100.

Leads

Store Lead

requires authentication

This endpoint allows you to create and store a new lead record in the system. Leads typically represent potential patients, clients, or customers who are interested in your services.

A lead can include identifying details such as name, email, phone number, state, and ZIP code, along with optional referral information (e.g., referral code or referred_by). This data can be used for follow-ups, sales tracking, and marketing attribution.

On successful creation, the API returns a confirmation message along with the stored lead details.

Example request:
curl --request POST \
    "https://staging.prescribery.com/api/v2/lead/create" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"John Doe\\\"\",
    \"email\": \"\\\"johndoe@example.com\\\"\",
    \"source_id\": \"21\",
    \"phone_number\": \"\\\"+1234567890\\\"\",
    \"zip_code\": \"\\\"94105\\\"\",
    \"referred_by\": \"\\\"Google Ads\\\"\",
    \"state\": \"\\\"CA\\\"\",
    \"referral_code\": \"\\\"REF123\\\"\"
}"
const url = new URL(
    "https://staging.prescribery.com/api/v2/lead/create"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "\"John Doe\"",
    "email": "\"johndoe@example.com\"",
    "source_id": "21",
    "phone_number": "\"+1234567890\"",
    "zip_code": "\"94105\"",
    "referred_by": "\"Google Ads\"",
    "state": "\"CA\"",
    "referral_code": "\"REF123\""
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://staging.prescribery.com/api/v2/lead/create',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'name' => '"John Doe"',
            'email' => '"johndoe@example.com"',
            'source_id' => '21',
            'phone_number' => '"+1234567890"',
            'zip_code' => '"94105"',
            'referred_by' => '"Google Ads"',
            'state' => '"CA"',
            'referral_code' => '"REF123"',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://staging.prescribery.com/api/v2/lead/create'
payload = {
    "name": "\"John Doe\"",
    "email": "\"johndoe@example.com\"",
    "source_id": "21",
    "phone_number": "\"+1234567890\"",
    "zip_code": "\"94105\"",
    "referred_by": "\"Google Ads\"",
    "state": "\"CA\"",
    "referral_code": "\"REF123\""
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):


{
  "data": {
    "lead_id": 101,
    "user_id": "65",
    "affiliate_referral_id": "94105",
  }
}
 

Example response (400):


{
    "message": "Bad Request"
}
 

Example response (401):


{
    "message": "Unauthenticated"
}
 

Example response (500):


{
    "message": "Internal Server Error"
}
 

Request      

POST api/v2/lead/create

Body Parameters

name  string  

The full name of the lead.

email  string optional  

optional The email address of the lead.

source_id  string  

Fetch from get client active sources.

phone_number  string optional  

optional The phone number of the lead.

zip_code  string optional  

optional The ZIP/postal code of the lead.

referred_by  string optional  

optional The referral source for the lead.

state  string optional  

optional The state or region of the lead.

referral_code  string optional  

optional A referral code provided to the lead.

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"
}
 

Request      

POST api/v2/lead/agent-appointment

Body Parameters

lead_id  integer  

The unique ID of the lead associated with the appointment.

member_id  integer  

The ID of the agent/member who will handle the appointment.

reason  string  

The purpose or reason for the appointment.

start_date  date  

The appointment date in PST timezone. Format: YYYY-MM-DD.

start_time  string  

The appointment start time in PST timezone. Format: HH:MM AM/PM.

duration_in_minutes  integer optional  

optional The duration of the appointment in minutes.

Update a Lead

requires authentication

This endpoint updates an existing lead’s information in the system. You can modify fields such as the reason for sign-up, the zip code, and the acceptance of terms of service. Typically used after a lead has been created to update or correct their details.

Example request:
curl --request POST \
    "https://staging.prescribery.com/api/v2/lead/42/update" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"sign_up_reason\": \"\\\"Referred by friend\\\"\",
    \"zip_code\": \"\\\"94016\\\"\",
    \"term_service\": \"\\\"yes\\\"\",
    \"status\": \"iure\",
    \"agent_id\": 3,
    \"email\": \"mann.gaston@example.net\"
}"
const url = new URL(
    "https://staging.prescribery.com/api/v2/lead/42/update"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "sign_up_reason": "\"Referred by friend\"",
    "zip_code": "\"94016\"",
    "term_service": "\"yes\"",
    "status": "iure",
    "agent_id": 3,
    "email": "mann.gaston@example.net"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://staging.prescribery.com/api/v2/lead/42/update',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'sign_up_reason' => '"Referred by friend"',
            'zip_code' => '"94016"',
            'term_service' => '"yes"',
            'status' => 'iure',
            'agent_id' => 3,
            'email' => 'mann.gaston@example.net',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://staging.prescribery.com/api/v2/lead/42/update'
payload = {
    "sign_up_reason": "\"Referred by friend\"",
    "zip_code": "\"94016\"",
    "term_service": "\"yes\"",
    "status": "iure",
    "agent_id": 3,
    "email": "mann.gaston@example.net"
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):


{
  "data": {
    "lead": {
      "lead_id": 212,
      "user_id": 458,
    }
  },
}
 

Example response (400):


{
    "message": "Bad Request"
}
 

Example response (401):


{
    "message": "Unauthenticated"
}
 

Example response (404):


{
    "message": "Lead not found"
}
 

Example response (422):


{
    "message": "Validation error",
    "errors": {
        "zip_code": [
            "The zip_code must be a valid format."
        ]
    }
}
 

Example response (500):


{
    "message": "Internal Server Error"
}
 

Request      

POST api/v2/lead/{leadId}/update

URL Parameters

leadId  integer  

The ID of the lead to update.

Body Parameters

sign_up_reason  string optional  

optional The updated reason why the lead signed up.

zip_code  string optional  

optional The updated zip code for the lead.

term_service  string optional  

optional Indicates whether the lead has accepted terms of service. Values: "yes" or "no".

status  string optional  

agent_id  integer optional  

email  string optional  

Must be a valid email address.

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"
}
 

Request      

GET api/v2/members

Query Parameters

source_id  integer  

The ID of the source is fetch from get client active sources to filter members.

license_state  string  

The license state to filter members (e.g., California).

medicine_check  boolean optional  

Optional. Filter by whether the member has passed a medicine check.

availability_type  string optional  

Optional. Filter by availability type. Acceptable values: "sync", "async".

page  integer optional  

Optional. The page number to retrieve. Defaults to 1 if not provided.

per_page  integer optional  

Optional. Number of members to return per page. Defaults to 10.

sort_column  string optional  

Optional. The column name to sort the results by (e.g., created_date).

sort_order  string optional  

Optional. The sorting order. Acceptable values: "D" for descending, "A" for ascending.

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"
}
 

Request      

GET api/v2/members/{memberId}/availability

URL Parameters

memberId  integer  

The unique identifier of the member whose availability is being queried.

Query Parameters

from_date  string  

The start of the availability, Format: YYYY-MM-DD..

to_date  string  

The end of the availability, Format: YYYY-MM-DD.. Example.

time_slot  string optional  

Optional. Specific time slot to filter the results. If provided, only availability for that slot will be returned.

timezone  string optional  

Optional. Specify the timezone for the availability. Acceptable values include "PST" or "America/Phoenix". Defaults to UTC if not specified.

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"
}
 

Request      

GET api/v2/members/{memberId}/details

URL Parameters

memberId  string  

The unique identifier of the member whose details are being requested.

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"
}
 

Request      

GET api/v2/members/availableslots

Query Parameters

source_id  string  

The unique source identifier to filter members fetch from get client active sources.

license_state  string  

The license state to filter members by. (e.g., "California").

from_date  string optional  

date Optional. The start date of the availability (format: YYYY-MM-DD). If not provided, defaults to today.

to_date  string optional  

date Optional. The end date of the availability (format: YYYY-MM-DD). If not provided, defaults to 7 days after from_date.

time_slot  string optional  

Optional. Specific time slot to narrow down results.

timezone  string optional  

Optional. The timezone in which to evaluate availability. Acceptable values include time zone abbreviations (e.g., "PST") or full identifiers (e.g., "America/Phoenix"). Defaults to UTC.

Patients

Get Active Patients (Paginated)

requires authentication

Retrieves a paginated list of active patients, supporting filtering, sorting, and pagination.

You can filter by search (full name, email, or record ID) and request additional flags such as whether the patient has accepted terms. If the authenticated user belongs to a company, the results are scoped to that client.

Example request:
curl --request GET \
    --get "https://staging.prescribery.com/api/v2/patients?search=est&with_terms=1&sort_column=first_name&sort_order=D&page=1&per_page=10" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://staging.prescribery.com/api/v2/patients"
);

const params = {
    "search": "est",
    "with_terms": "1",
    "sort_column": "first_name",
    "sort_order": "D",
    "page": "1",
    "per_page": "10",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://staging.prescribery.com/api/v2/patients',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'search'=> 'est',
            'with_terms'=> '1',
            'sort_column'=> 'first_name',
            'sort_order'=> 'D',
            'page'=> '1',
            'per_page'=> '10',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://staging.prescribery.com/api/v2/patients'
params = {
  'search': 'est',
  'with_terms': '1',
  'sort_column': 'first_name',
  'sort_order': 'D',
  'page': '1',
  'per_page': '10',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


{
    "data": [
        {
            "gender": "female",
            "first_name": "Alice",
            "last_name": "Smith",
            "full_name": "Alice Smith",
            "email": "alice@example.com",
            "mobile": "9876543210",
            "dob": "1990-05-01",
            "record_id": "PAT1023",
            "patient_id": 42,
            "created_time": "2025-07-09 10:32:00",
            "created_date": "2025-07-09 10:32:00",
            "active": "active",
            "postal_code": "10001",
            "city": "New York",
            "state": "NY",
            "height": "165",
            "weight": "60",
            "privacy_policy": "<html>Policy content...</html>",
            "client_logo": "https://example.com/storage/logo.png",
            "primary_color": "#1E90FF",
            "font_color": "#333333",
            "term_service": 1,
            "identifier": {
                "use": "usual",
                "value": 42
            },
            "stripe_customer_id": "cus_abc123"
        }
    ],
    "input": {
        "search": "Alice",
        "sort_column": "created_at",
        "sort_order": "D"
    },
    "pagination": {
        "page": 1,
        "per_page": 10,
        "has_more_page": "true",
        "sort_column": "created_at",
        "sort_order": "D"
    }
}
 

Example response (401):


{
    "message": "Unauthenticated"
}
 

Example response (500):


{
  "message": "Internal Server Error.",
}
 

Request      

GET api/v2/patients

Query Parameters

search  string optional  

Optional search term to filter by name, email, or record ID. Example:

with_terms  boolean optional  

Optional flag to include whether the patient accepted terms.

sort_column  string optional  

Column to sort by created_at, first_name, last_name, gender, dob. Default: created_at.

sort_order  string optional  

Sort direction. "A" = Ascending, "D" = Descending. Default: D.

page  integer optional  

Page number for pagination. Default: 1.

per_page  integer optional  

Number of results per page. Default: 10.

Create Patient

requires authentication

Store a patient record.

This endpoint registers a new patient with first name, last name, dob(date of birth in Y-m-d format), gender, billing and shipping address, unique email and phone number.

Example request:
curl --request POST \
    "https://staging.prescribery.com/api/v2/patients" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"first_name\": \"John\",
    \"last_name\": \"Doe\",
    \"dob\": \"1990-01-01\",
    \"gender\": \"male\",
    \"email\": \"john.doe@example.com\",
    \"mobile\": \"9898989898\",
    \"billing_address\": {
        \"address_line1\": \"123 Elm St\",
        \"address_line2\": \"Apt 4B\",
        \"city\": \"California city\",
        \"state\": \"California\",
        \"postal_code\": \"90001\",
        \"country\": \"us\"
    },
    \"driver_license_number\": \"ABC123456\",
    \"language\": \"English\",
    \"communication_type\": \"phone\",
    \"referred_by\": \"Facebook\",
    \"term_service\": true,
    \"height\": \"180\",
    \"weight\": \"70\",
    \"shipping_address\": {
        \"address_line1\": \"500 Market Street\",
        \"address_line2\": \"Suite 8\",
        \"city\": \"San Francisco\",
        \"state\": \"California\",
        \"country\": \"us\",
        \"postal_code\": \"94105\"
    }
}"
const url = new URL(
    "https://staging.prescribery.com/api/v2/patients"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "first_name": "John",
    "last_name": "Doe",
    "dob": "1990-01-01",
    "gender": "male",
    "email": "john.doe@example.com",
    "mobile": "9898989898",
    "billing_address": {
        "address_line1": "123 Elm St",
        "address_line2": "Apt 4B",
        "city": "California city",
        "state": "California",
        "postal_code": "90001",
        "country": "us"
    },
    "driver_license_number": "ABC123456",
    "language": "English",
    "communication_type": "phone",
    "referred_by": "Facebook",
    "term_service": true,
    "height": "180",
    "weight": "70",
    "shipping_address": {
        "address_line1": "500 Market Street",
        "address_line2": "Suite 8",
        "city": "San Francisco",
        "state": "California",
        "country": "us",
        "postal_code": "94105"
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://staging.prescribery.com/api/v2/patients',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'first_name' => 'John',
            'last_name' => 'Doe',
            'dob' => '1990-01-01',
            'gender' => 'male',
            'email' => 'john.doe@example.com',
            'mobile' => '9898989898',
            'billing_address' => [
                'address_line1' => '123 Elm St',
                'address_line2' => 'Apt 4B',
                'city' => 'California city',
                'state' => 'California',
                'postal_code' => '90001',
                'country' => 'us',
            ],
            'driver_license_number' => 'ABC123456',
            'language' => 'English',
            'communication_type' => 'phone',
            'referred_by' => 'Facebook',
            'term_service' => true,
            'height' => '180',
            'weight' => '70',
            'shipping_address' => [
                'address_line1' => '500 Market Street',
                'address_line2' => 'Suite 8',
                'city' => 'San Francisco',
                'state' => 'California',
                'country' => 'us',
                'postal_code' => '94105',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://staging.prescribery.com/api/v2/patients'
payload = {
    "first_name": "John",
    "last_name": "Doe",
    "dob": "1990-01-01",
    "gender": "male",
    "email": "john.doe@example.com",
    "mobile": "9898989898",
    "billing_address": {
        "address_line1": "123 Elm St",
        "address_line2": "Apt 4B",
        "city": "California city",
        "state": "California",
        "postal_code": "90001",
        "country": "us"
    },
    "driver_license_number": "ABC123456",
    "language": "English",
    "communication_type": "phone",
    "referred_by": "Facebook",
    "term_service": true,
    "height": "180",
    "weight": "70",
    "shipping_address": {
        "address_line1": "500 Market Street",
        "address_line2": "Suite 8",
        "city": "San Francisco",
        "state": "California",
        "country": "us",
        "postal_code": "94105"
    }
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):


{
  "data": [
    {
      "identifier": {
        "use": "usual",
        "value": 105
      },
      "id": "105",
      "record_id": "PAT105",
      "first_name": "John",
      "last_name": "Doe",
      "dob": "1990-01-01",
      "address_line1": "123 Elm Street",
      "address_licne2": "Apt 4B",
      "city": "Los Angeles",
      "state": "Califrnia",
      "country": "us",
      "postal_code": "90001",
      "district": null,
      "email": "john.doe@example.com",
      "mobile": "9876543210",
      "smoking_status": "",
      "marital_status": "",
      "employment_status": "",
      "gender": "male",
      "height": "180",
      "weight": "70",
      "status": "active",
      "blood_group": null,
      "profile_img": null,
      "communication_type": "phone",
      "language": "English",
      "shipping_address_line1": null,
      "shipping_address_line2": null,
      "shipping_city": null,
      "shipping_state": "California",
      "shipping_postal_code": "90001",
      "term_service": 0,
    }
  ],
}
 

Example response (401):


{
    "message": "Unauthenticated"
}
 

Example response (422):


{
    "message": "failed",
    "reason": {
        "email": [
            "The email field is required."
        ],
        "dob": [
            "The dob field is required."
        ]
    }
}
 

Example response (500):


{
  "message": "Internal Server Error.",
}
 

Request      

POST api/v2/patients

Body Parameters

first_name  string  

The patient's first name.

last_name  string  

The patient's last name.

dob  date  

Date of birth in Y-m-d format.

gender  string  

Gender value (e.g., male, female).

email  string  

Email address (must be valid and unique in context).

mobile  string  

A valid 10-digit mobile number (must be valid and unique in context).

billing_address  object  

Primary address block.

billing_address.address_line1  string  

First line of the address.

billing_address.address_line2  string optional  

optional Second line of the address.

billing_address.city  string  

Full city name.

billing_address.state  string  

Full state name.

billing_address.postal_code  string  

ZIP/postal code.

billing_address.country  string  

Full country name. defaults to US.

driver_license_number  string optional  

optional Driver license number.

language  string optional  

optional Preferred communication language.

communication_type  string optional  

optional Preferred communication method (e.g., email, phone).

referred_by  string optional  

optional Referral source.

term_service  boolean optional  

optional Indicates if terms were accepted.

height  numeric optional  

optional Patient height in cm or inches.

weight  numeric optional  

optional Patient weight in kg or lbs.

shipping_address  object optional  

optional Shipping address block.

shipping_address.address_line1  string optional  

optional First line of address.

shipping_address.address_line2  string optional  

optional Second line of address.

shipping_address.city  string optional  

optional Full city name.

shipping_address.state  string optional  

optional Full state name.

shipping_address.country  string optional  

optional Full country name.

shipping_address.postal_code  string optional  

optional ZIP/postal code.

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"
}
 

Request      

POST api/v2/patients/check-qualification

Body Parameters

email  string  

The patient’s email address.

dob  string  

The patient’s date of birth in YYYY-MM-DD format.

medications  string  

Comma-separated list of medications the patient is currently taking.

Update Patient

requires authentication

Update an existing patient.

This endpoint updates the details of an existing patient using validated input. Upon success, it returns the updated patient resource wrapped in a standardized JSON structure, along with the original input and pagination metadata.

Example request:
curl --request POST \
    "https://staging.prescribery.com/api/v2/patients/12 or PAT000001" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"first_name\": \"John\",
    \"last_name\": \"Doe\",
    \"dob\": \"1990-01-01\",
    \"gender\": \"male\",
    \"email\": \"john.doe@example.com\",
    \"mobile\": \"9876543210\",
    \"billing_address\": {
        \"address_line1\": \"123 Elm Street\",
        \"address_line2\": \"Apt 4B\",
        \"city\": \"California city\",
        \"state\": \"California\",
        \"postal_code\": \"90001\",
        \"country\": \"us\"
    },
    \"driver_license_number\": \"ABC123456\",
    \"language\": \"English\",
    \"communication_type\": \"phone\",
    \"referred_by\": \"Google Ads\",
    \"term_service\": true,
    \"height\": \"175\",
    \"weight\": \"70\",
    \"shipping_address\": {
        \"address_line1\": \"500 Market Street\",
        \"address_line2\": \"Suite 8\",
        \"city\": \"San Francisco\",
        \"state\": \"CA\",
        \"country\": \"us\",
        \"postal_code\": \"94105\"
    }
}"
const url = new URL(
    "https://staging.prescribery.com/api/v2/patients/12 or PAT000001"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "first_name": "John",
    "last_name": "Doe",
    "dob": "1990-01-01",
    "gender": "male",
    "email": "john.doe@example.com",
    "mobile": "9876543210",
    "billing_address": {
        "address_line1": "123 Elm Street",
        "address_line2": "Apt 4B",
        "city": "California city",
        "state": "California",
        "postal_code": "90001",
        "country": "us"
    },
    "driver_license_number": "ABC123456",
    "language": "English",
    "communication_type": "phone",
    "referred_by": "Google Ads",
    "term_service": true,
    "height": "175",
    "weight": "70",
    "shipping_address": {
        "address_line1": "500 Market Street",
        "address_line2": "Suite 8",
        "city": "San Francisco",
        "state": "CA",
        "country": "us",
        "postal_code": "94105"
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://staging.prescribery.com/api/v2/patients/12 or PAT000001',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'first_name' => 'John',
            'last_name' => 'Doe',
            'dob' => '1990-01-01',
            'gender' => 'male',
            'email' => 'john.doe@example.com',
            'mobile' => '9876543210',
            'billing_address' => [
                'address_line1' => '123 Elm Street',
                'address_line2' => 'Apt 4B',
                'city' => 'California city',
                'state' => 'California',
                'postal_code' => '90001',
                'country' => 'us',
            ],
            'driver_license_number' => 'ABC123456',
            'language' => 'English',
            'communication_type' => 'phone',
            'referred_by' => 'Google Ads',
            'term_service' => true,
            'height' => '175',
            'weight' => '70',
            'shipping_address' => [
                'address_line1' => '500 Market Street',
                'address_line2' => 'Suite 8',
                'city' => 'San Francisco',
                'state' => 'CA',
                'country' => 'us',
                'postal_code' => '94105',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://staging.prescribery.com/api/v2/patients/12 or PAT000001'
payload = {
    "first_name": "John",
    "last_name": "Doe",
    "dob": "1990-01-01",
    "gender": "male",
    "email": "john.doe@example.com",
    "mobile": "9876543210",
    "billing_address": {
        "address_line1": "123 Elm Street",
        "address_line2": "Apt 4B",
        "city": "California city",
        "state": "California",
        "postal_code": "90001",
        "country": "us"
    },
    "driver_license_number": "ABC123456",
    "language": "English",
    "communication_type": "phone",
    "referred_by": "Google Ads",
    "term_service": true,
    "height": "175",
    "weight": "70",
    "shipping_address": {
        "address_line1": "500 Market Street",
        "address_line2": "Suite 8",
        "city": "San Francisco",
        "state": "CA",
        "country": "us",
        "postal_code": "94105"
    }
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):


{
  "data": [
    {
      "gender": "female",
      "first_name": "Alice",
      "email": "alice@example.com",
      "created_time": "2025-07-10 09:20:00",
      "mobile": "9876543210",
      "last_name": "Smith",
      "active": "active",
      "record_id": "PAT1023",
      "full_name": "Alice Smith",
      "patient_id": 42,
      "dob": "1990-05-01",
      "postal_code": "10001",
      "state": "NY",
      "city": "New York",
      "height": "165",
      "weight": "60",
      "created_date": "2025-07-10 09:20:00",
      "privacy_policy": "<html>Policy content...</html>",
      "client_logo": "https://example.com/storage/logo.png",
      "primary_color": "#1E90FF",
      "font_color": "#333333",
      "term_service": 1,
      "identifier": {
        "use": "usual",
        "value": 42
      },
      "stripe_customer_id": "cus_ABC1234567"
    }
  ],
}
 

Example response (422):


{
    "reason": {
        "email": [
            "The email field is required."
        ],
        "dob": [
            "The dob must be a valid date."
        ]
    }
}
 

Example response (500):


{
    "message": "Internal Server Error"
}
 

Request      

POST api/v2/patients/{patientId}

URL Parameters

patientId  string optional  

or id required The ID or Record ID of the patient fetch from the patients endpoint. Use id or record_id as literal string to trigger field-based lookup.

Body Parameters

first_name  string optional  

optional The patient's first name.

last_name  string optional  

optional The patient's last name.

dob  date optional  

optional The patient's date of birth in Y-m-d format.

gender  string optional  

optional The patient's gender.

email  string  

The patient's email address. Must be a valid email.

mobile  string optional  

optional A valid 10-digit mobile number.

billing_address  object optional  

optional Patient’s home address.

billing_address.address_line1  string  

First line of address.

billing_address.address_line2  string optional  

optional Second line of address.

billing_address.city  string  

Full city name.

billing_address.state  string  

Full state name.

billing_address.postal_code  string  

ZIP/postal code.

billing_address.country  string  

Full country name. defaults to US.

driver_license_number  string optional  

optional Driver's license number.

language  string optional  

optional The patient's preferred language. Must exist in languages.name.

communication_type  string optional  

optional Preferred mode of communication.

referred_by  string optional  

optional Source through which patient came.

term_service  boolean optional  

optional Whether the patient accepted terms.

height  numeric optional  

optional Patient’s height in cm.

weight  numeric optional  

optional Patient’s weight in kg.

shipping_address  object optional  

optional Shipping address block.

shipping_address.address_line1  string optional  

optional First line of address.

shipping_address.address_line2  string optional  

optional Second line of address.

shipping_address.city  string optional  

optional City.

shipping_address.state  string optional  

optional State.

shipping_address.country  string optional  

optional Country.

shipping_address.postal_code  string optional  

optional Postal code.

Upload a document for a patient.

requires authentication

Upload and store a patient's document (front + optional back). Accepts base64-encoded image or PDF data.

Example request:
curl --request POST \
    "https://staging.prescribery.com/api/v2/patients/1/documents" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"title\": \"Driving License\",
    \"document_file\": \"data:image\\/jpeg;base64,\\/9j\\/4AAQSkZJRgABAQAAAQABAAD...\",
    \"document_file_back\": \"data:image\\/png;base64,iVBORw0KGgoAAAANSUhEUgAA...\"
}"
const url = new URL(
    "https://staging.prescribery.com/api/v2/patients/1/documents"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "title": "Driving License",
    "document_file": "data:image\/jpeg;base64,\/9j\/4AAQSkZJRgABAQAAAQABAAD...",
    "document_file_back": "data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://staging.prescribery.com/api/v2/patients/1/documents',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'title' => 'Driving License',
            'document_file' => 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD...',
            'document_file_back' => 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://staging.prescribery.com/api/v2/patients/1/documents'
payload = {
    "title": "Driving License",
    "document_file": "data:image\/jpeg;base64,\/9j\/4AAQSkZJRgABAQAAAQABAAD...",
    "document_file_back": "data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):


{
    "documents": [
        {
            "document_id": 5,
            "patient_id": 1,
            "document_title": "Blood Report",
            "document_file": "https://s3.amazonaws.com/bucket/document.pdf",
            "document_thumb": "https://s3.amazonaws.com/bucket/thumbnail.jpg",
            "document_date": "2024-06-01 10:23:00"
        }
    ]
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "title": [
            "The title field is required."
        ],
        "document_file": [
            "The document_file must be a valid base64-encoded file of type: jpg, jpeg, png, or pdf."
        ]
    }
}
 

Example response (500):


{
  "message": "Internal Server Error",
}
 

Request      

POST api/v2/patients/{patientId}/documents

URL Parameters

patientId  integer  

The ID or Record ID of the patient fetch from the patients endpoint.

Body Parameters

title  string  

The title of the document.

document_file  string  

Base64-encoded front side of the document. JPG, JPEG, PNG, or PDF. Max size: 5MB.

document_file_back  string optional  

optional Base64-encoded back side of the document. JPG, JPEG, PNG, or PDF. Max size: 5MB.

Get patient questionnaires

requires authentication

Get a list of questionnaires answered by the patient

Example request:
curl --request GET \
    --get "https://staging.prescribery.com/api/v2/patients/dolor/questionnaires?per_page=10&page=1&questionnaire_name_startswith=A&questionnaire_name_contains=Diabetes" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://staging.prescribery.com/api/v2/patients/dolor/questionnaires"
);

const params = {
    "per_page": "10",
    "page": "1",
    "questionnaire_name_startswith": "A",
    "questionnaire_name_contains": "Diabetes",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://staging.prescribery.com/api/v2/patients/dolor/questionnaires',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'per_page'=> '10',
            'page'=> '1',
            'questionnaire_name_startswith'=> 'A',
            'questionnaire_name_contains'=> 'Diabetes',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://staging.prescribery.com/api/v2/patients/dolor/questionnaires'
params = {
  'per_page': '10',
  'page': '1',
  'questionnaire_name_startswith': 'A',
  'questionnaire_name_contains': 'Diabetes',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


{
    "data": [
        {
            "ques_map_id": 12,
            "questionnaire_id": 5,
            "questionnaire_name": "Diabetes Checkup",
            "is_submitted": true,
            "is_saved": true
        }
    ],
    "pagination": {
        "page": 1,
        "per_page": 10,
        "has_more_page": true,
        "search_criteria": {
            "column_name": "questionnaire_name",
            "search_text": "Dia",
            "comparator": "contains"
        }
    }
}
 

Example response (401):


{
    "message": "Unauthenticated."
}
 

Example response (500):


{
    "message": "Internal Server Error"
}
 

Request      

GET api/v2/patients/{patientId}/questionnaires

URL Parameters

patientId  string  

The ID of the patient fetch from the patients endpoint.

Query Parameters

per_page  integer  

Number of results per page.

page  integer  

Page number.

questionnaire_name_startswith  string optional  

Filter by title starting with...

questionnaire_name_contains  string optional  

Filter by title containing...

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."
}
 

Request      

GET api/v2/patients/patient-questionnaire-answer

Query Parameters

record_id  string  

The patient's record ID fetch from the patients endpoint.

template_id  integer  

The ID of the questionnaire template fetch from the questionnaire list endpoint.

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"
}
 

Request      

POST api/v2/patients/{patientId}/prescriptions

URL Parameters

patientId  integer  

The unique ID of the patient whose prescriptions are being retrieved fetch from the patients endpoint.

Query Parameters

from_date  string optional  

date optional Filter prescriptions starting from this date. Format: YYYY-MM-DD. Defaults to today.

to_date  string optional  

date optional Filter prescriptions up to this date. Format: YYYY-MM-DD. Defaults to today.

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"
}
 

Request      

GET api/v2/patients/{patientId}/verify-from-idology

URL Parameters

patientId  integer  

The unique ID of the patient to verify fetch from the patients endpoint.

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."
}
 

Request      

POST api/v2/patients/payments/braintree/customer

Body Parameters

patient_id  integer  

The ID of the patient.

nonce  string  

The payment method nonce provided by Braintree.

Get Braintree Client Token

requires authentication

This endpoint generates a Braintree client token using default or dynamic gateway credentials. If source_id or client_id is passed, the token is generated using their specific Braintree settings.

Example request:
curl --request POST \
    "https://staging.prescribery.com/api/v2/patients/payments/braintree/token" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"source_id\": 21,
    \"client_id\": 5
}"
const url = new URL(
    "https://staging.prescribery.com/api/v2/patients/payments/braintree/token"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "source_id": 21,
    "client_id": 5
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://staging.prescribery.com/api/v2/patients/payments/braintree/token',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'source_id' => 21,
            'client_id' => 5,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://staging.prescribery.com/api/v2/patients/payments/braintree/token'
payload = {
    "source_id": 21,
    "client_id": 5
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):


{
  "token": "sandbox_f252zhq7_hh4cpc39zq4rgjcg",
  "gateway_id": "client_braintree_id_001",
}
 

Example response (404):


{
    "message": "Client not found"
}
 

Example response (500):


{
    "message": "Internal Server Error."
}
 

Request      

POST api/v2/patients/payments/braintree/token

Body Parameters

source_id  integer optional  

optional The ID of the appointment source fetch from the get client active sources.

client_id  integer optional  

optional The ID of the client.

Initiate Braintree Payment

requires authentication

This endpoint initiates a Braintree payment for a patient using a nonce and amount. Optionally stores card info and generates a QuickBooks invoice if applicable.

Example request:
curl --request POST \
    "https://staging.prescribery.com/api/v2/patients/payments/braintree/initiate" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"patient_id\": 1,
    \"nonce\": \"fake-valid-nonce\",
    \"amount\": \"250\",
    \"order_id\": \"ORDER123\",
    \"source_id\": 3,
    \"gateway_id\": \"cli_gw_001\",
    \"qb_channel\": \"online\",
    \"aptType\": \"async\"
}"
const url = new URL(
    "https://staging.prescribery.com/api/v2/patients/payments/braintree/initiate"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "patient_id": 1,
    "nonce": "fake-valid-nonce",
    "amount": "250",
    "order_id": "ORDER123",
    "source_id": 3,
    "gateway_id": "cli_gw_001",
    "qb_channel": "online",
    "aptType": "async"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://staging.prescribery.com/api/v2/patients/payments/braintree/initiate',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'patient_id' => 1,
            'nonce' => 'fake-valid-nonce',
            'amount' => '250',
            'order_id' => 'ORDER123',
            'source_id' => 3,
            'gateway_id' => 'cli_gw_001',
            'qb_channel' => 'online',
            'aptType' => 'async',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://staging.prescribery.com/api/v2/patients/payments/braintree/initiate'
payload = {
    "patient_id": 1,
    "nonce": "fake-valid-nonce",
    "amount": "250",
    "order_id": "ORDER123",
    "source_id": 3,
    "gateway_id": "cli_gw_001",
    "qb_channel": "online",
    "aptType": "async"
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):


{
    "transaction_id": "bt_txn_123456",
    "gateway_id": "braintree_abc"
}
 

Example response (422):


{
    "errors": {
        "patient_id": [
            "The patient id field is required."
        ],
        "nonce": [
            "The nonce field is required."
        ],
        "amount": [
            "The amount field is required."
        ]
    }
}
 

Example response (500):


{
    "message": "Internal Server Error."
}
 

Request      

POST api/v2/patients/payments/braintree/initiate

Body Parameters

patient_id  integer  

ID of the patient.

nonce  string  

Braintree payment nonce.

amount  numeric  

Amount to charge.

order_id  string optional  

Optional order reference ID.

source_id  integer optional  

Optional Appointment source ID.

gateway_id  string optional  

Optional gateway ID if client-level.

qb_channel  string optional  

Optional QuickBooks channel name.

aptType  string optional  

Optional appointment type for async logic.

Store Card Details on Braintree

requires authentication

Saves a card for the patient to Braintree and stores the customer ID and token.

Example request:
curl --request POST \
    "https://staging.prescribery.com/api/v2/patients/payments/braintree/card" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"patient_id\": 1,
    \"nonce\": \"fake-valid-nonce\",
    \"source_id\": 2
}"
const url = new URL(
    "https://staging.prescribery.com/api/v2/patients/payments/braintree/card"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "patient_id": 1,
    "nonce": "fake-valid-nonce",
    "source_id": 2
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://staging.prescribery.com/api/v2/patients/payments/braintree/card',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'patient_id' => 1,
            'nonce' => 'fake-valid-nonce',
            'source_id' => 2,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://staging.prescribery.com/api/v2/patients/payments/braintree/card'
payload = {
    "patient_id": 1,
    "nonce": "fake-valid-nonce",
    "source_id": 2
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):


{
  "braintree_nonce": "abc123xyz",
  "braintree_customer_id": "cust_456def",
}
 

Example response (404):


{
    "message": "Patient not found"
}
 

Example response (422):


{
    "message": "The nonce field is required."
}
 

Request      

POST api/v2/patients/payments/braintree/card

Body Parameters

patient_id  integer  

The patient's ID.

nonce  string  

The Braintree payment nonce.

source_id  integer optional  

The payment source id

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."
}
 

Request      

POST api/v2/patients/payments/paypal/store

Body Parameters

patient_id  integer  

The DoctalkGo patient ID.

agent_id  integer  

The ID of the staff/agent who collected the payment.

transection_id  string  

The PayPal transaction ID.

payment_mode  string  

The payment method (must be 'paypal').

amount  numeric  

Amount charged to the patient.

billing_address  string optional  

optional The billing address.

payment_status  string optional  

optional The payment status (default: success).

channel  string optional  

optional The payment product/channel.

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"
}
 

Request      

GET api/v2/pharmacy/list

Query Parameters

pharmacy_name  string  

The name (or partial name) of the pharmacy to search for.

state  string  

The state to filter pharmacies by.

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"
}
 

Request      

GET api/v2/pharmacy/search-on-dosespot

Query Parameters

name  string optional  

required. The name (or partial name) of the pharmacy to search for. Must be at least 3 characters long.

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."
}
 

Request      

GET api/v2/questionnaires

Query Parameters

sort_column  string optional  

Optional. The column to sort by. Possible values: template_id, questionnaire_name, created_time default created_time.

sort_order  string optional  

Optional. The sort direction. Either A for ascending or D for descending default D.

per_page  integer optional  

Optional. The number of results per page.

page  integer optional  

Optional. The page number to retrieve.

Submit Questionnaire

requires authentication

This endpoint allows you to submit answers to a specific questionnaire template for a given patient. It supports updates and creations of new responses, logs responses from email links, and stores associated metadata such as coupon codes, appointment types, medications, and allergies.

Example request:
curl --request POST \
    "https://staging.prescribery.com/api/v2/questionnaires/answers" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"template_id\": 5643,
    \"patient_id\": 5,
    \"answers\": \"eos\",
    \"ques_map_id\": 5,
    \"coupon_code\": \"\\\"FREEMED2025\\\"\",
    \"ip_address\": \"\\\"192.168.1.1\\\"\",
    \"questionnaire_id\": 12
}"
const url = new URL(
    "https://staging.prescribery.com/api/v2/questionnaires/answers"
);

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "template_id": 5643,
    "patient_id": 5,
    "answers": "eos",
    "ques_map_id": 5,
    "coupon_code": "\"FREEMED2025\"",
    "ip_address": "\"192.168.1.1\"",
    "questionnaire_id": 12
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://staging.prescribery.com/api/v2/questionnaires/answers',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'json' => [
            'template_id' => 5643,
            'patient_id' => 5,
            'answers' => 'eos',
            'ques_map_id' => 5,
            'coupon_code' => '"FREEMED2025"',
            'ip_address' => '"192.168.1.1"',
            'questionnaire_id' => 12,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://staging.prescribery.com/api/v2/questionnaires/answers'
payload = {
    "template_id": 5643,
    "patient_id": 5,
    "answers": "eos",
    "ques_map_id": 5,
    "coupon_code": "\"FREEMED2025\"",
    "ip_address": "\"192.168.1.1\"",
    "questionnaire_id": 12
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):


{
    "data": {
        "ques_map_id": 123
    }
}
 

Example response (401):


{
    "message": "Unauthenticated."
}
 

Example response (422):


{
    "message": "failed",
    "reason": {
        "template_id": [
            "The template id is required."
        ],
        "patient_id": [
            "The patient Id is required."
        ],
        "answers": [
            "Answers are required."
        ]
    }
}
 

Example response (500):


{
    "message": "Something went wrong."
}
 

Request      

POST api/v2/questionnaires/answers

Body Parameters

template_id  integer  

The ID of the template fetch from the questionnaire list endpoint.

patient_id  integer  

The ID of the patient fetch from the patients endpoint.

answers  json  

A list of answer entries is fetched from the questionnaire endpoint using the template ID. It also displays the template questionnaire values and options.. Example [{ "entry_id": "190", "answer": "Male", "multiple_answers": [ { "answer": "Male" }, { "answer": "Female" } ] }]

answers[].entry_id  string  

answers[].answer  string  

ques_map_id  integer optional  

Optional Fetch from the get patient questionnaires endpoint.

coupon_code  string optional  

Optional Coupon code submitted with the questionnaire.

ip_address  string optional  

Optional IP address of the user submitting the questionnaire.

questionnaire_id  integer optional  

Optional ID used for tracking analytics data.

Questionnaire

requires authentication

This endpoint returns the Questionnaires JSON for the given template ID and type. It can optionally retrieve a specific version of the template's questionnaires.

Requires authentication. Behavior changes based on user role (company role limits results to source-matched templates).

Example request:
curl --request GET \
    --get "https://staging.prescribery.com/api/v2/questionnaires/5643?group_questionnaire=" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://staging.prescribery.com/api/v2/questionnaires/5643"
);

const params = {
    "group_questionnaire": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://staging.prescribery.com/api/v2/questionnaires/5643',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'group_questionnaire'=> '0',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://staging.prescribery.com/api/v2/questionnaires/5643'
params = {
  'group_questionnaire': '0',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


{
    "data": [
        {
            "notes": "test",
            "inline": false,
            "value": [
                "Yes",
                "No"
            ],
            "type": "radio-group",
            "conditions": "",
            "group_questionnaire": "",
            "notes_type": "Question with Options",
            "is_multi_choice": "",
            "options": [],
            "is_deleted": "",
            "template_id": "4",
            "is_mandatory": "",
            "position": 3,
            "entry_id": "",
            "className": "",
            "description": "",
            "placeholder": "",
            "dqReason": "",
            "dqVal": "Yes"
        }
    ]
}
 

Example response (401):


{
    "message": "Unauthenticated."
}
 

Example response (500):


{
  "message": "Internal Server Error.",
}
 

Request      

GET api/v2/questionnaires/{templateId}

URL Parameters

templateId  integer  

The id of the template fetch from the questionnaire list endpoint (e.g., 5643).

Query Parameters

group_questionnaire  boolean optional  

Whether to return grouped questionnaire format.

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."
}
 

Request      

GET api/v2/questionnaires/client-report-webhook

Query Parameters

client_id  integer  

The ID of the client.

source_id  integer optional  

Optional. The ID of the source.

from_date  string optional  

date Optional. The start date in YYYY-MM-DD format. Defaults to today if not provided.

to_date  string optional  

date Optional. The end date in YYYY-MM-DD format. Defaults to today if not provided.

is_test_data_required  boolean optional  

Optional. Whether to include test data. Use "true" or "false". Defaults to false.

Services

Get Services

requires authentication

Retrieve a paginated list of services, optionally filtered and sorted by various parameters.

Example request:
curl --request GET \
    --get "https://staging.prescribery.com/api/v2/services?id=12&search=dental&client_id=5&type=consultation&category=diagnostics&action=categorywise&page=1&per_page=10&sort_column=title&sort_order=A" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://staging.prescribery.com/api/v2/services"
);

const params = {
    "id": "12",
    "search": "dental",
    "client_id": "5",
    "type": "consultation",
    "category": "diagnostics",
    "action": "categorywise",
    "page": "1",
    "per_page": "10",
    "sort_column": "title",
    "sort_order": "A",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://staging.prescribery.com/api/v2/services',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'id'=> '12',
            'search'=> 'dental',
            'client_id'=> '5',
            'type'=> 'consultation',
            'category'=> 'diagnostics',
            'action'=> 'categorywise',
            'page'=> '1',
            'per_page'=> '10',
            'sort_column'=> 'title',
            'sort_order'=> 'A',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://staging.prescribery.com/api/v2/services'
params = {
  'id': '12',
  'search': 'dental',
  'client_id': '5',
  'type': 'consultation',
  'category': 'diagnostics',
  'action': 'categorywise',
  'page': '1',
  'per_page': '10',
  'sort_column': 'title',
  'sort_order': 'A',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


{
    "data": [
        {
            "id": 1,
            "name": "Category Name",
            "services": [
                {
                    "id": 101,
                    "title": "Service Title",
                    "description": "Service description",
                    "amount": "100.00",
                    "after_approval_amount": "80.00",
                    "background_color": "#FFFFFF",
                    "booking_with": "online",
                    "created_date": "2025-08-11T10:00:00Z",
                    "icon": "icon.png",
                    "status": 1,
                    "source_id": 5,
                    "template_id": 2,
                    "precautions": "No food before service",
                    "diagnosis": "N/A",
                    "treatments": "Basic Cleaning",
                    "starting_price": "150.00"
                }
            ]
        }
    ],
    "pagination": {
        "page": 1,
        "per_page": "10",
        "has_more_page": true,
        "sort_column": "created_date",
        "sort_order": "D"
    }
}
 

Example response (401):


{
    "message": "Unauthenticated."
}
 

Example response (404):


{
    "message": "Resource Not Found"
}
 

Example response (500):


{
    "message": "Internal Server Error"
}
 

Request      

GET api/v2/services

Query Parameters

id  integer optional  

Optional. Filter by specific service ID.

search  string optional  

Optional. Search services by keyword (service title).

client_id  integer optional  

Optional. Filter by client ID.

type  string optional  

Optional. Filter by service type title.

category  string optional  

Optional. Filter by category name.

action  string optional  

Optional. Use categorywise for category-specific listing. Defaults to default.

page  integer optional  

Optional. Page number to return. Defaults to 1.

per_page  integer optional  

Optional. Number of items per page. Defaults to 10.

sort_column  string optional  

Optional. Column to sort by title, created_at, status. Defaults to created_at.

sort_order  string optional  

Optional. Sort direction. Only "A" (ascending) is supported.

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"
}
 

Request      

GET api/v2/clients/{clientId}/services

URL Parameters

clientId  integer  

The id of the client (e.g., 46).

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"
}
 

Request      

GET api/v2/services/by-client-and-category

Query Parameters

client_id  integer  

The ID of the client.

category_id  integer  

The ID of the category type.

service_for  string optional  

optional The intended user type for the service.

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"
}
 

Request      

GET api/v2/services/{serviceId}/product-and-prices

URL Parameters

serviceId  integer  

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"
}
 

Request      

GET api/v2/{clientId}/{subcategoryId}/services

URL Parameters

clientId  integer  

The ID of the client.

subcategoryId  integer  

The ID of the subcategory.

Query Parameters

service_for  string optional  

optional The type of service.

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"
}
 

Request      

GET api/v2/services/{serviceId}

URL Parameters

serviceId  integer  

The id of the service fetch from the services endpoint (e.g., 143).

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"
}
 

Request      

GET api/v2/sources/{id}

URL Parameters

id  integer  

The ID of the appointment source fetch from the get client active sources.

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"
}
 

Request      

GET api/v2/clients/{id}/sources

URL Parameters

id  integer  

The ID of the client.

State rule

State Rule Implementation

requires authentication

Retrieve the care settings (establishing and continued care) based on the provided state_name and source_id. The response varies depending on whether custom roles and rules exist for the given source and state.

Example request:
curl --request GET \
    --get "https://staging.prescribery.com/api/v2/staterule?state_name=California&source_id=21" \
    --header "Authorization: Bearer {YOUR_AUTH_KEY}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://staging.prescribery.com/api/v2/staterule"
);

const params = {
    "state_name": "California",
    "source_id": "21",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Authorization": "Bearer {YOUR_AUTH_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://staging.prescribery.com/api/v2/staterule',
    [
        'headers' => [
            'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
        'query' => [
            'state_name'=> 'California',
            'source_id'=> '21',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://staging.prescribery.com/api/v2/staterule'
params = {
  'state_name': 'California',
  'source_id': '21',
}
headers = {
  'Authorization': 'Bearer {YOUR_AUTH_KEY}',
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request('GET', url, headers=headers, params=params)
response.json()

Example response (200):


{
  "data": {
    "establishingCare": "audio",    // Possible values: "audio", "video", "async"
    "continuedCare": "audio"        // Possible values: "audio", "video", "async"
  }
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "state_name": [
            "The state name field is required."
        ],
        "source_id": [
            "The source id field is required."
        ]
    }
}
 

Example response (401):


{
    "message": "Unauthenticated."
}
 

Example response (404):


{
    "message": "Resource Not Found"
}
 

Example response (500):


{
    "message": "Internal Server Error"
}
 

Request      

GET api/v2/staterule

Query Parameters

state_name  string  

The state for which the care settings need to be fetched (e.g., "California").

source_id  integer  

The unique identifier for the appointment source is fetch from get client active sources.