API Resources

All API URLs listed in this documentation are relative to https://api.dispensarytree.com/.


Authentication

The API requires Access token HTTP Authentication with your Practice token (live or test). In order to authenticate properly, please put Authorization: Bearer ACCESSTOKEN in your header.

Content-Type: application/json
Authorization: Bearer ACCESSTOKENHERE
You can find your Application token under Particular Application generate token page.


Request & Response Data

Request data is passed to the API by POSTing JSON objects with the appropriate key/value-pairs to the respective resource. The documentation for each API resource contains more details on the values accepted by a given resource. Response data also formatted as JSON object. You can specify how many results per page are to be returned.

For instance, https://api.dispensarytree.com/response/practitioner/?results=25&p=2 will return up to 25 results and &p=2 will return records from second page.


REST & Disposable Objects

The Practice API is built around REST principles. Use POST requests to create objects, GET requests to retrieve objects, and PUT requests to update objects.



Practitioner Detail

To call this API, it need "practice_token" to be passed in API to get results.

This will give result of practitioner Detail related to passed practice token.

Attributes

id
numeric
This will be the practitioner Id.
firstname
string
Contain firstname of Practitioner
lastname
string
Contain lastname of Practitioner
username
email
Unique email of practitioner which let user to login.
mobile
numeric
Practitioner phone number which is not visible to patient.
phone
numeric
Practitioner Work phone number, usually visible to patient.
clinic_name
string
Practitioner Clinic name
web_address
string
Practitioner Web address
education
string
Practitioner education
practitioner_type
string
Practitioner type
reg_info
string
Practitioner Register Information
gov_org
string
Practitioner Governing Organization
default_address
Default address will be selected by default for shipping
address_name
string
Title of the address
firstname
string
Firstname of person to whom address belongs to.
lastname
string
Lastname of person to whom address belongs to.
mobile
string
Addresses containing a phone number allow carriers to call the recipient when delivering the Parcel. This increases the probability of delivery and helps to avoid accessorial charges after a Parcel has been shipped.
phone
string
Addresses containing a phone number allow carriers to call the recipient when delivering the Parcel. This increases the probability of delivery and helps to avoid accessorial charges after a Parcel has been shipped.
email
email
E-mail address of the contact person.
address1
string
First street line. Usually street number and street name.
address2
string
Second street line.
city_id
numeric
City id to which city belongs, you can get this with City API
state_id
numeric
State id to which city belongs, you can get this with State API
country_id
numeric
Country id to which city belongs, you can get this with Country API
zip_code
string
Zipcode of person to whom address belongs to.

API Resource URL

https://api.dispensarytree.com/response/practitioner

Response Example

 {
        "id":   "2",
        "firstname":  "Methew",
        "lastname":  "Dew",
        "username":  "support@gmail.com",
        "mobile":  "6573262880",
        "phone":  "6573262880",
        "clinic_name":  "www.dispensary.com",
        "web_address":  "http//yahoo.com",
        "education":  "Dr. of Chinese Medicine",
        "practitioner_type":  "Herbalist",
        "reg_info":  "registerd",
        "gov_org":  "CTCMPAO - Ontario",
        "default_address":  [
            {
                "address_name":  "Home Address ",
                "firstname":  "Methew",
                "lastname":  "Yang Yiu",
                "mobile":  "+13423423433",
                "phone":  "+13423423433 ",
                "email":  "parcel@gmail.com",
                "address1":  "693 Baker Avenue ",
                "address2":  " ",
                "city_id":  "12335",
                "state_id":  "52",
                "country_id":  "236",
                "zip_code":  "75244"
            }
        ]
    }

Practitioner Addresses

To call this API, it need "practice_token" to be passed in API to get results.

This will give result of All practitioner addresses related to passed practice token.

Attributes

address_name
string
Title of the address
firstname
string
Firstname of person to whom address belongs to.
lastname
string
Lastname of person to whom address belongs to.
mobile
string
Addresses containing a phone number allow carriers to call the recipient when delivering the Parcel. This increases the probability of delivery and helps to avoid accessorial charges after a Parcel has been shipped.
phone
string
Addresses containing a phone number allow carriers to call the recipient when delivering the Parcel. This increases the probability of delivery and helps to avoid accessorial charges after a Parcel has been shipped.
email
email
E-mail address of the contact person.
address1
string
First street line. Usually street number and street name.
address2
string
Second street line.
city_id
numeric
City id to which city belongs, you can get this with City API
state_id
numeric
State id to which city belongs, you can get this with State API
country_id
numeric
Country id to which city belongs, you can get this with Country API
zip_code
string
Zipcode of person to whom address belongs to.

API Resource URL

https://api.dispensarytree.com/response/practitioner-address

Response Example

 {
        "id":   "2",
        "firstname":  "Methew",
        "lastname":  "Dew",
        "username":  "support@gmail.com",
        "mobile":  "6573262880",
        "phone":  "6573262880",
        "clinic_name":  "www.dispensary.com",
        "web_address":  "http//yahoo.com",
        "education":  "Dr. of Chinese Medicine",
        "practitioner_type":  "Herbalist",
        "reg_info":  "registerd",
        "gov_org":  "CTCMPAO - Ontario",
        "default_address":  [
            {
                "address_name":  "Home Address ",
                "firstname":  "Methew",
                "lastname":  "Yang Yiu",
                "mobile":  "+13423423433",
                "phone":  "+13423423433 ",
                "email":  "parcel@gmail.com",
                "address1":  "693 Baker Avenue ",
                "address2":  " ",
                "city_id":  "12335",
                "state_id":  "52",
                "country_id":  "236",
                "zip_code":  "75244"
            }
        ]
    }

Patients

To call this API, it need "practice_token" to be passed in API to get results.

This will give List of all patients of Practitioner related to passed practice token.

Attributes

