PTV Documentation

1. Go to the Manage page and add at least one pharmacy. This will add them to the WENO Pharmacy Directory that prescribers download.
2. Access your partner ID and md5 version of your password which will be required later. You can find these in your Account Details page
3. Send [email protected] your DEA Approved Pharmacy System audit. The audit will enable EPCS orders to be routed to all of your registered pharmacies.
4. Go to MANAGE ACCOUNT -> MANAGE IPS AND ENDPOINTS and whitelist all IPs you will use to send us messages.
5. Download the full NCPDP 20170715 Schema which includes the ECL here. Your system is already ePrescribing, so we do not go into detail with the schema unless you require it. Contact us if you want full details.


You need a listening endpoint for WENO to send real time eRx messages to your system. In this step we provide sample code to help you create such a listener. When we call your endpoint to send you a eRx message you are required to respond in “real time” with either the NCPDP STATUS or ERROR message.

PHP Code to Receive XML Messages from WENO
This sample_endpoint.php is a PHP sample to receive messages from WENO. You will have to publish it on the site where you want to host the endpoint.

C# Code to Receive XML Messages from WENO
This sample_endpoint.ashx is a generic HTTP handler. You will have to compile it and publish on the site where you want to host the endpoint. Also, this code sample is to receive XML messages but you can adapt it to receive JSON as well.

– Sample Real Time STATUS Message in XML
– Sample Real Time ERROR Message in XML

More about the Real Time Response Messages You Must Implement

The details of the header and body of the STATUS and ERROR messages are included below so you can understand the codes and how to populate the responses properly. Pay close attention to the header as the real time Status and Error is different that free standing Status and Error messages. Real time messages do not use a unique message ID or security. Free standing STATUS and ERROR messages must have a unique message ID, populate the RELATES TO MESSAGE ID & the Security Section with a Nonce Token. The Free standing ERROR and STATUS messages are used to communicate ERROR or STATUS after your system already accepted the message initially.

The Header of all eRx messages explained

Header FieldRequirement & Cardinality NotesData TypeValue Comments
Message AttributesYes, occurs 1x.anDatatypesVersion=”20170715″
TO QualifierYes, occurs 1xECL codesThe ECL codes options WENO support are as follows:
P = Pharmacy
D = Prescriber
C = Clinic
CF = Central Fill Pharmacy
ZZZ = Mutually Defined
PY = Payer
REMS = REMS Administrator
TOYes, occurs 1xan 1..255The WENO Directory will provide the necessary IDs below:
If P is TO Qualifier then enter NCPDP ID
If D is TO Qualifier enter WENO prescriber ID
If C is TO Qualifier enter WENO Clinic ID
If CF is TO Qualifier enter the WENO Central Fill Pharmacy ID
If ZZZ is TO Qualifier enter the appropriate WENO ID
If PY is TO Qualifier enter the WENO Payer ID
IF REMS is TO Qualifier enter the WENO REMS Administrator ID
From QualifierYes, occurs 1xECL codesIf qualifier field is populated then it is expecting these values:
P = Pharmacy
D = Prescriber WENO Online ID
C = Clinic
CF = Central Fill Pharmacy
ZZZ = Mutually Defined
PY = Payer
REMS = REMS Administrator
FromYes, occurs 1xan 1..255

If the From Qualifier is:
P then enter NCPDP ID of the pharmacy
D then enter WENO prescriber ID found in directory
C then enter WENO Location ID found in directory
CF the WENO Central Fill Pharmacy ID found in directory
ZZZ the enter the appropriate WENO ID found in directory
PY then enter the WENO Payer ID found in directory
REMS then enter the WENO REMS Administrator ID found in directory

The WENO Directory will provide the necessary IDs.

Message IDYes, occurs 1xan 1..35Trace number. A unique reference identifier for the transmission, generated from the sender of the request and the sender of the response. When generated from the sender, it is then echoed back in the response message in the field RelatesToMessageID. The value in this field must be present in RelatesToMessageID on subsequent transactions (such as RxRenewalRequest, CancelRx, etc.) to tie back to an original transmission. If STATUS or ERROR message is a real-time response, then the message ID can either be zero or a unique ID.
RelatesToMessageIDConditional, occurs 1x if used. This is needed to tie back to a previous transactionan 1..35On a direct response to electronic transactions this is used (such as a free-standing Error message, Status, RxHistoryResponse) or a subsequent follow up response (such as RxChangeResponse, RxRenewalResponse, CancelRxResponse, MTMServiceResponse) or a subsequent follow up transaction (such as RxFill, Verify), this field is mandatory and is used to link the original message (MessageID) from request to the response or to the subsequent follow up transaction.
Sent TimeYes, occurs 1xUTC Date TypeUTCTimeCode (example: 1970-11-03T13:10:30.64)
SecurityConditional, 1x.
Required by WENO to authenticate API partner
Security, UsernameToken, Username = required, an 1..35, occurs 1x

