Method PostSystemVendorInfo

Summary

System Vendor Information

Remarks

Allows you to retrieve vendor information for a specific vendor or returns all vendors with their information. If the vendor number parameter is populated, then it returns the information for that specific vendor. If the vendor number parameter is left blank, then it will return all system vendors.

Requires

Input Parameters

NameTypeLengthDescription
vendorNumber numeric 10 Vendor number - if blank, returns all

Example

POST http://localhost/FusionServices/v3/Naviline/ProductInventory/SystemVendorInfo

Return Values

NameDescription
ErrorCode 0000=Success
ErrorMessage Error message describing any error that occurred
VendorNumber Vendor number. This is a system vendor number
Name Company name
AddressLine1 Vendor's address line 1. This is the address for Purchase Orders
AddressLine2 Vendor's address line 2
AddressLine3 Vendor's address line 3
City Vendor City
State Vendor State
ZipCode Vendor ZipCode
AreaCode Vendor's phone area code
PhoneNumber Vendor PhoneNumber
FaxNumber Vendor Fax Number
ContactName Vendor Contact Person
VendorYear Vendor's Date of birth (year)
VendorMonth Vendor's Date of birth (month)
VendorDay Vendor's Date of birth (day)
VendorAddressLine1 Vendor's address line 1. This is the address for Bid Information
VendorAddressLine2 Vendor's address line 2
VendorAddressLine3 Vendor's address line 3
VendorCity Vendor City
BDST Vendor State
VendorZipCode Vendor ZipCode
VendorAreaCode Vendor's phone area code
BDPH Vendor PhoneNumber
VendorFaxNumber Vendor Fax Number
RemitAddressLine1 Vendor's mail address line 1. This is the address for Change Remittance
RemitAddressLine2 Vendor's mail address line 2
RemitAddressLine3 Vendor's mail address line 3
RemitCIty Vendor City
RemitState Vendor State
RemitZipCode Vendor ZipCode
TermsDiscountPercent Discount percent for vendor. 2 digit decimal. I.e. 01000 = 10.00
TermsNumDaysDiscDue Number of days discount is available
TermsNumDaysNetDue Number of days net amount is due
ShipVia Shipping instructions
FreeOnBoard Free on board designation. Normally FOB origin or FOB destination
MinorityStatusCode Minority status code. N=None, H=Hispanic
CreditLimit Credit limit for vendor purchases. No decimals
MinimumPurchaseAmount Minimum purchase amount. No decimals
TermsDayofMonthDue Day of month due
VendorTaxID Vendor's Federal Tax ID or SSN number for an individual
TaxIDType T=VendorTaxID is Federal Tax ID S=VendorTaxID is SSN number for an individual
TaxIDSuffix
NumberOfEmployees Number of employees
CERCInfo
OrderEmail Vendor's email
BidEmail Vendor's email for Bid Information
FreeForm1 Free form field 1
FreeForm2 Free form field 2
BusOrIndividual B=Business, I=Individual
1099S? 1099 received. Y=Yes, N=No

Sample Responses

Sample Code

using System.Net;
using Newtonsoft.Json.Linq;