id
numeric
This will be the patient Id.
login_username
string
Uniquue string which let patient to login the panel.
firstname
string
Contain firstname of Patient.
lastname
string
Contain lastname of Patient.
email
email
Unique email of patient which help patient to receive mails.
personal_email
email
Personal email of patient.
office_email
email
Office email of patient.
other_email
email
Other email of patient.
phone
numeric
Patient phone number.
mobile_phone
numeric
Patient mobile phone number.
work_phone
numeric
Patient work phone number.
fax_phone
numeric
Patient fax phone number.
home_phone
numeric
Patient home phone number.
patient_note
numeric
Patient phone number.
default_address
Default address will be selected by default for shipping and in serialize form.
address_name
string
Title of the address
firstname
string
Firstname of person to whom address belongs to.
lastname
string
Lastname of person to whom address belongs to.
mobile
string
Addresses containing a phone number allow carriers to call the recipient when delivering the Parcel. This increases the probability of delivery and helps to avoid accessorial charges after a Parcel has been shipped.
phone
string
Addresses containing a phone number allow carriers to call the recipient when delivering the Parcel. This increases the probability of delivery and helps to avoid accessorial charges after a Parcel has been shipped.
email
email
E-mail address of the contact person.
address1
string
First street line. Usually street number and street name.
address2
string
Second street line.
city_id
numeric
City id to which city belongs, you can get this with City API
state_id
numeric
State id to which city belongs, you can get this with State API
country_id
numeric
Country id to which city belongs, you can get this with Country API
zip_code
string
Zipcode of person to whom address belongs to.

API Resource URL

https://api.dispensarytree.com/response/patients

Response Example

 {
        "id":   "2",
        "login_username":  "testname",
        "firstname":  "Methew",
        "lastname":  "Dew",
        "email":  "email@gmail.com",
        "personal_email":  "personal_email@gmail.com",
        "office_email":  "office_email@gmail.com",
        "other_email":  "other_email@gmail.com",
        "phone":  "6456876867",
        "mobile_phone":  "6456876867",
        "work_phone":  "6456876867",
        "fax_phone":  "6456876867",
        "home_phone":  "6456876867",
        "patient_note":  "Test patient for reviewing",
        "default_address":  [
            {
                "address_name":  "Home Address ",
                "firstname":  "Methew",
                "lastname":  "Yang Yiu",
                "mobile":  "+13423423433",
                "phone":  "+13423423433",
                "email":  "parcel@gmail.com",
                "address1":  "693 Baker Avenue ",
                "address2":  " ",
                "city_id":  "12335",
                "state_id":  "52",
                "country_id":  "236",
                "zip_code":  "75244"
            }
        ]
        "address":  [
            {
                "address_name":  "Home Address ",
                "firstname":  "Methew",
                "lastname":  "Yang Yiu",
                "mobile":  "+13423423433",
                "phone":  "+13423423433",
                "email":  "parcel@gmail.com",
                "address1":  "693 Baker Avenue ",
                "address2":  " ",
                "city_id":  "12335",
                "state_id":  "52",
                "country_id":  "236",
                "zip_code":  "75244"
            }
        ]
    }

Practitioner Formulas

To call this API, it need "practice_token" to be passed in API to get results.

This will give result of All practitioner Formulas related to passed practice token.

Attributes

id
numeric
This will be the formula Id.
patient_id
numeric
Patient id whcih exist in formula
formula_t
string
Formula type- Basically of four types:
  • per: Total Quantity
  • daily: Daily dosage
  • per_day: Per day for raw only
  • per_bag: Per bag for raw only
herb_type_common
string
Herb type- Basically of four types:
  • granules
  • dtinctures
  • raw
  • concentrates
name
string
It will be Formula Name
dosage
serialize
Use for all herb type except Raw, In serialize form, on unserializing array their key will be the type of dosage and you can get type by matching key in Dosage Api List.
act_weight
numeric
Actual Weight of the formula
set_totalweight_formula
numeric
Set Weight of the formula
dosage_instruction
string
Dosage INstruction used for Raw herb type.
additional_info_formula
string
Additional Instruction for dosage
instruction_for_medicinary
string
Medicinary Special Instructions
instruction_prepration
string
Prepare Instruction
preboil_inst_id
numeric
Used for Raw: id of preboil instructions
preboil_inst
numeric
Used for Raw: instruction of preboil.
cooking_inst_id
numeric
Used for Raw: id of cooking instructions
cooking_inst
numeric
Used for Raw: instruction of cooking.
end_inst_id
numeric
Used for Raw: id of end instructions
end_inst
numeric
Used for Raw: instruction of end.
unit_price
numeric
Formula price.
add_on_services
serialize
In serialize form and you can get more information by matching key in Add-on-service Api List.

API Resource URL

https://api.dispensarytree.com/response/practitioner-formulas

Response Example

 {
            "id":  "25544",
            "patient_id":  "2263",
            "formula_t":  "per",
            "herb_type_common":  "granules",
            "name":  "Sample Formula",
            "act_weight":  "46",
            "set_totalweight_formula":  "84",
            "dosage":  "a:7:{i:75;s:4:"Take";i:11;s:1:"6";i:14;s:1:"g";i:12;s:1:"2";i:16;s:17:"times per day for";i:13;s:1:"7";i:74;s:6:"day(s)";}",
            "dosage_instruction":  "",
            "additional_info_formula":  "Please take dosage regularly without skipping it.",
            "instruction_for_medicinary":  "-- Keep in cold Area",
            "instruction_prepration":  "Prepared in low temperature with all precautions.",
            "preboil_inst_id": "0",
            "preboil_inst":  "",
            "cooking_inst_id":  "0",
            "cooking_inst":  "",
            "end_inst_id":  "0",
            "end_inst":  "",
            "unit_price":  "9.72",
            "add_on_services":  "[{"id":  "8", "Name":  "Extra 100ml Amber Glass Bottle with Dropper" "price":  "1.25", "tax":  "6", },{"id":  "19", "Name":  "asd" "price":  "0.01", "tax":  "0", }]"
        },

Formula Herbs

To call this API, it need "practice_token", "data_id" to be passed in API to get results.

This will give result of All Formula Herbs related to passed practice token.

Attributes

id
numeric
id is the unique string of herb added
product_id
numeric
Formula id herb related to.
herb_id
numeric
Herb id which is added in formula.
herb_add_type
string
Herb add type.
bags
numeric
No. of bags
raw_herb_day
numeric
Raw quantity.
herb_supplier_id
numeric
Herb supplier id.
herb_type
string
Herb type.
herb_alcohol
numeric
Herb Alcohol
herb_ratio_1
numeric
Ratio 1
herb_ratio_2
numeric
Ratio 2
herb_ratio
numeric
Total Ratio after calculation
quantity
numeric
Quantity.
enter_qty
numeric
Entered Qty.
price
numeric
Price of herb
sub_total
numeric
Sub total of Herb.