For real time response use of STATUS or ERROR messages the security segment is not required.
When the EHR or PTV is sending a message for WENO to route, then – WENO requires a NONCE value to replace API Partner ID and password. Another section covers how you request this NONCE value.

SenderSoftware, SenderSoftwareDeveloperYes, occurs 1xan 1..35A contact person for troubleshooting
SenderSoftware, SenderSoftwareProductYes, occurs 1xan 1..35Identifies the entity responsible that generated the transaction. Note: For Status, Error, Verify transactions – contains software identification of the entity creating the response.
SenderSoftware, SenderSoftwareVersionReleaseYes, occurs 1xan 1..50Identifies the software product version release of the entity responsible for generating the transaction or creating the response.
MailboxNONOT supported – do not populateGET Message and Mailboxing is not supported by WENO
TestMessageNO, occurs 1x if usedBooleanIndicates if the message is a test message; however WENO does not allow test messages to go to real entities without prior approval from WENO. WENO provides test Pharmacies, Prescriber and other types of accounts for testing in the WENO Directory.
RxReferenceNumberNO, occurs 1x if usedan 1..35Not used by WENO – you may populate if it is useful
TertiaryIdentifierNO, occurs 1x if usedan 1..3Not used by WENO – you may populate if it is useful
PrescriberOrderNumberNO, occurs 1x if usedan 1..35Not used by WENO – you may populate if it is useful
DigitalSignature Version attributeYes, occurs 1xan

NOTE: Remember that in order for EHRs to send or PTVs to receive EPCS orders we need your DEA approved EPCS audit sent to [email protected].

PTVs populate with “not applicable”

EHRs with their audit should populate the DigitalSignature Version attribute with the version your EHR uses to digitally sign the EPCS orders.

If your EHR does not have its own DEA approved audit for EPCS, you can populate the Version attribute to “not applicable”

DigitalSignatureIndicatorYes, occurs 1xBooleanIs the message digitally signed?
PrescriberOrderGroupNO, occurs 1x if usedSee image in the next column for data types if used.Not used by WENO – you may populate if it is useful
RxOrderReferenceGroupNO, occurs 1x if usedSee image in the next column for data types if usedNot used by WENO – you may populate if it is useful

The Body of the STATUS message


Status Code Meanings

Status CodeMeaning
000Transaction successful (use this one for real time and you can avoid sending free standing STATUS later)
001Transaction successful, message(s) waiting to be retrieved
002No more messages (WENO does not support mail boxing, so this is not to be used)
003Transaction successful, no messages to be retrieved (WENO does not support mail boxing, so this is not to be used)
005Transaction successful, password soon to expire
010Successful – accepted by ultimate receiver (use this one only if you plan to send a Free-Standing STATUS later. It was previously reported as successful, so you could leave it as is unless an ERROR occurs when you deliver to the ultimate receiver, then you can send the Free-Standing ERROR back).

WENO handles VERIFY when EHRs need return receipt so you do not have to.

Status Description Codes

These are not required. If you want to populate them, refer to the 20170715 NCPDP schema we provided.

Prescription Delivery Method Code Meaning

1. Electronic (computer to computer)
2. Faxed

The Body of the ERROR Message

Error CodeWhat it means
600Communication problems – try again later
601Receiver unable to process
602Receiver system error
700Configuration error
900Transaction rejected
Error “Description Code” and meaning
008Request timed out before response could be received
130COO Cardholder last name is invalid
134Sending a quantity of 0 is invalid for this pharmacy
144# of refills is invalid
210Unable to process transaction – please resubmit
220Transaction is a duplicate
500XML syntax error – XPATH of the element in question must accompany in the Description field of this Error
4000Intermediary is unable to deliver transaction to the recipient.
4010Intermediary is unable to process response from recipient.
4020Intermediary system error
4030Sender not allowed to send this transaction type
4040Receiver does not support this transaction type
1000Unable to identify
2000Data content is invalid
3000Does not follow the NCPDP standard

Weno provides an Endpoint tool on your dashboard page MANAGE ACCOUNT -> MANAGE IPS AND ENDPOINTS.

Note: when we ask for the secure endpoint URL be sure to specify the full path of the endpoint URL containing the script that handles the messages Weno sends to your endpoint, which can respond in real time with a Status or Error NCPDP message.

For example, if your server is located at and the endpoint script is under /endpoint.php then your endpoint URL is

SSL is necessary.

Also, you will be asked to provide WENO’s credentials that you will provide to us so we can be authenticated by your system.

To complete step 3