public void MethodName(parms)
{
   string uri = "http://localhost/FusionServices/v3/Naviline/ProductInventory/SystemVendorInfo";
   System.Collections.Specialized.NameValueCollection postParms = 
     new System.Collections.Specialized.NameValueCollection(); 
   // Set paramater values
   postParms.Add("vendorNumber",System.Web.HttpUtility.UrlEncode("3"));

   WebClient req = new WebClient();
   wc.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
   wc.Headers.Set("X-APPID", "YOURID");
   wc.Headers.Set("X-APPKEY", "YOURKEY");

   byte[] responseBytes = wc.UploadValues(new Uri(uri), "POST", postParms);
   string stringResult = Encoding.UTF8.GetString(responseBytes); 
   JObject response = JObject.Parse(stringResult);
   string error = response["OutputParms"]["ErrorCode"].ToString();
   if (error == "0000")
   {
        JArray jRows = (JArray)response["Rows"];
        foreach (JObject row in jRows)
        {
             string VendorNumber = row["VendorNumber"].ToString();
             string Name = row["Name"].ToString();
             string AddressLine1 = row["AddressLine1"].ToString();
             string AddressLine2 = row["AddressLine2"].ToString();
             string AddressLine3 = row["AddressLine3"].ToString();
             string City = row["City"].ToString();
             string State = row["State"].ToString();
             string ZipCode = row["ZipCode"].ToString();
             string AreaCode = row["AreaCode"].ToString();
             string PhoneNumber = row["PhoneNumber"].ToString();
             string ContactName = row["ContactName"].ToString();
             string VendorCentury = row["VendorCentury"].ToString();
             string VendorYear = row["VendorYear"].ToString();
             string VendorMonth = row["VendorMonth"].ToString();
             string VendorDay = row["VendorDay"].ToString();
             string TermsDiscountPercent = row["TermsDiscountPercent"].ToString();
             string TermsNumDaysDiscDue = row["TermsNumDaysDiscDue"].ToString();
             string TermsNumDaysNetDue = row["TermsNumDaysNetDue"].ToString();
             string ShipVia = row["ShipVia"].ToString();
             string FreeOnBoard = row["FreeOnBoard"].ToString();
             string YearToDatePurchases = row["YearToDatePurchases"].ToString();
             string PreviousYearPurchases = row["PreviousYearPurchases"].ToString();
             string QualityIndexcon = row["QualityIndexcon"].ToString();
             string MinorityStatusCode = row["MinorityStatusCode"].ToString();
             string CreditLimit = row["CreditLimit"].ToString();
             string MinimumPurchaseAmount = row["MinimumPurchaseAmount"].ToString();
             string VendorActiveCode = row["VendorActiveCode"].ToString();
             string TermsDayofMonthDue = row["TermsDayofMonthDue"].ToString();
             string FaxNumber = row["FaxNumber"].ToString();
             string VendorTaxID = row["VendorTaxID"].ToString();
             string TaxIDType = row["TaxIDType"].ToString();
             string VendorAddressLine1 = row["VendorAddressLine1"].ToString();
             string VendorAddressLine2 = row["VendorAddressLine2"].ToString();
             string VendorAddressLine3 = row["VendorAddressLine3"].ToString();
             string VendorCity = row["VendorCity"].ToString();
             string VendorState = row["VendorState"].ToString();
             string VendorZipCode = row["VendorZipCode"].ToString();
             string VendorAreaCode = row["VendorAreaCode"].ToString();
             string VendorPhoneNumber = row["VendorPhoneNumber"].ToString();
             string VendorFaxNumber = row["VendorFaxNumber"].ToString();
             string NumberOfEmployees = row["NumberOfEmployees"].ToString();
             string ContactBirthCentury = row["ContactBirthCentury"].ToString();
             string ContactBirthYear = row["ContactBirthYear"].ToString();
             string ContactBirthMonth = row["ContactBirthMonth"].ToString();
             string ContactBirthDay = row["ContactBirthDay"].ToString();
             string CERCInfo = row["CERCInfo"].ToString();
             string DMSPrintEmailDefaults = row["DMSPrintEmailDefaults"].ToString();
             string VendorRemittanceName = row["VendorRemittanceName"].ToString();
             string VendorBidName = row["VendorBidName"].ToString();
             string TaxType = row["TaxType"].ToString();
             string TaxID = row["TaxID"].ToString();
             string TaxIDSuffix = row["TaxIDSuffix"].ToString();
             string CurrencyCode = row["CurrencyCode"].ToString();
             string ActiveInactive = row["ActiveInactive"].ToString();
             string MiscellaneousVendor = row["MiscellaneousVendor"].ToString();
             string OrderEmail = row["OrderEmail"].ToString();
             string PayToEmail = row["PayToEmail"].ToString();
             string BidEmail = row["BidEmail"].ToString();
             string OrderAddressCountry = row["OrderAddressCountry"].ToString();
             string PayAddressCountry = row["PayAddressCountry"].ToString();
             string BidAddressCountry = row["BidAddressCountry"].ToString();
             // TODO - YOUR CODE HERE
        }
   }
}

C# Razor MVC Sample Code

using System;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Collections.Specialized;
using FusionServiceHelper.Models;

// NOTE: Use the namespace generated when you add the class, so that it is correct.
namespace FusionRazor.Models
{
   public class PostSystemVendorInfo
   {
       // Add property for each input param in order to map a field to it
       [RegularExpression("[0-9]{0,10}", ErrorMessage = "Numeric values only. Must be 10 digits or less. ")]
       public string vendorNumber{get; set;}

       public PostSystemVendorInfo()
       {
           //Set any defaults here
       }
   }
}
@* NOTE: Use Add->View to add the View. *@
@* NOTE: Check the 'Create strongly-typed view checkbox, and select the PostSystemVendorInfo class. *@
@* NOTE: Select Edit as the Scaffold template. *@
@* NOTE: Use the @model line that is generated at the top.  Replace the rest with the lines below.
@model FusionRazor.Models.PostSystemVendorInfo

@{
   ViewBag.Title = "PostSystemVendorInfo";
}

<h2>PostSystemVendorInfo</h2>
@using (Html.BeginForm()) {
   @Html.AntiForgeryToken()
   @Html.ValidationSummary(true)
   <fieldset>
   <legend>PostSystemVendorInfo</legend>
       <div class="editor-label">
           @Html.LabelFor(model => model.vendorNumber)
       </div>
       <div class="editor-field">
           @Html.EditorFor(model => model.vendorNumber)
           @Html.ValidationMessageFor(model => model.vendorNumber)
       </div>
       <p>
       <input type="submit" value="Submit"/>
       </p>
   </fieldset>

}

@section Scripts {
   @Scripts.Render("~/bundles/jqueryval")
}
using System;
using System.Collections.Specialized;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using FusionServiceHelper.Models;

// NOTE: Replace 'MyController' with the name of your controller.

// 
// GET: /MyController/PostSystemVendorInfo
public ActionResult PostSystemVendorInfo()
{
   // Create a new instance of the model to pick up any default values.
   PostSystemVendorInfo model =  new PostSystemVendorInfo();

   // pass model to set to default values
   // NOTE: Change 'MyFolderPath' to the path to the .cshtml file.
   return View("~/Views/MyFolderPath/PostSystemVendorInfo.cshtml", model);
}

// 
// POST: /MyController/PostSystemVendorInfo
[HttpPost]
public ActionResult PostSystemVendorInfo(FormCollection collection)
{
   string url = "v3/Naviline/ProductInventory/SystemVendorInfo";
   // Get the value from each input field
   NameValueCollection inputParms = new NameValueCollection();
   inputParms.Add("vendorNumber", collection["vendorNumber"]);

   try
   {
       // Send the request
       FusionServiceRequest request = new FusionServiceRequest();
       FusionServiceResult result = request.Post(url, inputParms);

       return View("Result", result);
   }
   catch(Exception e)
   {
       HandleErrorInfo info = new HandleErrorInfo(e, "MyController", "PostSystemVendorInfo");
       return View("Error", info);
   }
}