API Resource URL

https://api.dispensarytree.com/response/formula-herbs

Response Example

 {
     "id":   "1118064",
     "product_id":   "25544",
     "herb_id":   "4089",
     "herb_add_type":   null,
     "bags":   "7",
     "raw_herb_day":   "12",
     "herb_supplier_id": "Tian Jiang",
     "herb_type":   "granules",
     "herb_alcohol":   "0",
     "herb_ratio_1":   "",
     "herb_ratio_2":   "",
     "herb_ratio":   "0.2",
     "quantity":   "21.91",
     "enter_qty":   "12",
     "price":   "0.095",
     "sub_total":   "2.081"
  },
                    

Create Practitioner Addresses

To call this API, it need "practice_token" to be passed in API to get results.

This will Create Practitioner Addresses related to passed practice token.

Attributes

firstname
string
Firstname of person to whom address belongs to. (Mandatory)
lastname
string
Lastname of person to whom address belongs to. (Mandatory)
phone
string
Addresses containing a phone number allow carriers to call the recipient when delivering the Parcel. This increases the probability of delivery and helps to avoid accessorial charges after a Parcel has been shipped.

Please follow format phonecode with phone number i.e +16457892031.
email
email
E-mail address of the contact person.
address1
string
First street line. Usually street number and street name. (Mandatory)
address2
string
Second street line.
city_name
alphanumeric
City Name to which city belongs, you can get this with City API (Mandatory)
state_name
alphanumeric
State Name to which State belongs, you can get this with State API (Mandatory)
country_id
numeric
Country id to which country belongs, you can get this with Country API (Mandatory)
zip_code
string
Zipcode of person to whom address belongs to. (Mandatory)
Is default
string
To mark it default set it to 1.

API Resource URL

https://api.dispensarytree.com/response/create-pratitioner-address

Response Example


$headers  = array(
     "Content-Type: application/json",
     "Authorization: Bearer " . trim('ACCESS_TOKEN')
 );

$url='https://api.dispensarytree.com/response/create-practitioner-address';
    
$data= array(
        "practice_token" => 'PRACTICE_TOKEN',
        "firstname" => 'Testing',
        "lastname" => 'Dev',
        "address1" => 'Street 1',
        "address2" => 'Street 1 cont.',
        "phone" => '+16457892031',
        "email" => 'abc@gmail.com',
        "country_id" => '40',
        "state_name" => 'Ontorio',
        "city_name" => 'Toronto',
        "zip_code" => '1212',
        "is_default" => '0',
    );
    



$curl= curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$resp = curl_exec($curl);
$jsonRes = json_decode($resp);
curl_close($curl);

Modify Practitioner Addresses

To call this API, it need "practice_token" to be passed in API to get results.

This will Modify Practitioner Addresses related to passed practice token.

Attributes

id
int
Please add address id which you need to update. (Mandatory)
firstname
string
Firstname of person to whom address belongs to. (Mandatory)
lastname
string
Lastname of person to whom address belongs to. (Mandatory)
phone
string
Addresses containing a phone number allow carriers to call the recipient when delivering the Parcel. This increases the probability of delivery and helps to avoid accessorial charges after a Parcel has been shipped.

Please follow format phonecode with phone number i.e +16457892031.
email
email
E-mail address of the contact person.
address1
string
First street line. Usually street number and street name. (Mandatory)
address2
string
Second street line.
city_id
numeric
City id to which city belongs, you can get this with City API (Mandatory)
state_id
numeric
State id to which city belongs, you can get this with State API (Mandatory)
country_id
numeric
Country id to which city belongs, you can get this with Country API (Mandatory)
zip_code
string
Zipcode of person to whom address belongs to. (Mandatory)
Is default
string
To mark it default set it to 1.

API Resource URL

https://api.dispensarytree.com/response/modify-practitioner-address

Response Example


$headers  = array(
     "Content-Type: application/json",
     "Authorization: Bearer " . trim('ACCESS_TOKEN')
 );

$url='https://api.dispensarytree.com/response/modify-practitioner-address';
    
$data= array(
        "practice_token" => 'PRACTICE_TOKEN',
        "id" => '1234',
        "firstname" => 'Testing',
        "lastname" => 'Dev',
        "address1" => 'Street 1',
        "address2" => 'Street 1 cont.',
        "phone" => '+16457892031',
        "email" => 'abc@gmail.com',
        "country_id" => '40',
        "state_name" => 'Ontorio',
        "city_name" => 'Toronto',
        "zip_code" => '1212',
        "is_default" => '0',
    );
    



$curl= curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$resp = curl_exec($curl);
$jsonRes = json_decode($resp);
curl_close($curl);

Create Patient

To call this API, it need "practice_token" to be passed in API to get results.

This will Create Patient related to passed practice token.

Attributes

login_username
string
Field should be unique and No space And Only letters and numbers is Allowed.
firstname
string
Firstname of person to whom address belongs to. (Mandatory)
lastname
string
Lastname of person to whom address belongs to. (Mandatory)
email
email
E-mail address of the contact person.
personal_email
email
E-mail address of the contact person.
office_email
email
E-mail address of the contact person.
other_email
email
E-mail address of the contact person.
phone
string
Please follow format phonecode with phone number i.e +16457892031.
mobile_phone
string
Please follow format phonecode with phone number i.e +16457892031.
work_phone
string
Please follow format phonecode with phone number i.e +16457892031.
fax_phone
string
Please follow format phonecode with phone number i.e +16457892031.
home_phone
string
Please follow format phonecode with phone number i.e +16457892031.
patient_note
string
Any NOte you want to add for patient while creating one.

API Resource URL

https://api.dispensarytree.com/response/create-patient

Response Example


$headers  = array(
     "Content-Type: application/json",
     "Authorization: Bearer " . trim('ACCESS_TOKEN')
 );

$url='https://api.dispensarytree.com/response/create-patient';
    
