public virtual void UploadDocument(UploadDocumentRequest request)
 {
 }
        /// <summary>
        /// Uploads a document. Ex: Receipt, Bill, Business card etc. Only supports single image to be added as of now.
        /// </summary>
        /// <param name="request"></param>
        public override void UploadDocument(UploadDocumentRequest request)
        {
            var boundary = "----------------------------" + DateTime.Now.Ticks.ToString("x");
            const string formDataTemplate = "Content-Disposition: form-data; name=\"{0}\"\r\n\r\n{1}";
            const string headerTemplate =
                "Content-Disposition: form-data; name=\"{0}\"; filename=\"{1}\"\r\nContent-Type: {2}\r\n\r\n";

            var httpWebRequest = (HttpWebRequest) WebRequest.Create(ShoeboxedUploadURL);
            httpWebRequest.ContentType = "multipart/form-data; boundary=" + boundary;
            httpWebRequest.Method = "POST";
            httpWebRequest.KeepAlive = true;

            var boundaryBytes = Encoding.ASCII.GetBytes("\r\n--" + boundary + "\r\n");

            var requestStream = httpWebRequest.GetRequestStream();

            requestStream.Write(boundaryBytes, 0, boundaryBytes.Length);
            var apiUserToken = string.Format(formDataTemplate, "apiUserToken", request.ApiUserToken);
            var apiUserTokenBytes = Encoding.UTF8.GetBytes(apiUserToken);
            requestStream.Write(apiUserTokenBytes, 0, apiUserTokenBytes.Length);

            requestStream.Write(boundaryBytes, 0, boundaryBytes.Length);
            var sbxUserToken = string.Format(formDataTemplate, "sbxUserToken", request.SbxUserToken);
            var sbxUserTokenBytes = Encoding.UTF8.GetBytes(sbxUserToken);
            requestStream.Write(sbxUserTokenBytes, 0, sbxUserTokenBytes.Length);

            requestStream.Write(boundaryBytes, 0, boundaryBytes.Length);
            var imageType = string.Format(formDataTemplate, "imageType", "receipt");
            var imageTypeBytes = Encoding.UTF8.GetBytes(imageType);
            requestStream.Write(imageTypeBytes, 0, imageTypeBytes.Length);

            if (!string.IsNullOrEmpty(request.Note))
            {
                requestStream.Write(boundaryBytes, 0, boundaryBytes.Length);
                var note = string.Format(formDataTemplate, "note", request.Note);
                var noteBytes = Encoding.UTF8.GetBytes(note);
                requestStream.Write(noteBytes, 0, noteBytes.Length);
            }

            if (request.InserterId != null)
            {
                requestStream.Write(boundaryBytes, 0, boundaryBytes.Length);
                var inserterId = string.Format(formDataTemplate, "inserterId", request.InserterId);
                var inserterIdBytes = Encoding.UTF8.GetBytes(inserterId);
                requestStream.Write(inserterIdBytes, 0, inserterIdBytes.Length);
            }

            if (request.CategoryId != null)
            {
                requestStream.Write(boundaryBytes, 0, boundaryBytes.Length);
                var categories = string.Format(formDataTemplate, "categories", request.CategoryId);
                var categoriesBytes = Encoding.UTF8.GetBytes(categories);
                requestStream.Write(categoriesBytes, 0, categoriesBytes.Length);
            }

            if (!string.IsNullOrEmpty(request.ExportAfterProcessing))
            {
                requestStream.Write(boundaryBytes, 0, boundaryBytes.Length);
                var exportAfterProcessing = string.Format(formDataTemplate, "exportAfterProcessing", request.ExportAfterProcessing);
                var exportAfterProcessingBytes = Encoding.UTF8.GetBytes(exportAfterProcessing);
                requestStream.Write(exportAfterProcessingBytes, 0, exportAfterProcessingBytes.Length);
            }

            requestStream.Write(boundaryBytes, 0, boundaryBytes.Length);

            var header = string.Format(headerTemplate, "images", request.ImageURL.Substring(request.ImageURL.IndexOf("Capture")), "image/jpeg");
            var headerBytes = Encoding.UTF8.GetBytes(header);
            requestStream.Write(headerBytes, 0, headerBytes.Length);

            using (var fileStream = new FileStream(request.ImageURL, FileMode.Open, FileAccess.Read))
            {
                var buffer = new byte[4096];
                int bytesRead;

                while ((bytesRead = fileStream.Read(buffer, 0, buffer.Length)) != 0)
                {
                    requestStream.Write(buffer, 0, bytesRead);
                }
            }

            var trailer = Encoding.ASCII.GetBytes("\r\n--" + boundary + "--\r\n");
            requestStream.Write(trailer, 0, trailer.Length);
            requestStream.Close();
        }