BestRx APIs
Contact Us
  1. Prescription API
  • Introduction - BestRx APIs
  • Patient API
    • Overview
    • Error Codes
    • Add Patient
      POST
    • Update Patient
      POST
    • Get Patient
      POST
    • Submit Charge Account Payment
      POST
  • Drug API
    • Overview
    • Error Codes
    • Get Drug Information
      POST
  • Prescription API
    • Overview
    • Error Codes
    • Submit Rx Transfer Request
      POST
    • Return to Stock
      POST
    • Save Rx Signature
      POST
    • Create New Rx From ERx Message
      POST
  • Refill API
    • Overview
    • Error Codes
    • GetPatientProfile
      POST
    • Send Refill Request
      POST
  • BestPOS API
    • Overview
    • Error Codes
    • Create POS Transaction
      POST
    • Get POS Transaction Status
      POST
    • Get Item Details
      POST
    • Get POS Transaction
      GET
    • Update POS Txn Status
      POST
    • Update POS Txn Signature
      POST
    • Get Pharmacy Info
      GET
  • Delivery/Shipping Provider API
    • Overview
    • Error Codes
    • Address Validation
    • Create Order
    • Update Order Status
    • Cancel Order
  • Realtime Data Feed Specification
    • Overview
    • Patient Update Callback
    • E-Prescription Notification Callback
    • Prescription Update Callback
  1. Prescription API

Create New Rx From ERx Message

POST
https://dataservice.bestrxconnect.com/prescription/createnewrxfromerxmessage
INFO
This endpoint is used to create a prescription from an e-prescribing message.
Addtional contracts and transaction fees may apply to use this API. Please contact BestRx for an additional information.

Request

Body Params application/jsonRequired

Example
{
    "pharmacy_id": "1234567890",
    "erx_message_id": "ABCD123XYZ4567890",
    "date_of_service": "2025-10-31",
    "product_id_to_dispense": "12345678901",
    "product_quickcode_to_dispense": "SIMV10MG",
    "qty_prescribed": 10,
    "qty_to_dispense": 10,
    "days_supply_to_dispense": 10,
    "sig_directions": "TAKE 1 TABLET A DAY",
    "rph_initials": "XYZ",
    "tech_initials": "ABC",
    "user_id_to_log": "Smith",
    "place_rx_on_hold": false,
    "rx_queue_recno": 1,
    "pms_patient_id": 123,
    "patient_allergies": [
        {
            "alg_qualifier": "MSKDC",
            "alg_code": "00982",
            "alg_description": "Penicillin G"
        }
    ],
    "use_default_cash_plan": true,
    "insurance_plans": [
        {
            "ins_bin": "123456",
            "ins_pcn": "ABCDEFG",
            "ins_code": "BCBS",
            "ins_name": "Blue Cross Blue Shield",
            "ins_cardholder_id": "1234567890",
            "ins_person_code": "01",
            "ins_relation_code": "1",
            "ins_group": "MCD_INS_GROUP",
            "ins_cardholder_lastname": "Blanco",
            "ins_cardholder_firstname": "Michele",
            "ins_is_primary_for_patient": true
        }
    ],
    "pharmacy_to_link": {
        "address": {
            "street_address_line1": "2625 Butterfield Road",
            "street_address_line2": "Suite 200S",
            "city": "Oak Brook",
            "state_or_province": "IL",
            "postal_code": "60523",
            "country_code": "US"
        },
        "fax_phone": "9876543210",
        "main_phone": "9876543210",
        "main_phone_ext": "123",
        "pharmacist_first_name": "Smith",
        "pharmacist_last_name": "John",
        "pharmacy_dea": "AB1234567",
        "pharmacy_name": "BestRx Pharmacy",
        "pharmacy_ncpdp": "1234567",
        "pharmacy_npi": "9876543210"
    }
}

Responses

🟢200Success
application/json
Body

