API Reference

Introduction

Welcome to the RxSpark API Reference. Here you will find details about how to use the RxSpark 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 RxSpark API key.

Endpoints

Create User - POST /api/v1/users


Register a user to the site, and return a link to the user's savings card download URL.

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

Autocomplete - Drugs - GET /api/v1/autocomplete


Autocomplete drug names

Parameters
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)"
    ]
}

Drug Prices - GET /api/v1/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
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"
            ]
        }
    }
}

Drug Info - GET /api/v1/drug-info


Get information about a drug.

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

Drug Codes - GET /api/v1/drug-codes


Find a drug by various identifiers for use subsquently in the price search endpoint. Only one code may be specified.

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

Conditions - GET /api/v1/conditions


Get information about a condition.

Parameters
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)"
            },
            ...
        ]
    }
}

Multiauth - GET /api/v1/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
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"
}

Partners - Shop Status - POST /api/v1/partners/shop-status


Enable / disable your RxSpark Partner Shop

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

Partners - Shop Name - GET /api/v1/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"}

Partners - Shop Name - POST /api/v1/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."}

Partners - Product Status - POST /api/v1/partners/product-status


Enable / disable a product in your RxSpark Partner Shop

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

Partners - Product Categories - GET /api/v1/partners/product-categories


List product categories

Parameters

Partners - Products - GET /api/v1/partners/products


List the products in your RxSpark Partner Shop

Parameters
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
        }
    ]
}

Partners - Create Product - POST /api/v1/partners/products


Create a product in your RxSpark Partner Shop

Parameters
Example API Call:
curl -X POST --header "api_key: p***********************h4" --header "Accept: application/json" --data "title=Test Item&description=Test&price=10.50&compare_at_price=20.25" https://www.rxspark.com/api/v1/partners/products
Example Response:
{"status":"success","message":"Product saved."}

Partners - Product - GET /api/v1/partners/products/{product_id}


Get the details of a product in your RxSpark Partner Shop

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

Partners - User Transactions - GET /api/v1/partners/users/{user_id}/transactions


Get transactions for a user

Parameters
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
        }
    ]
}

Webhooks

Webhooks are available for RxSpark Partners and will allow you to subscribe to push notifications containing information about certain events relating to your account.

Events

user.created

Receive a notification when a user you've referred signs up for RxSpark

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
}

user.transaction

Receive a notification when a user you've referred makes a transaction.

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