$data= array(
        "practice_token" => 'PRACTICE_TOKEN',
        "login_username" => 'Testing',
        "firstname" => 'Testing',
        "lastname" => 'Dev',
        "email" => 'abc@gmail.com',
        "personal_email" => 'personal@gmail.com',
        "office_email" => 'office@gmail.com',
        "other_email" => 'other@gmail.com',
        "phone" => '+16457892031',
        "mobile_phone" => '+16457892031',
        "work_phone" => '+16457892031',
        "fax_phone" => '+16457892031',
        "home_phone" => '+16457892031',
        "patient_note" => 'Patient Note Go here.',
    );
    




$curl= curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$resp = curl_exec($curl);
$jsonRes = json_decode($resp);
curl_close($curl);

Modify Patient

To call this API, it need "practice_token" to be passed in API to get results.

This will Modify Patient related to passed practice token.

Attributes

id
string
Id of patient whose information you need to modify. (Mandatory)
login_username
string
Field should be unique and No space And Only letters and numbers is Allowed.
firstname
string
Firstname of person to whom address belongs to. (Mandatory)
lastname
string
Lastname of person to whom address belongs to. (Mandatory)
email
email
E-mail address of the contact person.
personal_email
email
E-mail address of the contact person.
office_email
email
E-mail address of the contact person.
other_email
email
E-mail address of the contact person.
phone
string
Please follow format phonecode with phone number i.e +16457892031.
mobile_phone
string
Please follow format phonecode with phone number i.e +16457892031.
work_phone
string
Please follow format phonecode with phone number i.e +16457892031.
fax_phone
string
Please follow format phonecode with phone number i.e +16457892031.
home_phone
string
Please follow format phonecode with phone number i.e +16457892031.
patient_note
string
Any NOte you want to add for patient while creating one.

API Resource URL

https://api.dispensarytree.com/response/modify-patient

Response Example


$headers  = array(
     "Content-Type: application/json",
     "Authorization: Bearer " . trim('ACCESS_TOKEN')
 );

$url='https://api.dispensarytree.com/response/modify-patient';
    
$data= array(
        "practice_token" => 'PRACTICE_TOKEN',
        "id" => '1234',
        "login_username" => 'Testing',
        "firstname" => 'Testing',
        "lastname" => 'Dev',
        "email" => 'abc@gmail.com',
        "personal_email" => 'personal@gmail.com',
        "office_email" => 'office@gmail.com',
        "other_email" => 'other@gmail.com',
        "phone" => '+16457892031',
        "mobile_phone" => '+16457892031',
        "work_phone" => '+16457892031',
        "fax_phone" => '+16457892031',
        "home_phone" => '+16457892031',
        "patient_note" => 'Patient Note Go here.',
    );
    



$curl= curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$resp = curl_exec($curl);
$jsonRes = json_decode($resp);
curl_close($curl);

Create Patient Addresses

To call this API, it need "practice_token" to be passed in API to get results.

This will Create Patient addresses related to passed practice token.

Attributes

patient_id
int
Patient Id goes here. (Mandatory)
firstname
string
Firstname of person to whom address belongs to. (Mandatory)
lastname
string
Lastname of person to whom address belongs to. (Mandatory)
phone
string
Addresses containing a phone number allow carriers to call the recipient when delivering the Parcel. This increases the probability of delivery and helps to avoid accessorial charges after a Parcel has been shipped.

Please follow format phonecode with phone number i.e +16457892031.
email
email
E-mail address of the contact person.
address1
string
First street line. Usually street number and street name. (Mandatory)
address2
string
Second street line.
city_id
numeric
City id to which city belongs, you can get this with City API (Mandatory)
state_id
numeric
State id to which city belongs, you can get this with State API (Mandatory)
country_id
numeric
Country id to which city belongs, you can get this with Country API (Mandatory)
zip_code
string
Zipcode of person to whom address belongs to. (Mandatory)
Is default
string
To mark it default set it to 1.

API Resource URL

https://api.dispensarytree.com/response/create-patient-address

Response Example


$headers  = array(
     "Content-Type: application/json",
     "Authorization: Bearer " . trim('ACCESS_TOKEN')
 );

$url='https://api.dispensarytree.com/response/create-patient-address';
    
$data= array(
        "practice_token" => 'PRACTICE_TOKEN',
        "patient_id" => '1234',
        "firstname" => 'Testing',
        "lastname" => 'Dev',
        "address1" => 'Street 1',
        "address2" => 'Street 1 cont.',
        "phone" => '+16457892031',
        "email" => 'abc@gmail.com',
        "country_id" => '40',
        "state_name" => 'Ontorio',
        "city_name" => 'Toronto',
        "zip_code" => '1212',
        "is_default" => '0',
    );
    



$curl= curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$resp = curl_exec($curl);
$jsonRes = json_decode($resp);
curl_close($curl);

Modify Patient Addresses

To call this API, it need "practice_token" to be passed in API to get results.

This will Modify Patient Addresses related to passed practice token.

Attributes

id
string
Id of patient address need to modify. (Mandatory)
patient_id
int
Patient Id goes here. (Mandatory)
firstname
string
Firstname of person to whom address belongs to. (Mandatory)
lastname
string
Lastname of person to whom address belongs to. (Mandatory)
phone
string
Addresses containing a phone number allow carriers to call the recipient when delivering the Parcel. This increases the probability of delivery and helps to avoid accessorial charges after a Parcel has been shipped.

Please follow format phonecode with phone number i.e +16457892031.
email
email
E-mail address of the contact person.
address1
string
First street line. Usually street number and street name. (Mandatory)
address2
string
Second street line.
city_id
numeric
City id to which city belongs, you can get this with City API (Mandatory)
state_id
numeric
State id to which city belongs, you can get this with State API (Mandatory)
country_id
numeric
Country id to which city belongs, you can get this with Country API (Mandatory)
zip_code
string
Zipcode of person to whom address belongs to. (Mandatory)
Is default
string
To mark it default set it to 1.

API Resource URL

https://api.dispensarytree.com/response/create-patient-address

Response Example


$headers  = array(
     "Content-Type: application/json",
     "Authorization: Bearer " . trim('ACCESS_TOKEN')
 );

$url='https://api.dispensarytree.com/response/create-patient-address';
    
