API Reference (V1)
Introduction
Welcome to the Hola Doctor Farmacia API Reference. Here you will find details about how to use the Hola Doctor Farmacia API and the endpoints it provides.
Authentication
API calls should be made to the following base URL:
https://demo.rxspark.com/api/v1
Authenticate by including your API key in the headers of each request within a custom header named Api-Key
. See the following example using curl:
curl -X POST --header "Api-Key: secret_key"...
Replace secret_key
with your Hola Doctor Farmacia API key.
Drug Prices
GET /prices
Find availability and prices for a given drug at pharmacy locations. Search by drug name (or optionally by NDC11 or GCN Sequence Number (GSN) to specify different drug strengths and/or forms). Narrow results down by zip code or pharmacy identifier (NPI) for individual pharmacies.
Parameters
drug_name |
string |
(Required if $gsn, $ndc11 not present) Name of the drug to search for. |
gsn |
string |
(Required if $drug_name, $ndc11 not present) GCN Sequence Number. Use as a more accurate way to search for a drug form / strength. |
ndc11 |
string |
(Required if $gsn, $drug_name not present) NDC11. Use as a more accurate way to search for a drug form / strength. |
npi |
string |
(Optional) NPI pharmacy identifier - use to narrow results down to a single pharmacy. Overrides zip code if present in request. |
brand_type |
string |
(Optional / Default "A") Search for brand name or generic version of drug. Possible values: B = Brand; G = Generic; A = Brand or Generic. |
qty |
int |
(Optional / Default null) Requested quantity of drug. |
zip |
string |
Zip code for the search. Note: Either zip code or lat/long is required. If both are provided, lat/long will take precedence. |
latitude |
string |
(Optional) Latitude for the search. |
longitude |
string |
(Optional) Longitude for the search. |
num_results |
string |
(Optional / Default: 10) Number of pharmacy results to return. |
info_language |
string |
(Optional / Default: 'en') 2 character language code to specify an alternative language for the returned drug information. Currently only Spanish 'es' is supported. |
pretty |
boolean |
(Optional / Default: false) Pretty print results (helpful for debugging / testing). |
Example API Call:
curl -X GET --header "api_key: 5***********************b4" "https://www.rxspark.com/api/v1/prices?drug_name=lipitor&zip=93021&brand_type=G&num_results=1&pretty=1"
Example Response:
{
"status": "success",
"message": {
"drugInfo": [
{
"brandName": "LIPITOR",
"description": "USES: Atorvastatin is used along with a proper diet to help lower \"bad\" cholesterol and fats (such as LDL, triglycerides) and raise \"good\" cholesterol (HDL) in the blood. It belongs to a group of drugs known as \"statins.\" It works by reducing the amount of cholesterol made by the liver. Lowering \"bad\" cholesterol and triglycerides and raising \"good\" cholesterol decreases the risk of heart disease and helps prevent strokes and heart attacks. In addition to eating a proper diet (such as a low-cholesterol\/low-fat diet), other lifestyle changes that may help this medication work better include exercising, losing weight if overweight, and stopping smoking. Consult your doctor for more details.",
"genericName": "ATORVASTATIN"
}
],
"drugs": [
{
"pharmacy": {
"name": "Cvs Pharmacy",
"streetAddress": "155 W LOS ANGELES AVE",
"city": "MOORPARK",
"state": "CA",
"zipCode": "93021-0000",
"latitude": 34.278986,
"longitude": -118.883911,
"hoursOfOperation": "11018208213082140821508216082170918",
"phone": "8055300996",
"npi": 1366485195,
"distance": 1.06
},
"drug": {
"ndcCode": 60505258009,
"brandGenericIndicator": "G",
"gsn": 29969,
"drugRanking": 1,
"quantity": 30,
"quantityRanking": 1,
"labelName": "ATORVASTATIN 40 MG TABLET"
},
"pricing": {
"price": "72.69",
"discount": 65.3
}
}
],
"forms": [
{
"form": "TABLET",
"gsn": 29969,
"isSelected": true,
"ranking": 1
}
],
"names": [
{
"drugName": "ATORVASTATIN",
"brandGenericIndicator": "G",
"isSelected": true
},
{
"drugName": "LIPITOR",
"brandGenericIndicator": "B",
"isSelected": false
}
],
"quantities": [
{
"quantity": 30,
"quantityUom": "TABLET",
"gsn": 29969,
"isSelected": true,
"ranking": 1
},
{
"quantity": 90,
"quantityUom": "TABLET",
"gsn": 29969,
"isSelected": false,
"ranking": 2
},
{
"quantity": 100,
"quantityUom": "TABLET",
"gsn": 29969,
"isSelected": false,
"ranking": 3
},
{
"quantity": 60,
"quantityUom": "TABLET",
"gsn": 29969,
"isSelected": false,
"ranking": 4
},
{
"quantity": 50,
"quantityUom": "TABLET",
"gsn": 29969,
"isSelected": false,
"ranking": 5
}
],
"strengths": [
{
"strength": "40 mg",
"gsn": 29969,
"isSelected": true,
"ranking": 1
},
{
"strength": "20 mg",
"gsn": 29968,
"isSelected": false,
"ranking": 2
},
{
"strength": "10 mg",
"gsn": 29967,
"isSelected": false,
"ranking": 3
},
{
"strength": "80 mg",
"gsn": 45772,
"isSelected": false,
"ranking": 4
}
],
"drugInfoDetails": {
"brandName": "LIPITOR",
"genericName": "ATORVASTATIN CALCIUM",
"drugDescription": "USES: Atorvastatin is used along with a proper diet to help lower \"bad\" cholesterol and fats (such as LDL, triglycerides) and raise \"good\" cholesterol (HDL) in the blood. It belongs to a group of drugs known as \"statins.\" It works by reducing the amount of cholesterol made by the liver. Lowering \"bad\" cholesterol and triglycerides and raising \"good\" cholesterol decreases the risk of heart disease and helps prevent strokes and heart attacks. In addition to eating a proper diet (such as a low-cholesterol\/low-fat diet), other lifestyle changes that may help this medication work better include exercising, losing weight if overweight, and stopping smoking. Consult your doctor for more details.",
"administerInstructions": "HOW TO USE: Read the Patient Information Leaflet if available from your pharmacist before you start taking atorvastatin and each time you get a refill. If you have any questions, ask your doctor or pharmacist. Take this medication by mouth with or without food as directed by your doctor, usually once daily. The dosage is based on your medical condition, response to treatment, age, and other medications you may be taking. Be sure to tell your doctor and pharmacist about all the products you use (including prescription drugs, nonprescription drugs, and herbal products). Avoid eating grapefruit or drinking grapefruit juice while using this medication unless your doctor instructs you otherwise. Grapefruit can increase the amount of this medication in your bloodstream. Consult your doctor or pharmacist for more details. If you also take certain other drugs to lower your cholesterol (bile acid-binding resins such as cholestyramine or colestipol), take atorvastatin at least 1 hour before or at least 4 hours after taking these medications. These products can react with atorvastatin, preventing its full absorption. Take this medication regularly in order to get the most benefit from it. Remember to take it at the same time each day. It is important to continue taking this medication even if you feel well. Most people with high cholesterol or triglycerides do not feel sick. It is very important to continue to follow your doctor's advice about diet and exercise. It may take up to 4 weeks before you get the full benefit of this drug.",
"contraindications": "PRECAUTIONS: Before taking atorvastatin, tell your doctor or pharmacist if you are allergic to it; or if you have any other allergies. This product may contain inactive ingredients, which can cause allergic reactions or other problems. Talk to your pharmacist for more details. Before using this medication, tell your doctor or pharmacist your medical history, especially of: liver disease, kidney disease, alcohol use. Before having surgery, tell your doctor or dentist about all the products you use (including prescription drugs, nonprescription drugs, and herbal products). Limit alcoholic beverages. Daily use of alcohol may increase your risk for liver problems, especially when combined with atorvastatin. Ask your doctor or pharmacist for more information. Older adults may be more sensitive to the side effects of this drug, especially muscle problems. This medication must not be used during pregnancy. Atorvastatin may harm an unborn baby. Therefore, it is important to prevent pregnancy while taking this medication. Consult your doctor for more details and to discuss the use of reliable forms of birth control (such as condoms, birth control pills) while taking this medication. If you become pregnant or think you may be pregnant, tell your doctor right away. It is unknown if this medication passes into breast milk. Because of the possible risk to the infant, breast-feeding while using this drug is not recommended. Consult your doctor before breast-feeding.",
"disclaimer": "IMPORTANT: HOW TO USE THIS INFORMATION: This is a summary and does NOT have all possible information about this product. This information does not assure that this product is safe, effective, or appropriate for you. This information is not individual medical advice and does not substitute for the advice of your health care professional. Always ask your health care professional for complete information about this product and your specific health needs.",
"interactions": "DRUG INTERACTIONS: See also How to Use section. Drug interactions may change how your medications work or increase your risk for serious side effects. This document does not contain all possible drug interactions. Keep a list of all the products you use (including prescription\/nonprescription drugs and herbal products) and share it with your doctor and pharmacist. Do not start, stop, or change the dosage of any medicines without your doctor's approval. Some products that may interact with this drug include: gemfibrozil, telaprevir, ritonavir. Other medications can affect the removal of atorvastatin from your body, which may affect how atorvastatin works. Examples include colchicine, telithromycin, certain azole antifungals (such as itraconazole, ketoconazole, posaconazole), among others. Do not take any red yeast rice products while you are taking atorvastatin because some red yeast rice products may also contain a statin called lovastatin. Taking atorvastatin and red yeast rice products together can increase your risk of serious muscle and liver problems.",
"missedDoseInfo": "MISSED DOSE: If you miss a dose, take it as soon as you remember. If it is near the time of the next dose, skip the missed dose and resume your usual dosing schedule. Do not double the dose to catch up.",
"monitorReactions": "",
"sideEffects": "SIDE EFFECTS: Remember that your doctor has prescribed this medication because he or she has judged that the benefit to you is greater than the risk of side effects. Many people using this medication do not have serious side effects. A very small number of people taking atorvastatin may have mild memory problems or confusion. If these rare effects occur, talk to your doctor. Rarely, statins may cause or worsen diabetes. Talk to your doctor about the benefits and risks. This drug may rarely cause muscle problems (which can rarely lead to very serious conditions called rhabdomyolysis and autoimmune myopathy). Tell your doctor right away if you develop any of these symptoms during treatment and if these symptoms persist after your doctor stops this drug: muscle pain\/tenderness\/weakness (especially with fever or unusual tiredness), signs of kidney problems (such as change in the amount of urine). This medication may rarely cause liver problems. If you notice any of the following rare but serious side effects, tell your doctor right away: yellowing eyes\/skin, dark urine, severe stomach\/abdominal pain, persistent nausea\/vomiting. A very serious allergic reaction to this drug is rare. However, seek immediate medical attention if you notice any symptoms of a serious allergic reaction, including: rash, itching\/swelling (especially of the face\/tongue\/throat), severe dizziness, trouble breathing. This is not a complete list of possible side effects. If you notice other effects not listed above, contact your doctor or pharmacist. In the US - Call your doctor for medical advice about side effects. You may report side effects to FDA at 1-800-FDA-1088 or at www.fda.gov\/medwatch. In Canada - Call your doctor for medical advice about side effects. You may report side effects to Health Canada at 1-866-234-2345.",
"storageInfo": "STORAGE: Store at room temperature between 68-77 degrees F (20-25 degrees C) away from light and moisture. Do not store in the bathroom. Keep all medicines away from children and pets. Do not flush medications down the toilet or pour them into a drain unless instructed to do so. Properly discard this product when it is expired or no longer needed. Consult your pharmacist or local waste disposal company for more details about how to safely discard your product."
},
"meta": {
"brandName": "Lipitor",
"genericName": "ATORVASTATIN",
"drugDescription": "USES: Atorvastatin is used along with a proper diet to help lower \"bad\" cholesterol and fats (such as LDL, triglycerides) and raise \"good\" cholesterol (HDL) in the blood. It belongs to a group of drugs known as \"statins.\" It works by reducing the amount of cholesterol made by the liver. Lowering \"bad\" cholesterol and triglycerides and raising \"good\" cholesterol decreases the risk of heart disease and helps prevent strokes and heart attacks. In addition to eating a proper diet (such as a low-cholesterol\/low-fat diet), other lifestyle changes that may help this medication work better include exercising, losing weight if overweight, and stopping smoking. Consult your doctor for more details.",
"gsn": 29969,
"ndc": "605052580",
"image": [
"https:\/\/dev.rx.deals\/drug-image\/17223\/DrugItem\/full"
]
}
}
}
Show/Hide Examples
Create a User
POST /users
Register a user to the site, and return a link to the user's savings card download URL.
Parameters
first_name |
string |
(Optional) First name of the user. |
last_name |
string |
(Optional) Last name of the user. |
email |
string |
Email address of the user. |
password |
string |
(Optional) Password of the user. If password is not provided we will generate a temporary password and the user will be forced to change it upon their first login. |
gender |
string |
(Optional) Gender of the user. |
address_1 |
string |
(Optional) Address of the user. |
address_2 |
string |
(Optional) Additional address information of the user (ex. Suite #, Apt. #, etc.). |
city |
string |
(Optional) City of the user. |
zip |
string |
(Optional) Zip code of the user. |
phone |
string |
(Optional) Main phone number of the user. |
mobile_phone |
string |
(Optional) Mobile phone number of the user. |
insurance |
string |
(Optional) Name of user's insurance company. |
facebook_id |
string |
(Optional) Facebook ID of the user. |
aff_ref |
string |
(Optional) Referral ID of the referring user. If aff_ref is not provided, we will not be able to attribute commissions to your partner account. |
ref_member_id |
string |
(Optional) Member ID (ex. 'RX25') of the referring user, or Ignitor Referral Code (ex. 'IG10'). Overrides 'aff_ref' parameter. |
sid |
string |
(Optional) Custom sub id data field to facilitate tracking. |
drugs |
array |
(Optional) Drugs user is taking; keys: 'name', 'form', 'dosage', 'quantity'. See example #2. |
suppress_welcome |
boolean |
(Optional / Default: false) Suppress the new user welcome email. Cannot be suppressed if password not included in request. |
pretty |
boolean |
(Optional / Default: false) Pretty print results (helpful for debugging / testing). |
Example API Call:
curl -X POST --header "api_key: p***********************h4" --data "email=user@aol.com&password=hunter2001&phone=8882102807&pretty=1" https://www.rxspark.com/api/v1/users
Example Response:
{
"status": "success",
"user": {
"user_id": 130,
"card_download_url": "https:\/\/www.rxspark.com\/download-card\/130"
}
}
Pass in Drugs Taken by User
curl -X POST --header "api_key: p***********************h4" --data "email=user@aol.com&password=hunter2001&phone=8882102807&drugs[0][name]=Metformin HCL&drugs[0][form]=Tablet&drugs[0][dosage]=1000mg&drugs[0][quantity]=30" https://www.rxspark.com/api/v2/users
Example Response:
{
"status": "success",
"user": {
"user_id": 131,
"card_download_url": "https:\/\/www.rxspark.com\/download-card\/131"
}
}
Show/Hide Examples
Update User
POST /users/{id}
Update a user
Parameters
hashedEmail |
string |
MD5 hash of user's email address (ex. in PHP md5(strtolower($email)) ). |
first_name |
string |
(Optional) First name of the user. |
last_name |
string |
(Optional) Last name of the user. |
gender |
string |
(Optional) Gender of the user. |
address_1 |
string |
(Optional) Address of the user. |
address_2 |
string |
(Optional) Additional address information of the user (ex. Suite #, Apt. #, etc.). |
city |
string |
(Optional) City of the user. |
zip |
string |
(Optional) Zip code of the user. |
phone |
string |
(Optional) Main phone number of the user. |
mobile_phone |
string |
(Optional) Mobile phone number of the user. |
pretty |
boolean |
(Optional / Default: false) Pretty print results (helpful for debugging / testing). |
Drug Autocomplete
GET /autocomplete
Autocomplete drug names. Provide a partial drug name and get back a list of potential matches.
Parameters
prefix |
string |
prefix text (partial or complete name of the drug to search for); minimum 3 characters. |
pretty |
boolean |
(Optional / Default: false) Pretty print results (helpful for debugging / testing). |
Example API Call:
curl --header "api_key: p***********************h4" "https://www.rxspark.com/api/v1/autocomplete?pretty=1&prefix=dilaud"
Example Response:
{
"status": "success",
"message": [
"DILAUDID",
"DILAUDID (PF)",
"DILAUDID COUGH",
"DILAUDID-5",
"DILAUDID-HP (PF)"
]
}
Show/Hide Examples
Apple Wallet Card
GET /wallet-card
Download an apple wallet version of the discount card
Parameters
user_id |
integer |
(Optional) ID of the user. |
member_id |
string |
(Optional) Member ID of the user. If a valid user_id is supplied, the user's Member ID will be used. If neither user_id nor member_id is provided, a Member ID will be generated for the user's card. |
aff_ref |
string |
(Optional) Partner's referral id (Also known as 'aff_id') to allow for white-labeling (if enabled for partner's account) |
Apple Wallet Voucher
GET /wallet-voucher
Download an apple wallet version of a discount voucher
Parameters
code |
string |
(Required) Voucher code (found in drug price endpoint response data). |
member_id |
string |
(Optional) Member ID of the user. If member_id is not supplied, a Member ID will be generated for the user's voucher. |
aff_ref |
string |
(Optional) Partner's referral id (Also known as 'aff_id') to allow for white-labeling (if enabled for partner's account). |
Get Drug Info
GET /drug-info
Get information about a drug including description, side effects, dosage information and contraindications.
Parameters
ndc11 |
string |
The NDC of the drug for which the drug information is desired. |
pretty |
boolean |
(Optional / Default: false) Pretty print results (helpful for debugging / testing). |
Example API Call:
curl -X GET --header "api_key: i***********************j9" "https://www.rxspark.com/api/v1/drug-info?gsn=045771&pretty=1"
Example Response:
{
"status": "success",
"message": {
"brandName": "LIPITOR",
"genericName": "ATORVASTATIN CALCIUM",
"drugDescription": "USES: Atorvastatin is used along with a proper diet to help lower \"bad\" cholesterol and fats (such as LDL, triglycerides) and raise \"good\" cholesterol (HDL) in the blood. It belongs to a group of drugs known as \"statins.\" It works by reducing the amount of cholesterol made by the liver. Lowering \"bad\" cholesterol and triglycerides and raising \"good\" cholesterol decreases the risk of heart disease and helps prevent strokes and heart attacks. In addition to eating a proper diet (such as a low-cholesterol\/low-fat diet), other lifestyle changes that may help this medication work better include exercising, losing weight if overweight, and stopping smoking. Consult your doctor for more details.",
"administerInstructions": "HOW TO USE: Read the Patient Information Leaflet if available from your pharmacist before you start taking atorvastatin and each time you get a refill. If you have any questions, ask your doctor or pharmacist. Take this medication by mouth with or without food as directed by your doctor, usually once daily. The dosage is based on your medical condition, response to treatment, age, and other medications you may be taking. Be sure to tell your doctor and pharmacist about all the products you use (including prescription drugs, nonprescription drugs, and herbal products). Avoid eating grapefruit or drinking grapefruit juice while using this medication unless your doctor instructs you otherwise. Grapefruit can increase the amount of this medication in your bloodstream. Consult your doctor or pharmacist for more details. If you also take certain other drugs to lower your cholesterol (bile acid-binding resins such as cholestyramine or colestipol), take atorvastatin at least 1 hour before or at least 4 hours after taking these medications. These products can react with atorvastatin, preventing its full absorption. Take this medication regularly in order to get the most benefit from it. Remember to take it at the same time each day. It is important to continue taking this medication even if you feel well. Most people with high cholesterol or triglycerides do not feel sick. It is very important to continue to follow your doctor's advice about diet and exercise. It may take up to 4 weeks before you get the full benefit of this drug.",
"contraindications": "PRECAUTIONS: Before taking atorvastatin, tell your doctor or pharmacist if you are allergic to it; or if you have any other allergies. This product may contain inactive ingredients, which can cause allergic reactions or other problems. Talk to your pharmacist for more details. Before using this medication, tell your doctor or pharmacist your medical history, especially of: liver disease, kidney disease, alcohol use. Before having surgery, tell your doctor or dentist about all the products you use (including prescription drugs, nonprescription drugs, and herbal products). Limit alcoholic beverages. Daily use of alcohol may increase your risk for liver problems, especially when combined with atorvastatin. Ask your doctor or pharmacist for more information. Older adults may be more sensitive to the side effects of this drug, especially muscle problems. This medication must not be used during pregnancy. Atorvastatin may harm an unborn baby. Therefore, it is important to prevent pregnancy while taking this medication. Consult your doctor for more details and to discuss the use of reliable forms of birth control (such as condoms, birth control pills) while taking this medication. If you become pregnant or think you may be pregnant, tell your doctor right away. It is unknown if this medication passes into breast milk. Because of the possible risk to the infant, breast-feeding while using this drug is not recommended. Consult your doctor before breast-feeding.",
"disclaimer": "IMPORTANT: HOW TO USE THIS INFORMATION: This is a summary and does NOT have all possible information about this product. This information does not assure that this product is safe, effective, or appropriate for you. This information is not individual medical advice and does not substitute for the advice of your health care professional. Always ask your health care professional for complete information about this product and your specific health needs.",
"interactions": "DRUG INTERACTIONS: See also How to Use section. Drug interactions may change how your medications work or increase your risk for serious side effects. This document does not contain all possible drug interactions. Keep a list of all the products you use (including prescription\/nonprescription drugs and herbal products) and share it with your doctor and pharmacist. Do not start, stop, or change the dosage of any medicines without your doctor's approval. Some products that may interact with this drug include: gemfibrozil, telaprevir, ritonavir. Other medications can affect the removal of atorvastatin from your body, which may affect how atorvastatin works. Examples include colchicine, telithromycin, certain azole antifungals (such as itraconazole, ketoconazole, posaconazole), among others. Do not take any red yeast rice products while you are taking atorvastatin because some red yeast rice products may also contain a statin called lovastatin. Taking atorvastatin and red yeast rice products together can increase your risk of serious muscle and liver problems.",
"missedDoseInfo": "MISSED DOSE: If you miss a dose, take it as soon as you remember. If it is near the time of the next dose, skip the missed dose and resume your usual dosing schedule. Do not double the dose to catch up.",
"monitorReactions": "",
"sideEffects": "SIDE EFFECTS: Remember that your doctor has prescribed this medication because he or she has judged that the benefit to you is greater than the risk of side effects. Many people using this medication do not have serious side effects. A very small number of people taking atorvastatin may have mild memory problems or confusion. If these rare effects occur, talk to your doctor. Rarely, statins may cause or worsen diabetes. Talk to your doctor about the benefits and risks. This drug may rarely cause muscle problems (which can rarely lead to very serious conditions called rhabdomyolysis and autoimmune myopathy). Tell your doctor right away if you develop any of these symptoms during treatment and if these symptoms persist after your doctor stops this drug: muscle pain\/tenderness\/weakness (especially with fever or unusual tiredness), signs of kidney problems (such as change in the amount of urine). This medication may rarely cause liver problems. If you notice any of the following rare but serious side effects, tell your doctor right away: yellowing eyes\/skin, dark urine, severe stomach\/abdominal pain, persistent nausea\/vomiting. A very serious allergic reaction to this drug is rare. However, seek immediate medical attention if you notice any symptoms of a serious allergic reaction, including: rash, itching\/swelling (especially of the face\/tongue\/throat), severe dizziness, trouble breathing. This is not a complete list of possible side effects. If you notice other effects not listed above, contact your doctor or pharmacist. In the US - Call your doctor for medical advice about side effects. You may report side effects to FDA at 1-800-FDA-1088 or at www.fda.gov\/medwatch. In Canada - Call your doctor for medical advice about side effects. You may report side effects to Health Canada at 1-866-234-2345.",
"storageInfo": "STORAGE: Store at room temperature between 68-77 degrees F (20-25 degrees C) away from light and moisture. Do not store in the bathroom. Keep all medicines away from children and pets. Do not flush medications down the toilet or pour them into a drain unless instructed to do so. Properly discard this product when it is expired or no longer needed. Consult your pharmacist or local waste disposal company for more details about how to safely discard your product."
}
}
Show/Hide Examples
Convert Drug Codes
GET /drug-codes
Find a drug by various identifiers for use subsquently in the price search endpoint. Only one code may be specified.
Parameters
ndc9 |
string |
The National Drug Code (NDC) is a unique product identifier used in the United States for drugs intended for human use. |
ndc10 |
string |
The National Drug Code (NDC) is a unique product identifier used in the United States for drugs intended for human use. |
ndc11 |
string |
The National Drug Code (NDC) is a unique product identifier used in the United States for drugs intended for human use. |
gtin12 |
string |
The GTIN-12 is the only GTIN that can be used in UPC-A barcodes |
gtin14 |
string |
A uniform grouping of trade items is a standard and stable grouping of identical trade items |
nhric |
string |
The National Health Related Items Code (NHRIC) is a system for identification and numbering of marketed device packages that is compatible with other numbering systems such as the National Drug Code (NDC) or Universal Product Code (UPC). |
nspck |
string |
|
pin |
string |
|
upcb |
string |
|
pretty |
boolean |
(Optional / Default: false) Pretty print results (helpful for debugging / testing). |
Example API Call:
curl -X GET --header "api_key: i***********************j9" "https://www.rxspark.com/api/v1/drug-codes?ndc9=430630373&pretty=1"
Example Response:
{
"status":"success",
"message": {
"name":"Lipitor",
"brandIndicator":"B"
}
}
Show/Hide Examples
Send a Voucher
POST /send-voucher
Send a pharmacy voucher to a member via email or SMS. If a member_id
is provided, email
or phone
will be pulled from the member's record. If no member_id
is provided, a phone number (for sms) or email address (for email) must be provided and a generic member_id
will be issued.
Parameters
couponCode |
string |
(Required) Coupon code of voucher to send |
member_id |
string |
(Optional) Member ID of member receiving voucher - required if email and phone not provided |
type |
string |
(Optional) Type of voucher to send (sms/email), defaults to email |
phone |
integer |
(Optional) Phone number for SMS if member_id omitted |
email |
string |
(Optional) Email address if member_id omitted |
User Drugs
POST /user-drugs
Store list of drugs taken by user. This will overwrite any existing drugs; so send the complete list of drugs each time this endpoint is used.
Parameters
member_id |
string |
Member ID of user (required if email not present) |
email |
string |
Email of user (required if member_id not present) |
drugs |
array |
Drugs user is taking; keys: 'name', 'form', 'dosage', 'quantity'. |
Get Condition Info
GET /conditions
Get information about a condition.
Parameters
name |
string |
(At least one of "name", "ICD9", "ICD10", "SNOMEDCT" required) The condition name; if no exact match is found, a list of possible matches will be returned. |
icd9 |
string |
(At least one of "name", "ICD9", "ICD10", "SNOMEDCT" required) The ICD9 condition identifier. |
icd10 |
string |
(At least one of "name", "ICD9", "ICD10", "SNOMEDCT" required) The ICD10 condition identifier. |
snomedCt |
string |
(At least one of "name", "ICD9", "ICD10", "SNOMEDCT" required) The SNOMEDCT condition identifier. |
relatedDrugs |
boolean |
(Optional / Default: false) Include up to 50 drugs related to the condition. |
allConditionNames |
boolean |
(Optional / Default: false) Retrieve a list of all valid condition names (does not support '$relatedDrugs' option). |
pretty |
boolean |
(Optional / Default: false) Pretty print results (helpful for debugging / testing). |
Example API Call:
curl -X GET --header "api_key: i***********************j9" "https://www.rxspark.com/api/v1/condition?icd9=998.11&pretty=1&relatedDrugs=1"
Example Response:
{
"status": "success",
"message": {
"condition": {
"name": "hemorrhage",
"description": ""
},
"icd9Codes": {
"icd9": "998.11",
"description": "Hemorrhage complicating a procedure [998.11]"
},
"icd10Codes": [
{
"icd10": "D78.01",
"description": "[D78.01] Intraoperative hemorrhage and hematoma of spleen complicating a procedure on the spleen"
},
{
"icd10": "D78.02",
"description": "[D78.02] Intraoperative hemorrhage and hematoma of spleen complicating other procedure"
},
{
"icd10": "D78.21",
"description": "[D78.21] Postprocedural hemorrhage and hematoma of spleen following a procedure on the spleen"
},
...
{
"snomedCt": 95540002,
"description": "Hemorrhage of colon"
},
{
"snomedCt": 95621004,
"description": "Respiratory tract hemorrhage of the newborn"
}
],
"drugs": [
"Aminocaproic Acid"
]
}
}
Example API Call using the 'allConditionNames' Option to Retrieve Valid Condition Names:
curl -X GET --header "api_key: i***********************j9" "https://www.rxspark.com/api/v1/condition?allConditionNames=1&pretty=1"
Example Response:
{
"status": "success",
"message": {
"total": 3282,
"per_page": 1000,
"current_page": 1,
"last_page": 4,
"next_page_url": "https:\/\/www.rxspark.com\/api\/v1\/conditions?allConditionNames=1&pretty=1&page=2",
"prev_page_url": null,
"from": 1,
"to": 1000,
"data": [
{
"name": "Adenoiditis"
},
{
"name": "bruxism (teeth grinding)"
},
...
]
}
}
Show/Hide Examples
Pharmacies
GET /pharmacies
Search for pharmacies by npi
, phone
, or by location (various combinations of street_1
, street_2
, city
, state
, and zip
).
Parameters
npi |
string |
NPI of the pharmacy. |
phone |
string |
Phone of the pharmacy. |
street_1 |
string |
|
street_2 |
string |
|
city |
string |
|
state |
string |
|
zip |
string |
|
pretty |
boolean |
(Optional / Default: false) Pretty print results (helpful for debugging / testing). |
Blog
GET /blog
Get blog posts
Parameters
pretty |
boolean |
(Optional / Default: false) Pretty print results (helpful for debugging / testing). |
Blog Post
GET /blog/{id}
Retrieve a blog post
Parameters
id |
integer |
ID of the desired blog post. |
pretty |
boolean |
(Optional / Default: false) Pretty print results (helpful for debugging / testing). |
Privacy Policy
GET /privacy
Program privacy policy
Parameters
pretty |
boolean |
(Optional / Default: false) Pretty print results (helpful for debugging / testing). |
Terms and Conditions
GET /terms
Program terms and conditions
Parameters
pretty |
boolean |
(Optional / Default: false) Pretty print results (helpful for debugging / testing). |
Disclaimer
GET /disclaimer
Program disclaimer
Parameters
pretty |
boolean |
(Optional / Default: false) Pretty print results (helpful for debugging / testing). |
Multiauth
GET /multiauth
Get a token to log a user in. You can pass this token into any URL on the site to auto-log a user in. To pass in the token, you can append ?multiauth=XXXXXXX to any URL. Tokens are valid for 5 minutes, then they expire.
Parameters
user_id |
integer |
(Required) ID of the user. |
Example API Call:
curl -X GET --header "api_key: i***********************j9" "https://www.rxspark.com/api/v1/multiauth?user_id=34645634"
Example Response:
{
"status": "success",
"token": "YTozOntzOjI6ImlkIjtpOjI7czo1OiJlbWFpbCI7czoxNjoiYnN3dWZ0QGdtYWlsLmNvbSI7czo5OiJ0aW1lc3RhbXAiO2k6MTUxMTgxMDM0OTt9"
}
Show/Hide Examples
Delete User
GET /users/delete/{user_id}
Delete user
Parameters
user_id |
integer |
ID of the user being requested. |
pretty |
boolean |
(Optional / Default: false) Pretty print results (helpful for debugging / testing). |
Forgot Password
POST /forgot-password
Trigger a password reset email to be sent to a user.
Parameters
email |
string |
(Required) email of the user. |
Partners - Shop Status
POST /partners/shop-status
Enable / disable your RxSpark Partner Shop
Parameters
enable |
boolean |
(Required) 1 to enable the shop, 0 to disable |
toggle |
boolean |
(Optional / Default: false) Toggle the current setting (will override $enable) |
Example API Call:
curl -X POST --header "api_key: p***********************h4" --data "enable=0" https://www.rxspark.com/api/v1/partners/shop-status
Example Response:
{"status":"success","message":"Partner shop disabled"}
Show/Hide Examples
Partners - Shop Name
GET /partners/shop-name
Get the name of your RxSpark Partner Shop
Example API Call:
curl -X GET --header "api_key: p***********************h4" https://www.rxspark.com/api/v1/partners/shop-name
Example Response:
{"status":"success","message":"Test Shop"}
Show/Hide Examples
Partners - Update Shop Name
POST /partners/shop-name
Update the name of your RxSpark Partner Shop
Parameters
Example API Call:
curl -X POST --header "api_key: p***********************h4" --data "name=Test" https://www.rxspark.com/api/v1/partners/shop-name
Example Response:
{"status":"success","message":"Partner shop name updated."}
Show/Hide Examples
Partners - Product Status
POST /partners/product-status
Enable / disable a product in your RxSpark Partner Shop
Parameters
product_id |
int |
(Required) The product id for the product to be enabled/disabled |
enable |
boolean |
(Required) 1 to enable the shop, 0 to disable |
toggle |
boolean |
(Optional / Default: false) Toggle the current setting (will override $enable) |
Example API Call:
curl -X POST --header "api_key: p***********************h4" --data "product_id=14&enable=1&toggle=1" https://www.rxspark.com/api/v1/partners/product-status
Example Response:
{"status":"success","message":"Product disabled"}
Show/Hide Examples
Partners - Product Categories
GET /partners/product-categories
List product categories
Parameters
pretty |
boolean |
(Optional / Default: false) Pretty print results (helpful for debugging / testing). |
Partners - Products
GET /partners/products
List the products in your RxSpark Partner Shop
Parameters
title |
string |
(Optional / Default: false) Filter products by title |
category_id |
array |
(Optional / Default: false) Filter products by product category based on provided of category_id values. |
condition_id |
array |
(Optional / Default: false) Filter products by condition based on provided of ICD10 codes. |
drug_id |
array |
(Optional / Default: false) Filter products by drug based on provided of NDC9 codes |
promoted |
boolean |
(Optional / Default: false) Include promoted products (products from other Advertisers for which you have enabled promotion) |
supplementary_images |
boolean |
(Optional / Default: false) Include supplementary product images |
pretty |
boolean |
(Optional / Default: false) Pretty print results (helpful for debugging / testing). |
Example API Call:
curl --header "api_key: p***********************h4" https://www.rxspark.com/api/v1/partners/products
Example Response:
{
"status": "success",
"message": [
{
"id": 1,
"partner_id": 9,
"title": "Diabetes Watch",
"slug": "diabetes-watch",
"offsite_product": 0,
"product_url": null,
"category_id": 2,
"description": "The best diabetes watch in America, I guarantee it. Please buy one or more today.",
"featured_image": "25_5a72390b5bd8b_b1ab9f3f2519709cc6c96e6f1a3766ee.png",
"price": "200.00",
"compare_at_price": "179.99",
"enabled": 1,
"created_at": "2018-01-12 08:18:52",
"updated_at": "2018-05-18 00:32:47"
},
{
"id": 4,
"partner_id": 9,
"title": "Diabetes Socks",
"slug": "diabetes-socks",
"offsite_product": 1,
"product_url": "https:\/\/google.com\/socks",
"category_id": 10,
"description": "The best diabetes socks. Handwoven in the United States.",
"featured_image": "25_5a7238240b01c_4f5e2f4f584978522153744c47e92cbd.jpeg",
"price": "10.00",
"compare_at_price": "11.00",
"enabled": 1,
"created_at": "2018-01-24 18:07:42",
"updated_at": "2018-05-21 15:23:29"
}
]
}
Example API Call Filtering by NDC:
curl --header "api_key: p***********************h4" "https://www.rxspark.com/api/v1/partners/products?pretty=1&drug_id%5B0%5D=686450539"
Example Response:
{
"status": "success",
"message": [
{
"id": 6,
"partner_id": 9,
"title": "Blood Pressure Monitor and Insulin Reader",
"slug": "blood-pressure-monitor",
"offsite_product": 0,
"product_url": null,
"category_id": 2,
"description": "A mid-range blood pressure monitor / insulin reader made in India.",
"featured_image": "",
"price": "98.50",
"compare_at_price": "132.99",
"enabled": 1,
"created_at": "2018-03-16 16:31:01",
"updated_at": "2018-10-23 00:29:05",
"deleted_at": null
}
]
}
Show/Hide Examples
Partners - Create Product from Shopify
POST /partners/products/from-shopify
Create a product from Shopify product JSON
Partners - Product
GET /partners/products/{product_id}
Get the details of a product in your RxSpark Partner Shop
Parameters
pretty |
boolean |
(Optional / Default: false) Pretty print results (helpful for debugging / testing). |
Example API Call:
curl --header "api_key: p***********************h4" --header "Accept: application/json" https://www.rxspark.com/api/v1/partners/products/19?pretty=1
Example Response:
{
"status": "success",
"message": {
"id": 19,
"title": "Test Item",
"slug": "test-item",
"offsite_product": 0,
"product_url": null,
"description": "Test",
"featured_image": "",
"price": "10.50",
"compare_at_price": "20.25",
"enabled": 0,
"created_at": "2018-09-20 23:42:30",
"updated_at": "2018-09-20 23:42:30",
"deleted_at": null
}
}
Show/Hide Examples
Partners - User
GET /partners/users/{user_id}
Get a user
Parameters
user_id |
integer |
ID of the user being requested. |
pretty |
boolean |
(Optional / Default: false) Pretty print results (helpful for debugging / testing). |
Partners - User Transactions
GET /partners/users/{user_id}/transactions
Get transactions for a user
Parameters
user_id |
integer |
ID of the user being requested. |
pretty |
boolean |
(Optional / Default: false) Pretty print results (helpful for debugging / testing). |
Example API Call:
curl --header "api_key: p***********************h4" https://www.rxspark.com/api/v1/partners/users/968239/transactions?pretty=1
Example Response:
{
"status": "success",
"message": [
{
"member_id": "RX968239",
"total_billed": "108.13",
"brand_name": "CIALIS",
"generic_name": "TADALAFIL",
"transaction_date": "1902-04-20",
"pharmacy_name": "JUAN'S PHARMACY",
"pharmacy_address": "5270 AIRPORT PKWY STE 114A",
"pharmacy_city": "CHULA VISTA",
"pharmacy_state": "CA",
"pharmacy_zip": "90210",
"drug_form": "TABLET",
"quantity": null,
"days_supply": null,
"ndc": null
}
]
}
Show/Hide Examples
Partners - Register Affiliate
POST /partners/affiliate
Register a sub-partner affiliate under your partnership
Parameters
first_name |
string |
First name of the user. |
last_name |
string |
Last name of the user. |
email |
string |
Email address of the user. |
password |
string |
(Optional) Password of the user. If password is not provided we will generate a temporary password and the user will be forced to change it upon their first login. Disregard this field if the user will authenticate via SSO/SAML. |
gender |
string |
(Optional) Gender of the user. |
address_1 |
string |
(Optional) Address of the user. |
address_2 |
string |
(Optional) Additional address information of the user (ex. Suite #, Apt. #, etc.). |
city |
string |
(Optional) City of the user. |
zip |
string |
(Optional) Zip code of the user. |
phone |
string |
(Optional) Main phone number of the user. |
mobile_phone |
string |
(Optional) Mobile phone number of the user. |
sid |
string |
(Optional) Custom sub ID field to facilitate tracking (ex. an affiliate ID from your internal system). |
sid2 |
string |
(Optional) Additional custom sub ID field. |
pretty |
boolean |
(Optional / Default: false) Pretty print results (helpful for debugging / testing). |
Partners - Get Affiliate by Email
GET /partners/affiliate-by-email
Check if a sub-partner affiliate exists under your partnership
Parameters
email |
string |
Email address of the user. |
pretty |
boolean |
(Optional / Default: false) Pretty print results (helpful for debugging / testing). |
Webhooks
Los socios Hola Doctor Farmacia tienen disponibles webhooks que les permiten suscribirse a notificaciones push. Éstas contienen información sobre ciertos eventos relacionados con su cuenta.
Events
user.created
Recibir una notificación cuando un usuario referido se registre en Hola Doctor Farmacia
Example Notification Payload:
{
"type": "user.created",
"user": {
"id": 25,
"first_name": "George",
"last_name": "Washington III",
"email": "george@aol.com",
"gender": null,
"address_1": "143 Airport Blvd",
"address_2": "Apt. 92",
"city": "Mars",
"state": "NY",
"zip": "30004",
"phone": "8052102807",
"mobile_phone": null,
"created_at": "2017-04-19 22:31:51",
"updated_at": "2017-12-07 22:18:39",
"downloaded_card": 1,
"sid": "42"
}
user.transaction
Recibir una notificación cuando un usuario referido realice una transacción.
Example Notification Payload:
{
"type": "user.transaction",
"user": {
"member_id": "RX25",
"total_billed": "108.13",
"brand_name": "ARMOUR THYROID",
"generic_name": "THYROID, PORK",
"transaction_date": "2017-04-06",
"pharmacy_name": "PEACHTREE PHARMACY",
"pharmacy_address": "5270 PEACHTREE PKWY STE 114A",
"pharmacy_city": "PEACHTREE CORNERS",
"pharmacy_state": "GA",
"pharmacy_zip": "30092-2508",
"drug_form": "TABLET"
"quantity": null,
"days_supply": null,
"ndc": null
}
}