Here's an example method, where the required fields are included in the Uri, then the optional ref2 field added with a textbox value. The response is returned as XML. You could do something with the XML if need be afterwards. In my case, I just displayed the xml in a label to check that it went thru ok.
Obviously, replace any values with XXXXXX in it, with your own.
// formulate our request to the recurring billing api.
string requestUri = "https://www.beanstream.com/scripts/recurring_billing.asp?merchantId=XXXXXXXXXX" +
"&serviceVersion=1.0" +
"&requestType=BACKEND" +
"&operationType=M" +
"&passCode=XXXXX - Look for this in the Order Settings page - XXXXXXXXXXXXXXX" +
"&rbAccountId=XXXXXX - This is the recurring account id. - XXXXXXXXX" +
"&ref2=" + Ref2TextBox.Text;
WebRequest request = WebRequest.Create(requestUri);
request.Method = "POST";
request.ContentLength = 0;
WebResponse response = request.GetResponse();
Stream dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
string responseFromServer = reader.ReadToEnd();
reader.Close();
response.Close();