$data= array(
        "practice_token" => 'PRACTICE_TOKEN',
        "id" => '1234',
        "patient_id" => '1234',
        "firstname" => 'Testing',
        "lastname" => 'Dev',
        "address1" => 'Street 1',
        "address2" => 'Street 1 cont.',
        "phone" => '+16457892031',
        "email" => 'abc@gmail.com',
        "country_id" => '40',
        "state_id" => '1',
        "city_id" => '15637',
        "zip_code" => '1212',
        "is_default" => '0',
    );
    



$curl= curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$resp = curl_exec($curl);
$jsonRes = json_decode($resp);
curl_close($curl);

Create Granule Total Formula

To call this API, it need "practice_token" to be passed in API to get results.

This will Create Granule Total formula related to passed practice token.

Attributes

patient_id
int
If formula will contain patient in it, then assign patient_id to it.
name
string
Name of formula. (Mandatory)
do_not_use_on_label
int (0,1)
Print on Label & Infosheet? It should be either 1 or 0.
additional_info_formula
string
Add Your Own Dosage Instructions .
instruction_prepration
string
Preparation Instructions
instruction_for_medicinary
string
Special Instructions.
herbs
array
herb_id (herb you want to include in the formula) (Mandatory) quantity (qty of herbs you want to use in formula) (Mandatory)
add_on_services
array
name of add-on-service

API Resource URL

https://api.dispensarytree.com/response/create-granule-total-formula

Response Example


$headers  = array(
     "Content-Type: application/json",
     "Authorization: Bearer " . trim('ACCESS_TOKEN')
 );

$url='https://api.dispensarytree.com/response/create-granule-total-formula';
    
$data= array(
        "practice_token" => 'PRACTICE_TOKEN',
        "patient_id" => '2234',
        "name" => 'Granule Total Sample Formula',
        "do_not_use_on_label" => '1',
        "additional_info_formula" => 'additional Information Data',
        "instruction_prepration" => 'Instruction Prepearation',
        "instruction_for_medicinary" => 'Special instructions',
        "herbs" => array(
            array('herb_id' => '14151', 'quantity' => '4'),
            array('herb_id' => '10082', 'quantity' => '12'),
        ),
        "add_on_services" => array(
            array('name' => 'Add On Service'),
            array('name' => 'Add On Service2'),
        ),
    );
    



$curl= curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$resp = curl_exec($curl);
$jsonRes = json_decode($resp);
curl_close($curl);

Create Granule Daily Formula

To call this API, it need "practice_token" to be passed in API to get results.

This will Create Granule Daily formula related to passed practice token.

Attributes

patient_id
int
If formula will contain patient in it, then assign patient_id to it.
name
string
Name of formula. (Mandatory)
do_not_use_on_label
int (0,1)
Print on Label & Infosheet? It should be either 1 or 0.
additional_info_formula
string
Add Your Own Dosage Instructions .
instruction_prepration
string
Preparation Instructions
instruction_for_medicinary
string
Special Instructions.
herbs
array
herb_id (herb you want to include in the formula) (Mandatory) quantity (qty of herbs you want to use in formula) (Mandatory)
add_on_services
array
name of add-on-service

API Resource URL

https://api.dispensarytree.com/response/create-granule-daily-formula

Response Example


$headers  = array(
     "Content-Type: application/json",
     "Authorization: Bearer " . trim('ACCESS_TOKEN')
 );

$url='https://api.dispensarytree.com/response/create-granule-daily-formula';
    
$data= array(
    "practice_token" => 'PRACTICE_TOKEN',
    "patient_id" => '2234',
    "name" => 'Granule Total Sample Formula',
    "do_not_use_on_label" => '1',
    "additional_info_formula" => 'additional Info.',
    "instruction_prepration" => 'Instruction Info.',
    "instruction_for_medicinary" => 'Special instr.',
    "herbs" => array(
        array('herb_id' => '14151', 'quantity' => '4'),
        array('herb_id' => '10082', 'quantity' => '12'),
    ),
    "add_on_services" => array(
        array('name' => 'Add On Service'),
        array('name' => 'Add On Service2'),
    ),
);




$curl= curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$resp = curl_exec($curl);
$jsonRes = json_decode($resp);
curl_close($curl);

Create Tincture Total Formula

To call this API, it need "practice_token" to be passed in API to get results.

This will Create Tincture Total Formula related to passed practice token.

Attributes

patient_id
int
If formula will contain patient in it, then assign patient_id to it.
name
string
Name of formula. (Mandatory)
do_not_use_on_label
int (0,1)
Print on Label & Infosheet? It should be either 1 or 0.
additional_info_formula
string
Add Your Own Dosage Instructions .
instruction_prepration
string
Preparation Instructions
instruction_for_medicinary
string
Special Instructions.
herbs
array
herb_id (herb you want to include in the formula) (Mandatory) quantity (qty of herbs you want to use in formula) (Mandatory)
add_on_services
array
name of add-on-service

API Resource URL

https://api.dispensarytree.com/response/create-tincture-total-formula

Response Example


$headers  = array(
     "Content-Type: application/json",
     "Authorization: Bearer " . trim('ACCESS_TOKEN')
 );

$url='https://api.dispensarytree.com/response/create-tincture-total-formula';
    
$data= array(
        "practice_token" => 'PRACTICE_TOKEN',
        "patient_id" => '2234',
        "name" => 'Granule Total Sample Formula',
        "do_not_use_on_label" => '1',
        "additional_info_formula" => 'additional Information Data',
        "instruction_prepration" => 'Instruction Prepearation',
        "instruction_for_medicinary" => 'Special instructions',
        "herbs" => array(
            array('herb_id' => '14151', 'quantity' => '4'),
            array('herb_id' => '10082', 'quantity' => '12'),
        ),
        "add_on_services" => array(
            array('name' => 'Add On Service'),
            array('name' => 'Add On Service2'),
        ),
    );
    



$curl= curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$resp = curl_exec($curl);
$jsonRes = json_decode($resp);
curl_close($curl);

Create Tincture Daily Formula

To call this API, it need "practice_token" to be passed in API to get results.

This will Create Tincture Daily Formula related to passed practice token.

Attributes

