From Developer's API

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml;
using System.Text.RegularExpressions;

public partial class SampleClients_OneShopNotificationListener : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)
            // TODO: Add your Merchant ID as the First Parameter, and your Merchant Key as Second Parameter.
            OneShopApi oneShopApiWrapper = new OneShopApi("", "", "");

            System.Text.UTF8Encoding encodeResponse = new System.Text.UTF8Encoding();

            string requestData = encodeResponse.GetString(Request.BinaryRead(Request.TotalBytes));
            XmlDocument requestBodyXML = new XmlDocument();

            // This Line remove the Byte-Order-Mark from the request as the LoadXML does not like data before the XML
            requestBodyXML.LoadXml(Regex.Replace(requestData, "^[^<]|(\\r\\n *)", ""));

            string notificationType = requestBodyXML.DocumentElement.Name;

            string Token = requestBodyXML.SelectSingleNode("/" + notificationType + "/Token").InnerText;

            XmlDocument apiResultXML= new XmlDocument();

            switch (notificationType)
                case "NewOrder":


            // Check that the API returned success
            string apiSuccess = apiResultXML.SelectSingleNode("/Response").Attributes["success"].Value;

            if (apiSuccess == "true")
                // TODO: Do something useful with the XML
                // TODO: Do something with the error returned by the API
        catch (Exception ex)
            // TODO: Log or alert that an exception has occured