1. Send your newly created endpoint a sample NewRx message successfully and return a real time STATUS message back to WENO using the endpoint testing tool; and
2. Send your new endpoint listener another sample message and make sure you can return a real time ERROR for all the reasons you may reject it. (Use the error codes properly).

You can test your endpoint by sending yourself our samples or send your own sample messages. This image shows how this is done in your Manage IP and Endpoint page.

Suppose your system initially accepts a NewRx on your endpoint listener…then discover it had an issue. This problem can be solved by sending the original sender a Free-Standing ERROR message. This is how to send some free standing ERROR or STATUS test messages:
1. Generate a unique message ID for the ERROR or STATUS message header section.
2. Populate the Test ERROR or STATUS message Header/To field with “D” qualifier and this test WENO Prescriber ID value = D111111:C111111 (in live, you will echo the real prescriber WENO ID using the D qualifier).
3. Populate header FROM as if your recently set up TEST Pharmacy is sending it.
4. Use this value for the field RelatesToMessageID in the header: TEST_RELATES_TO_MESSAGE_ID
5. It requires proper STATUS and Error Code/Description Code/ and Description test. Your Schema ECL has these values. They are listed in step 2 of this guide as well.
6. You can repeat this with a different message ID to test as often as you need.
7. Make sure the IP you are sending from is whitelisted – see step 1.
8. The Transaction Search on your dashboard will show you the message you send. This is useful to drill down and problem solve if needed.
9. Use this endpoint to send NCPDP standard messages, like the FREE standing ERROR or STATUS message to WENO:
10. If you have issues, make sure the ERROR message is valid. Use the WENO Message Validator on the login page of cert dashboard.

You must register and manage all pharmacies using your technology to ePrescribe. We give you 3 ways:

1. Manually via your dashboard MANAGE section.
2. Manage API:
a. Manage API Schema
b. Add (US) Pharmacy Sample Message
c. Edit (US) Pharmacy Sample Message
d. Delete (US) Pharmacy Sample Message
e. Endpoint for Manage API:
For a full list of examples you can download a collection of Manage API sample messages here.
3. A one time bulk upload (contact us for the template). This is useful for a temporary measure to quickly add them all on the live environment when you finish testing, but they must be managed continuously.


To Manually download the prescribers directory, on your dashboard navigation bar go to MANAGE ACCOUNT -> MANAGE LIST page.

Sample Code to Download the Prescriber Directory

Alternatively, you can programmatically download the prescribers directory using code. Find PHP and C# samples below.

PHP Code

$localfilename = "";
// for live data use instead
$url = "";
// provide your Partner ID and password MD5 hash
// as shown on your dashboard under Account details -> Company Data
$partnerid = 'xxx';
$pass_hash = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
$out = fopen($localfilename, 'wb');
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FILE, $out);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERPWD, "{$partnerid}:{$pass_hash}");
echo "Weno $localfilename downloaded!\n"; 

C# Code

using System;
using System.Net;
using System.Text;

namespace Weno
    class Program
        static void Main(string[] args)
            // console application to download Weno directories
            WebClientwebClient = new WebClient();

            // provide your Partner ID and password MD5 hash
            // as shown on your dashboard under Account details -> Company Data
            string partnerId = "123"; // partnerID here 
            string password = "XXXXXXXX"; // partner password md5 hash here 

            // for live data use instead
            string url = "";

            // authenticate with weno
            webClient.Headers["Authorization"] = "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes(partnerId + ":" + password));
            webClient.Headers["Content-Type"] = "application/x-www-form-urlencoded";

            // download file from weno
            webClient.DownloadFile(new Uri(url), "");          
  1. You provided your DEA approved system audit.
  2. You can receive NewRxs to your endpoint and return real time STATUS.
  3. You can receive NewRxs to your endpoint and return real time ERROR.
  4. You can receive a EPCS NewRx to your endpoint and return real time STATUS.
  5. You can receive a EPCS NewRx to your endpoint and return real time ERROR.
  6. Optional: You can send Free-Standing Status that marks it was delivered to ultimate recipient or leave it as assumed.
  7. Required: You can send Free-Standing ERROR that explains why it was not delivered to ultimate recipient or could not be processed (codes/descriptions).
  8. You have either used Manage API to manage pharmacies or WENO did an initial bulk upload for live and you have a way to manage them manually or via Manage API later.
    You will not need access to the WENO prescriber directory until you get to the PTV WOL API +. This will show you how to use the WENO prescriber directory and how to send messages to prescribers.
  9. WENO will reach out for press releases and logo later.


Congratulations! If you’re ready, then contact your certification manager (Kevin Pauley or Tina Goodman) we will register you for the live environment, where you will repeat these sanity checks for live.

Contact your certification manager if you would like WENO to do a bulk upload of all your pharmacies once and then you can either do the required maintenance via API or manually on dashboard. Your certification manager will provide you with more information about this.