patient_id
int
If formula will contain patient in it, then assign patient_id to it.
name
string
Name of formula. (Mandatory)
do_not_use_on_label
int (0,1)
Print on Label & Infosheet? It should be either 1 or 0.
additional_info_formula
string
Add Your Own Dosage Instructions .
instruction_prepration
string
Preparation Instructions
instruction_for_medicinary
string
Special Instructions.
herbs
array
herb_id (herb you want to include in the formula) (Mandatory) quantity (qty of herbs you want to use in formula) (Mandatory)
add_on_services
array
name of add-on-service

API Resource URL

https://api.dispensarytree.com/response/create-tincture-daily-formula

Response Example


$headers  = array(
     "Content-Type: application/json",
     "Authorization: Bearer " . trim('ACCESS_TOKEN')
 );

$url='https://api.dispensarytree.com/response/create-tincture-daily-formula';
    
$data= array(
        "practice_token" => 'PRACTICE_TOKEN',
        "patient_id" => '2234',
        "name" => 'Granule Total Sample Formula',
        "do_not_use_on_label" => '1',
        "additional_info_formula" => 'additional Information Data',
        "instruction_prepration" => 'Instruction Prepearation',
        "instruction_for_medicinary" => 'Special instructions',
        "herbs" => array(
            array('herb_id' => '14151', 'quantity' => '4'),
            array('herb_id' => '10082', 'quantity' => '12'),
        ),
        "add_on_services" => array(
            array('name' => 'Add On Service'),
            array('name' => 'Add On Service2'),
        ),
    );
    



$curl= curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$resp = curl_exec($curl);
$jsonRes = json_decode($resp);
curl_close($curl);

Create Raw Per Day Formula

To call this API, it need "practice_token" to be passed in API to get results.

This will create Raw Per Day Formula related to passed practice token.

Attributes

patient_id
int
If formula will contain patient in it, then assign patient_id to it.
name
string
Name of formula. (Mandatory)
days
int
Name of Days. (Mandatory)
bags
int
Name of Bags. (Mandatory)
do_not_use_on_label
int (0,1)
Print on Label & Infosheet? It should be either 1 or 0.
additional_info_formula
string
Add Your Own Dosage Instructions .
instruction_prepration
string
Preparation Instructions
instruction_for_medicinary
string
Special Instructions.
herbs
array
herb_id (herb you want to include in the formula) (Mandatory) quantity (qty of herbs you want to use in formula) (Mandatory)
add_on_services
array
name of add-on-service

API Resource URL

https://api.dispensarytree.com/response/create-raw-per-day-formula

Response Example


$headers  = array(
     "Content-Type: application/json",
     "Authorization: Bearer " . trim('ACCESS_TOKEN')
 );

$url='https://api.dispensarytree.com/response/create-raw-per-day-formula';
    
$data= array(
    "practice_token" => 'PRACTICE_TOKEN',
    "patient_id" => '2234',
    "name" => 'Granule Total Sample Formula',
    days" => '4',
    "bags" => '3',
    "do_not_use_on_label" => '1',
    "additional_info_formula" => 'additional Info.',
    "instruction_prepration" => 'Instruction Info.',
    "instruction_for_medicinary" => 'Special instr.',
    "herbs" => array(
        array('herb_id' => '14151', 'quantity' => '4', 'herb_add_type' => 'pre-boil'),
        array('herb_id' => '10082', 'quantity' => '12', 'herb_add_type' => 'at the end'),
        array('herb_id' => '10083', 'quantity' => '12', 'herb_add_type' => ''),
    ),
    "add_on_services" => array(
        array('name' => 'Add On Service'),
        array('name' => 'Add On Service2'),
    ),
);




$curl= curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$resp = curl_exec($curl);
$jsonRes = json_decode($resp);
curl_close($curl);

Create Raw Per Bag Formula

To call this API, it need "practice_token" to be passed in API to get results.

This will Create Raw Per Bag Formula related to passed practice token.

Attributes

patient_id
int
If formula will contain patient in it, then assign patient_id to it.
name
string
Name of formula. (Mandatory)
bags
int
Name of Bags. (Mandatory)
do_not_use_on_label
int (0,1)
Print on Label & Infosheet? It should be either 1 or 0.
additional_info_formula
string
Add Your Own Dosage Instructions .
instruction_prepration
string
Preparation Instructions
instruction_for_medicinary
string
Special Instructions.
herbs
array
herb_id (herb you want to include in the formula) (Mandatory) quantity (qty of herbs you want to use in formula) (Mandatory)
add_on_services
array
name of add-on-service

API Resource URL

https://api.dispensarytree.com/responsecreate-raw-per-bag-formula

Response Example


$headers  = array(
     "Content-Type: application/json",
     "Authorization: Bearer " . trim('ACCESS_TOKEN')
 );

$url='https://api.dispensarytree.com/responsecreate-raw-per-bag-formula';
    
$data= array(
        "practice_token" => 'PRACTICE_TOKEN',
        "patient_id" => '2234',
        "name" => 'Granule Total Sample Formula',
        "do_not_use_on_label" => '1',
        "bags" => '3',
        "additional_info_formula" => 'additional Information Data',
        "instruction_prepration" => 'Instruction Prepearation',
        "instruction_for_medicinary" => 'Special instructions',
        "herbs" => array(
            array('herb_id' => '14151', 'quantity' => '4', 'herb_add_type' => 'pre-boil'),
            array('herb_id' => '10082', 'quantity' => '12', 'herb_add_type' => 'at the end'),
            array('herb_id' => '10082', 'quantity' => '12', 'herb_add_type' => ''),
        ),
        "add_on_services" => array(
            array('name' => 'Add On Service'),
            array('name' => 'Add On Service2'),
        ),
    );
    



$curl= curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$resp = curl_exec($curl);
$jsonRes = json_decode($resp);
curl_close($curl);

Create Concentrate Total Formula

To call this API, it need "practice_token" to be passed in API to get results.

This will Create practitioner Concentrate Total formula related to passed practice token.

Attributes

patient_id
int
If formula will contain patient in it, then assign patient_id to it.
name
string
Name of formula. (Mandatory)
do_not_use_on_label
int (0,1)
Print on Label & Infosheet? It should be either 1 or 0.
additional_info_formula
string
Add Your Own Dosage Instructions .
instruction_prepration
string
Preparation Instructions
instruction_for_medicinary
string
Special Instructions.
herbs
array
herb_id (herb you want to include in the formula) (Mandatory) quantity (qty of herbs you want to use in formula) (Mandatory)
add_on_services
array
name of add-on-service