Example
{
    "Data": {
        "CreateRxStatus": 0,
        "CreateRxStatusDesc": "Prescription Record Successfully Created",
        "CreatedRxInfo": {
            "APIKey": "",
            "PharmacyNumber": "1234567890",
            "PharmacyNumber_Alt": "",
            "pharmacy_info": {
                "pharmacy_name": "BestRx QA Pharmacy",
                "address": {
                    "address1": "1200 Jorie Blvd",
                    "address2": "200",
                    "city": "Oak Brook",
                    "state": "IL",
                    "zipcode": "60523"
                },
                "phone_number": "6301234567",
                "fax_number": "6301234568",
                "npi": "1234567890",
                "ncpdp": "7878785",
                "dea": "XY1234567"
            },
            "transaction_id": "123456",
            "transaction_date": "2025-10-31",
            "transaction_time": "23:59:59",
            "transaction_time_fraction": "3103522",
            "rx_number": "123456",
            "patient_id": 123,
            "patient_last_name": "Smith",
            "patient_first_name": "John",
            "patient_middle_name": "A",
            "patient_prefix": "Mr.",
            "patient_suffix": "Jr.",
            "patient_address1": "1234 Oak Rd",
            "patient_address2": "S123",
            "patient_city": "Bartlett",
            "patient_state": "IL",
            "patient_zip": "60103",
            "patient_home_phone": "1234567890",
            "patient_cell_phone": "1234567890",
            "patient_work_phone": "1234567890",
            "patient_dob": "1950-12-31",
            "patient_gender": "M",
            "patient_email": "smithjohn123@email.com",
            "patient_group": [
                {
                    "group_code": "1",
                    "group_name": "ABC"
                }
            ],
            "family_email": "johnfamily@email.com",
            "patient_short_remark": "Test Short Remark",
            "patient_remark": "Patient Remark",
            "family_remark": "Family Remark",
            "patient_shipto_organization": "John Organization",
            "patient_shipto_last_name": "Smith",
            "patient_shipto_first_name": "John",
            "patient_shipto_careof": "Robert Smith",
            "patient_shipto_address1": "1234 Oak Rd",
            "patient_shipto_address2": "S123",
            "patient_shipto_city": "Bartlett",
            "patient_shipto_state": "IL",
            "patient_shipto_zip": "60103",
            "patient_shipto_phone": "1234567890",
            "is_ltc_patient": true,
            "ltc_facility": {
                "ltc_facility_internal_id": 123,
                "ltc_facility_name": "JOSEPH REHABILITATION CENTER",
                "ltc_facility_code": "JRC",
                "ltc_facility_payer_id": "12345",
                "ltc_facility_contact_name": "Jos",
                "ltc_facility_address": {
                    "address1": "1234 Newport Dr",
                    "address2": "S111",
                    "city": "Wheaton",
                    "state": "IL",
                    "zipcode": "60187"
                },
                "ltc_facility_phone": "6301234567",
                "ltc_facility_fax": "6307654321",
                "ltc_facility_alt_phone1": "9876543210",
                "ltc_facility_alt_phone2": "1234567890"
            },
            "is_deactivated": false,
            "transferred_out": false,
            "transferred_pharmacy": "",
            "transferred_pharmacy_address1": "",
            "transferred_pharmacy_address2": "",
            "transferred_pharmacy_city": "",
            "transferred_pharmacy_state": "",
            "transferred_pharmacy_zip": "",
            "transferred_pharmacy_phone": "",
            "transferred_pharmacy_fax": "",
            "transferred_pharmacy_ncpdp": "",
            "transferred_pharmacy_npi": "",
            "transferred_pharmacy_dea": "",
            "transfer_date": "",
            "transfer_contact_name": "",
            "transfer_rph_initials": "",
            "transfer_rph_user_id": "",
            "transfer_rph_last_name": "",
            "transfer_rph_first_name": "",
            "transferfrom_pharmacy": {
                "pharmacy_name": "Transferring Pharmacy",
                "address": {
                    "address1": "1234 Jorie Blvd",
                    "address2": "Suite 310",
                    "city": "Oak Brook",
                    "state": "IL",
                    "zipcode": "60523"
                },
                "phone_number": "6308939210",
                "fax_number": "6303393171",
                "npi": "1122334455",
                "ncpdp": "1231234",
                "dea": "AB1212121"
            },
            "bill_status": "1",
            "bill_status_text": "Unbilled",
            "workflow_status": "0",
            "workflow_status_text": "Entered into System",
            "workflow_step_performed_code": "1",
            "workflow_step_performed_text": "Entered into System",
            "workflow_step_performed_userid": "BestRx API",
            "workflow_queues": [
                {
                    "queue_code": "1",
                    "queue_name": "New Rxs"
                }
            ],
            "fill_number": "1",
            "fill_date": "2025-12-31",
            "fill_time": "23:59:59",
            "picked_up": "false",
            "delivered": "false",
            "qty_ordered": "10",
            "qty_filled": "10",
            "days_supply": "10",
            "refills_authorized": "3",
            "refills_remaining": "3",
            "refill_number": "0",
            "refill_exp_date": "2026-10-30",
            "item_upc_code": "",
            "drug_ndc": "12345678901",
            "drug_ndc_10digit": "1234567890",
            "drug_ndc_10digit_formatted": "123-456-7890",
            "drug_gpi": "12300010100210",
            "drug_name": "SIMVASTATIN 10 MG",
            "drug_strength": "MG",
            "drug_mfg": "PFIZER",
            "drug_schedule": "0",
            "drug_is_generic": "true",
            "drug_brand_name": "ZOCOR",
            "drug_package_size": "3",
            "drug_form": "EACH",
            "drug_color": "WHITE",
            "drug_shape": "ROUND",
            "drug_front_imprint": "S",
            "drug_back_imprint": "01",
            "drug_misc_info": "WHITE TO OFF-WHITE",
            "lot_number": "LOT1234",
            "lot_exp_date": "2050-12-31",
            "retail": "11.99",
            "billed": "11.99",
            "payers": [
                {
                    "plan_seq_no": "1",
                    "plan_code": "BCBS",
                    "plan_name": "Blue Cross Blue Shield",
                    "plan_bin": "123456",
                    "plan_pcn": "ABCDEFG",
                    "card_id": "1234567890",
                    "group": "MCD_INS_GROUP",
                    "person_code": "01",
                    "relation_code": "1",
                    "plan_bill_status": "1",
                    "plan_bill_status_text": "Unbilled",
                    "cost_paid": "0.00",
                    "disp_fee_paid": "0.00",
                    "tax_paid": "0.00",
                    "discount": "0.00",
                    "pat_pay_amount": "0.00",
                    "due_from_payer": "0.00",
                    "applied_to_deductible": null,
                    "accumulated_deductible": null,
                    "remaining_deductible": null
                }
            ],
            "cost": "5.67",
            "patient_amount_due": "0.00",
            "due_from_insurance": "0.00",
            "total_paid": "0.00",
            "margin": "-5.67",
            "margin_percent": "-100.00",
            "is340b": "false",
            "dispense_as_written": "false",
            "daw_code": "0",
            "date_rx_written": "2025-10-31",
            "signature": "TAKE 1 TABLET A DAY",
            "dosage_info": [
                {
                    "dose_slot": 1,
                    "dose_time": "MORNING",
                    "dose_qty": "1",
                    "dose_days": "daily"
                }
            ],
            "rx_source": "5 - At Pharmacy or Transferred",
            "rph_initials": "XYZ",
            "tech_initials": "ABC",
            "rx_serial_number": "",
            "submission_clar_code": "",
            "other_coverage_code": "",
            "horizon_graveyard_code": "",
            "diagnosis": [
                {
                    "qualifier": "02",
                    "code": "I10",
                    "description": "Essential (primary) hypertension"
                }
            ],
            "doctor_id": 12345,
            "doctor_last_name": "DOE",
            "doctor_first_name": "JANE",
            "doctor_middle_name": "A",
            "doctor_prefix": "DR.",
            "doctor_suffix": "JR.",
            "doctor_npi": "1234567890",
            "doctor_dea": "AB1234567",
            "doctor_state_licno": "1234567",
            "doctor_dps_no": "",
            "doctor_medicaid_no": "1234567890",
            "doctor_upin": "A1B2C3D",
            "doctor_address1": "WEST CITY MEDICAL CENTER",
            "doctor_address2": "Ste C",
            "doctor_city": "CHICAGO",
            "doctor_state": "IL",
            "doctor_zip": "60612",
            "doctor_phone": "7732229987",
            "doctor_fax": "7732229999",
            "doctor_email": "doejane@email.com",
            "doctor_remark": "CALL OFFICE NUMBER FIRST",
            "doctor_profession_code": "",
            "doctor_profession_desc": "",
            "doctor_ama_specialty_code": "",
            "doctor_ama_grouping": "",
            "doctor_ama_classification": "",
            "doctor_ama_specialization": "",
            "doctor_surescripts_service_level": "New, Refill, Change, RxFill, Cancel, ePA",
            "next_refill_date": "2025-11-30",
            "drug_therapeutic_class": "",
            "prescribed_drug": "SIMVASTATIN 10 MG",
            "filled_by": "",
            "erx_message_id": "ABCD123XYZ4567890",
            "erx_prescriber_order_no": "110022",
            "erx_patient_medical_record_no": "",
            "erx_facility_code": "",
            "rx_remark": "",
            "erx_pharmacy_remark": "",
            "erx_prescriber_remark": "",
            "erx_drug_notes": "",
            "written_date_remark": "",
            "inactivate_rx_remark": "",
            "shipping_provider": "",
            "shipping_tracking_number": "",
            "dispense_using": "Safety Caps",
            "is_medsync_shortfill": false,
            "claim_reject_info": [],
            "pbm_message": null,
            "claim_additional_messages": [],
            "document_count": 0,
            "lot_serial_info": [
                {
                    "drug_ndc": "1234567890",
                    "qty": 10.0,
                    "compound_seqno": 0,
                    "lot_number": "12345",
                    "lot_exp_date": "2025-12-31",
                    "serial_number": "1234567890"
                }
            ],
            "ProgramInfo": {
                "ApplicationName": "Internet Information Services",
                "ApplicationVersion": "10.0.17763.1",
                "ComputerName": "BESTRX_VMSERVER",
                "ComputerUser": "IIS APPPOOL\\CREATERXAPI"
            }
        }
    },
    "IsValid": true,
    "Messages": []
}
đźź 400Missing Required Fields
Modified at 2025-11-20 20:04:52
Previous
Save Rx Signature
Next
Overview