API Resource URL

https://api.dispensarytree.com/response/create-concentrate-daily-formula

Response Example


$headers  = array(
     "Content-Type: application/json",
     "Authorization: Bearer " . trim('ACCESS_TOKEN')
 );

$url='https://api.dispensarytree.com/response/create-concentrate-daily-formula';
    
$data= array(
    "practice_token" => 'PRACTICE_TOKEN',
    "patient_id" => '2234',
    "name" => 'Granule Total Sample Formula',
    "do_not_use_on_label" => '1',
    "additional_info_formula" => 'additional Info.',
    "instruction_prepration" => 'Instruction Info.',
    "instruction_for_medicinary" => 'Special instr.',
    "herbs" => array(
        array('herb_id' => '14151', 'quantity' => '4'),
        array('herb_id' => '10082', 'quantity' => '12'),
    ),
    "add_on_services" => array(
        array('name' => 'Add On Service'),
        array('name' => 'Add On Service2'),
    ),
);




$curl= curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$resp = curl_exec($curl);
$jsonRes = json_decode($resp);
curl_close($curl);

Create Concentrate Daily Formula

To call this API, it need "practice_token" to be passed in API to get results.

This will Create practitioner Concentrate Daily formula related to passed practice token.

Attributes

patient_id
int
If formula will contain patient in it, then assign patient_id to it.
name
string
Name of formula. (Mandatory)
do_not_use_on_label
int (0,1)
Print on Label & Infosheet? It should be either 1 or 0.
additional_info_formula
string
Add Your Own Dosage Instructions .
instruction_prepration
string
Preparation Instructions
instruction_for_medicinary
string
Special Instructions.
herbs
array
herb_id (herb you want to include in the formula) (Mandatory) quantity (qty of herbs you want to use in formula) (Mandatory)
add_on_services
array
name of add-on-service

API Resource URL

https://api.dispensarytree.com/response/create-concentrate-daily-formula

Response Example


$headers  = array(
     "Content-Type: application/json",
     "Authorization: Bearer " . trim('ACCESS_TOKEN')
 );

$url='https://api.dispensarytree.com/response/create-concentrate-daily-formula';
    
$data= array(
    "practice_token" => 'PRACTICE_TOKEN',
    "patient_id" => '2234',
    "name" => 'Granule Total Sample Formula',
    "do_not_use_on_label" => '1',
    "additional_info_formula" => 'additional Info.',
    "instruction_prepration" => 'Instruction Info.',
    "instruction_for_medicinary" => 'Special instr.',
    "herbs" => array(
        array('herb_id' => '14151', 'quantity' => '4'),
        array('herb_id' => '10082', 'quantity' => '12'),
    ),
    "add_on_services" => array(
        array('name' => 'Add On Service'),
        array('name' => 'Add On Service2'),
    ),
);




$curl= curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$resp = curl_exec($curl);
$jsonRes = json_decode($resp);
curl_close($curl);

Create Order

To call this API, it need "practice_token" to be passed in API to get results.

This will Create Orders related to passed practice token.

Attributes

ship_to
string
Options will be patient, practitioner or pickup (Mandatory).
ship_to_patient_id
id
If ship_to selected as Patient then this is mandatory and patient should exist in any of the items.
pickup_type
string
Options will be patient, practitioner or other, if ship_to is pickup then this field is mandatory.
pickup_patient_id
string
If pickup_type selected as Patient then this is mandatory and patient should exist in any of the items .
pickup_name
string
If pickup_type is other, then this is mandatory.
pickup_phone
string
If pickup_type is other, then this is mandatory.
pickup_email
string
If pickup_type is other, then this is mandatory.
shipping_address_id
string
If ship_to is patient then patient address id should be provided ,Or if Practitioner then practitioner address id should be provided. IF there is no shipping_address_id then you can provide TO_ADDRESS info instead of this.
to_address
string
If ship_to is patient OR practitoner and you had not provided any shipping_address_id then please pass this info. to have address of the order to ship.
who_will_pay
string
Patient Or Practitioner (Mandatory)
patient_id_for_payment
string
If patient is selected for payment then please provide patient id who will pay.
to_address
string
If ship_to is patient then patient address id should be provided ,Or if Practitioner then practitioner address id should be provided. IF there is no shipping_address_id then you can provide TO_ADDRESS info instead of this.
items
array
  • product_id (item id which you want to order) (Mandatory)
  • patient_id (if its not custom formula, and you want to assign patient to products ) (Optional)
  • quantity (How much quantity of the item you want to order, by default its 1.) (Optional)
  • markup_type (Percentage OR Flat) (Optional)
  • markup_amount (Value of markup) (Optional)

API Resource URL

https://api.dispensarytree.com/response/create-order

Response Example


$headers  = array(
     "Content-Type: application/json",
     "Authorization: Bearer " . trim('ACCESS_TOKEN')
 );

$url='https://api.dispensarytree.com/response/create-order';
    
$data= array(
    "practice_token" => 'PRACTICE_TOKEN',
    'shipping' => array(
            'ship_to' => 'pickup',
            'ship_to_patient_id' => '',
            'pickup_type' => 'practitioner',
            'pickup_patient_id' => '',
            'pickup_name' => '',
            'pickup_phone' => '',
            'pickup_email' => '',
            'shipping_address_id' => '',
            "to_address" => array(
                'name' => '',
                'firstname' => '',
                'lastname' => '',
                'company' => '',
                'street1' => '',
                'street2' => '',
                'city' => '',
                'state' => '',
                'zip' => '',
                'country' => '',
                'phonecode' => '',
                'phone' => '',
                'email' => '',
            ),
        ),
        "who_will_pay" => 'practitioner',
        "patient_id_for_payment" => '',
        'items'=>array(
            array('product_id' => '24250', 'patient_id' => '','quantity'=>'1','markup_type'=>'percentage','markup_amount'=>'90'),
            array('product_id' => '26160', 'patient_id' => '','quantity'=>'1','markup_type'=>'percentage','markup_amount'=>'90'),
        ),
);




$curl= curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$resp = curl_exec($curl);
$jsonRes = json_decode($resp);
curl_close($curl);

All Product Details

To call this API, it need "practice_token" to be passed in API to get results.

This will give result of all the products related to passed practice token.

Attributes

id
numeric
This will be the formula Id.
sku
alphanumeric
Sku is uniquness of product to detect
brand_id
numeric
It will return brand_id of branders
supplier_id
string
It will return supplier_id of Suppliers
name
string
It will be Product Name
act_weight
serialize
Actual Weight of the product
reorder_label
numeric
Amount set to reorder if its decreasing from stock
long_description
numeric
Description of product
unit_price
string
Unit price of product which is hidden from user.
cost_price
string
Cost price of product which is visible to user
taxable
string
If this product is taxable or not: 1- taxable, 0- not taxable
is_active
string
If this product is_active=1 it will show to the user else this product will be hidden from user
default_category
numeric
It will return the default category id.
categories
numeric
It will return all categories attached to product
  • id: category id(numeric)
  • name: Name of the category
images
numeric
Images of product
stock
numeric
stock- It will give result in multiple data:
  • qty: Total Available Qty
  • lot_no: Lot number of inventory
  • supplier_id: Supplier id

API Resource URL

https://api.dispensarytree.com/response/products?dispensary_token=[DISPENSARY_TOKEN]

Response Example

 {
            "id":  "25544",
            "sku":  "100298-0",
            "brand_id":  "12",
            "supplier_id":  "1",
            "name":  "Ai Di Cha  Ardisidae Japonicae Caulis et Folium  100 g",
            "act_weight":  "100",
            "reorder_label":  "200",
            "long_description":  "",
            "unit_price":  "4.69",
            "cost_price":  "4.69",
            "taxable":  "1",
            "is_active":  "0",
            "default_category": "127",
            "categories":  [ { "id": "127", "Name": "Single Chinese Granules" } ],
            "images":  [ { "id": "922", "image": "yunnanbaiyaocapsule7188.jpg", "is_main": "1" } ],
            "stock":  [{"qty":  "200.00", "lot_no":  "555","supplier_name": "", "supplier_id":  "0" },{"qty":  "1415.00", "lot_no":  "*()%$#!","supplier_name": "", "supplier_id":  "0" },{"qty":  "5.00", "lot_no":  "234234","supplier_name": "", "supplier_id":  "1" }],
            "default_category_name":  "Default category",
            "brand_name":  "Brand data",
            "supplier_name":  "SUPPLIER 1",
        },

Single Product Detail

To call this API, it need "practice_token" to be passed in API to get results.

This will give result of Single Product related to passed practice token.

Attributes

id
numeric
This will be the formula Id.
sku
alphanumeric
Sku is uniquness of product to detect
brand_id
numeric
It will return brand_id of branders
supplier_id
string
It will return supplier_id of Suppliers
name
string
It will be Product Name
act_weight
serialize
Actual Weight of the product
reorder_label
numeric
Amount set to reorder if its decreasing from stock
long_description
numeric
Description of product
unit_price
string
Unit price of product which is hidden from user.
cost_price
string
Cost price of product which is visible to user
taxable
string
If this product is taxable or not: 1- taxable, 0- not taxable
is_active
string
If this product is_active=1 it will show to the user else this product will be hidden from user
default_category
numeric
It will return the default category id.
categories
numeric
It will return all categories attached to product
  • id: category id(numeric)
  • name: Name of the category
images
numeric
Images of product
stock
numeric
stock- It will give result in multiple data:
  • qty: Total Available Qty
  • lot_no: Lot number of inventory
  • supplier_id: Supplier id

API Resource URL

https://api.dispensarytree.com/response/single-product?dispensary_token=[DISPENSARY_TOKEN]&data_id=[PRODUCT_ID]

Response Example

 {
            "id":  "25544",
            "sku":  "100298-0",
            "brand_id":  "12",
            "supplier_id":  "1",
            "name":  "Ai Di Cha  Ardisidae Japonicae Caulis et Folium  100 g",
            "act_weight":  "100",
            "reorder_label":  "200",
            "long_description":  "",
            "unit_price":  "4.69",
            "cost_price":  "4.69",
            "taxable":  "1",
            "is_active":  "0",
            "default_category": "127",
            "categories":  [ { "id": "127", "Name": "Single Chinese Granules" } ],
            "images":  [ { "id": "922", "image": "yunnanbaiyaocapsule7188.jpg", "is_main": "1" } ],
            "stock":  [{"qty":  "200.00", "lot_no":  "555","supplier_name": "", "supplier_id":  "0" },{"qty":  "1415.00", "lot_no":  "*()%$#!","supplier_name": "", "supplier_id":  "0" },{"qty":  "5.00", "lot_no":  "234234","supplier_name": "", "supplier_id":  "1" }],
            "default_category_name":  "Default category",
            "brand_name":  "Brand data",
            "supplier_name":  "SUPPLIER 1",
        },

Reduce Inventory Detail

To call this API, it need "practice_token" to be passed in API to get results.

This will reduce inventory of product id related to passed practice token.

Attributes

product_id
numeric
This will be the product Id.
lot_no
alphanumeric
lot number is from which lot number of product you want ot reduce inventory for
amount
numeric
Please send amount to reduce

API Resource URL

https://api.dispensarytree.com/response/reduce-inventory

Response Example


$headers  = array(
     "Content-Type: application/json",
     "Authorization: Bearer " . trim('ACCESS_TOKEN')
 );

$url='https://api.dispensarytree.com/response/reduce-inventory';
    
$data= array(
        "dispensary_token" => 'DISPENSARY_TOKEN',
        "product_id" => 3555,
        "lot_no" => 123654,
        "amount" => 1,
    );
    



$curl= curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$resp = curl_exec($curl);
$jsonRes = json_decode($resp);
curl_close($curl);

Get All Product Inventory Detail

To call this API, it need "dispensary_token" to be passed in API to get results.

This will give details of inventory of product id related to passed dispensary_token.

Attributes

product_id
numeric
This will be the product Id.
amount
numeric
Please send amount to reduce

API Resource URL

https://api.dispensarytree.com/response/get-products-inventory?dispensary_token=[DISPENSARY_TOKEN]

Response Example

 {
            "available_qty":  "25544",
            "product_id":  "16491",
        },